/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/HoerupUtilsPlugin.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1761 by torben, Wed Mar 21 17:04:29 2012 UTC revision 1762 by torben, Wed Mar 21 19:24:25 2012 UTC
# Line 9  import org.bukkit.plugin.java.JavaPlugin Line 9  import org.bukkit.plugin.java.JavaPlugin
9    
10  import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands;  import dk.thoerup.bukkit.hoeruputils.creative.GeneralContractorCommands;
11  import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener;  import dk.thoerup.bukkit.hoeruputils.secretdoor.DoorBlockListener;
12    import dk.thoerup.bukkit.hoeruputils.web.WebLoader;
13    
14  public class HoerupUtilsPlugin extends JavaPlugin {  public class HoerupUtilsPlugin extends JavaPlugin {
15    
# Line 77  public class HoerupUtilsPlugin extends J Line 78  public class HoerupUtilsPlugin extends J
78                  try {                  try {
79                          try {                          try {
80                                  //først probes om klassen i det hele taget findes                                  //først probes om klassen i det hele taget findes
81                                  Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController");                                  Class.forName("de.codeinfection.quickwango.ApiBukkit.ApiServer.ApiController"); //if it fails it throws an exception
82                                                                    WebLoader.getInstance().load(this, logintimeHandler.getConfig(), home.getConfig());
83                                  Class<?>webloader = Class.forName("dk.thoerup.bukkit.hoeruputils.web.WebLoader");                                                
                                 Method load = webloader.getMethod("load", HoerupUtilsPlugin.class, Configuration.class, Configuration.class);  
                                 Object args[] = {this, logintimeHandler.getConfig(), home.getConfig() };  
                                 load.invoke(null, args);  
                                   
84                                  getLogger().warning("ApiBukkit found, status listener registered");                                  getLogger().warning("ApiBukkit found, status listener registered");
85                                                                    
86                          } catch (ClassNotFoundException e) {                          } catch (ClassNotFoundException e) {
87                                  getLogger().warning("Could not find ApiBukkit - web status is disabled" );                                  getLogger().warning("Could not find ApiBukkit - web status is disabled" );
88                          }                          }                      
                           
89                  } catch (Throwable e) { //instead of ClassNotFoundException + NoSuchMethodException + InvocationTargetException + IllegalAccessException                  } catch (Throwable e) { //instead of ClassNotFoundException + NoSuchMethodException + InvocationTargetException + IllegalAccessException
90                          getLogger().warning("Could not find ApiBukkit - web status is disabled (" + e.getClass().getName() + ":" + e.getMessage() + ")"  );                          getLogger().warning("Could not find ApiBukkit - web status is disabled (" + e.getClass().getName() + ":" + e.getMessage() + ")"  );
91                  }                  }

Legend:
Removed from v.1761  
changed lines
  Added in v.1762

  ViewVC Help
Powered by ViewVC 1.1.20