use of com.jme3.network.util.SessionDataDelegator in project jmonkeyengine by jMonkeyEngine.
the class RpcHostedService method onInitialize.
/**
* Used internally to setup the message delegator that will
* handle HostedConnection specific messages and forward them
* to that connection's RpcConnection.
*/
@Override
protected void onInitialize(HostedServiceManager serviceManager) {
Server server = serviceManager.getServer();
// A general listener for forwarding the messages
// to the client-specific handler
this.delegator = new SessionDataDelegator(RpcConnection.class, ATTRIBUTE_NAME, true);
server.addMessageListener(delegator, delegator.getMessageTypes());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Registered delegator for message types:{0}", Arrays.asList(delegator.getMessageTypes()));
}
}
Aggregations