Class RmiClientService
- All Implemented Interfaces:
- ClientService,- Service<ClientServiceManager>
Objects are shared by adding them to the RmiRegistry with one of the share() methods. Shared objects must have a separate interface and implementation. The interface is what the other end of the connection will use to interact with the object and that interface class must be available on both ends of the connection. The implementing class need only be on the sharing end.
Shared objects can be accessed on the other end of the connection by using one of the RmiRegistry's getRemoteObject() methods. These can be used to lookup an object by class if it is a shared singleton or by name if it was registered with a name.
Note: This RMI implementation is not as advanced as Java's regular RMI as it won't marshall shared references, ie: you can't pass a shared objects as an argument to another shared object's method.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<T> TgetRemoteObject(Class<T> type) Looks up a remote object on the server by type and returns a local proxy to the remote object that was shared on the other end of the network connection.<T> TgetRemoteObject(String name, Class<T> type) Looks up a remote object on the server by name and returns a local proxy to the remote object that was shared on the other end of the network connection.protected voidCalled during initialize() for the subclass to perform implementation specific initialization.<T> voidShares the specified object with the server and associates it with the specified name.<T> voidShares the specified object with the server and associates it with the specified type.<T> voidShares the specified object with the server and associates it with the specified name.<T> voidShares the specified object with the server and associates it with the specified type.voidstart()Default implementation does nothing.Methods inherited from class com.jme3.network.service.AbstractClientServicegetClientMethods inherited from class com.jme3.network.service.AbstractServicegetService, getServiceManager, initialize, stop, terminate, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jme3.network.service.ClientServiceinitialize, stop, terminate
- 
Constructor Details- 
RmiClientServicepublic RmiClientService()
- 
RmiClientServicepublic RmiClientService(short rmiObjectId, byte defaultChannel) 
 
- 
- 
Method Details
- 
getRemoteObjectLooks up a remote object on the server by type and returns a local proxy to the remote object that was shared on the other end of the network connection.
- 
getRemoteObjectLooks up a remote object on the server by name and returns a local proxy to the remote object that was shared on the other end of the network connection.
- 
onInitializeDescription copied from class:AbstractServiceCalled during initialize() for the subclass to perform implementation specific initialization.- Specified by:
- onInitializein class- AbstractService<ClientServiceManager>
 
- 
startpublic void start()Description copied from class:AbstractServiceDefault implementation does nothing. Implementations can override this to perform custom startup behavior.- Specified by:
- startin interface- ClientService
- Specified by:
- startin interface- Service<ClientServiceManager>
- Overrides:
- startin class- AbstractService<ClientServiceManager>