Exemple #1
0
  private void executeService(Context ctx, SERVICE service) {
    String ns = service.getNs();
    NSHandler handler = registry.lookup(ns);
    if (handler == null) {
      LOGGER.error("NS[" + ns + "] not found.");
      return;
    }

    handler.service(ctx, service);
  }
Exemple #2
0
  public synchronized void startup() {
    if (hydra != null) {
      return;
    }

    if (registry.isEmpty()) {
      LOGGER.error("Not found NS handler was be registered");
      return;
    }

    HydraBuilder builder = new HydraBuilder();
    builder.bind(host).port(port).messageReceivedListener(this).threads(option.getThreads());
    hydra = builder.build();
    hydra.startup();
  }
Exemple #3
0
 public void mappingNS(String packageName) throws Exception {
   option.setMappingNSPackage(packageName);
   registry.mappingPackage(packageName);
 }