@Override public void onMessageReceived(Session session, Message message) { byte[] bytes = message.content(); SERVICE service = this.option.getPaladinSerializer().decode(bytes); if (service == null) { return; } Context ctx = new Context(session, message, option.getPaladinSerializer()); executeService(ctx, service); }
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(); }
public void mappingNS(String packageName) throws Exception { option.setMappingNSPackage(packageName); registry.mappingPackage(packageName); }
public void setThreads(int threads) { option.setThreads(threads); }