Пример #1
0
 @Override
 public void shutdown() {
   log.info("Instance engine shutdown started");
   scriptManager.shutdown();
   scriptManager = null;
   handlers.clear();
   log.info("Instance engine shutdown complete");
 }
Пример #2
0
  @Override
  public void load(CountDownLatch progressLatch) {
    log.info("Instance engine load started");
    scriptManager = new ScriptManager();

    AggregatedClassListener acl = new AggregatedClassListener();
    acl.addClassListener(new OnClassLoadUnloadListener());
    acl.addClassListener(new ScheduledTaskClassListener());
    acl.addClassListener(new InstanceHandlerClassListener());
    scriptManager.setGlobalClassListener(acl);

    try {
      scriptManager.load(INSTANCE_DESCRIPTOR_FILE);
      log.info("Loaded " + handlers.size() + " instance handlers.");
    } catch (Exception e) {
      throw new GameServerError("Can't initialize instance handlers.", e);
    } finally {
      if (progressLatch != null) progressLatch.countDown();
    }
  }