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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionAdded(Server server, HostedConnection hc) Default implementation does nothing.voidconnectionRemoved(Server server, HostedConnection hc) Default implementation does nothing.protected ServerReturns 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
connectionAddedin interfaceConnectionListener
-
connectionRemoved
Default implementation does nothing. Implementations can override this to perform custom leaving connection behavior.- Specified by:
connectionRemovedin interfaceConnectionListener
-