Package com.jme3.network.service
Class AbstractHostedService
java.lang.Object
com.jme3.network.service.AbstractService<HostedServiceManager>
com.jme3.network.service.AbstractHostedService
- All Implemented Interfaces:
ConnectionListener
,HostedService
,Service<HostedServiceManager>
- Direct Known Subclasses:
AbstractHostedConnectionService
,RmiHostedService
,ServerSerializerRegistrationsService
public abstract class AbstractHostedService
extends AbstractService<HostedServiceManager>
implements HostedService
Convenient base class for HostedServices providing some default HostedService
interface implementations as well as a few convenience methods
such as getServiceManager() and getService(type). Subclasses
must at least override the onInitialize() method to handle
service initialization.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connectionAdded
(Server server, HostedConnection hc) Default implementation does nothing.void
connectionRemoved
(Server server, HostedConnection hc) Default implementation does nothing.protected Server
Returns the server for this hosted service or null if the service is not yet attached.Methods inherited from class com.jme3.network.service.AbstractService
getService, getServiceManager, initialize, onInitialize, start, stop, terminate, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.jme3.network.service.HostedService
initialize, start, stop, terminate
-
Constructor Details
-
AbstractHostedService
protected AbstractHostedService()
-
-
Method Details
-
getServer
Returns the server for this hosted service or null if the service is not yet attached. -
connectionAdded
Default implementation does nothing. Implementations can override this to perform custom new connection behavior.- Specified by:
connectionAdded
in interfaceConnectionListener
-
connectionRemoved
Default implementation does nothing. Implementations can override this to perform custom leaving connection behavior.- Specified by:
connectionRemoved
in interfaceConnectionListener
-