/** * Returns the client for this client service or null if * the service is not yet attached. */ protected Client getClient() { ClientServiceManager csm = getServiceManager(); return csm == null ? null : csm.getClient(); }
/** * Used internally to unregister the RPC MessageDelegator that * was previously added to the network Client. */ @Override public void terminate( ClientServiceManager serviceManager ) { Client client = serviceManager.getClient(); client.removeMessageListener(delegator, delegator.getMessageTypes()); }
@Override protected void onInitialize( ClientServiceManager serviceManager ) { // Make sure our message type is registered if it isn't already if( Serializer.getExactSerializerRegistration(SerializerRegistrationsMessage.class) == null ) { // This is the minimum we'd need just to be able to register // the rest... otherwise we can't even receive this message. Serializer.registerClass(SerializerRegistrationsMessage.class); Serializer.registerClass(SerializerRegistrationsMessage.Registration.class); } else { log.log(Level.INFO, "Skipping registration of SerializerRegistrationsMessage."); } // Add our listener for that message type serviceManager.getClient().addMessageListener(this, SerializerRegistrationsMessage.class); }
/** * Used internally to setup the RpcConnection and MessageDelegator. */ @Override protected void onInitialize( ClientServiceManager serviceManager ) { Client client = serviceManager.getClient(); this.rpc = new RpcConnection(client); delegator = new ObjectMessageDelegator(rpc, true); client.addMessageListener(delegator, delegator.getMessageTypes()); }
/** * Returns the client for this client service or null if * the service is not yet attached. */ protected Client getClient() { ClientServiceManager csm = getServiceManager(); return csm == null ? null : csm.getClient(); }
/** * Used internally to unregister the RPC MessageDelegator that * was previously added to the network Client. */ @Override public void terminate( ClientServiceManager serviceManager ) { Client client = serviceManager.getClient(); client.removeMessageListener(delegator, delegator.getMessageTypes()); }
@Override protected void onInitialize( ClientServiceManager serviceManager ) { // Make sure our message type is registered if it isn't already if( Serializer.getExactSerializerRegistration(SerializerRegistrationsMessage.class) == null ) { // This is the minimum we'd need just to be able to register // the rest... otherwise we can't even receive this message. Serializer.registerClass(SerializerRegistrationsMessage.class); Serializer.registerClass(SerializerRegistrationsMessage.Registration.class); } else { log.log(Level.INFO, "Skipping registration of SerializerRegistrationsMessage."); } // Add our listener for that message type serviceManager.getClient().addMessageListener(this, SerializerRegistrationsMessage.class); }
/** * Used internally to setup the RpcConnection and MessageDelegator. */ @Override protected void onInitialize( ClientServiceManager serviceManager ) { Client client = serviceManager.getClient(); this.rpc = new RpcConnection(client); delegator = new ObjectMessageDelegator(rpc, true); client.addMessageListener(delegator, delegator.getMessageTypes()); }