if (executor instanceof StatefulKnowledgeSession) {
type = 0;
} else {
throw new IllegalArgumentException("Type is not supported for registration");
}
Message msg = new Message(messageSession.getSessionId(), messageSession.getCounter().incrementAndGet(), false, new KnowledgeContextResolveFromContextCommand(new RegisterCommand(identifier, ((StatefulKnowledgeSessionRemoteClient) executor).getInstanceId(), type), null, null, null, null));
//System.out.println("Registering " + identifier + " - - " + client.getId());
connection.getDirectoryNode(null).register(identifier, client.getId());
try {