Package com.jme3.network.service
Class AbstractService<S extends ServiceManager>
java.lang.Object
com.jme3.network.service.AbstractService<S>
- All Implemented Interfaces:
- Service<S>
- Direct Known Subclasses:
- AbstractClientService,- AbstractHostedService
public abstract class AbstractService<S extends ServiceManager>
extends Object
implements Service<S>
Base class providing some default Service 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetService(Class<T> type) Retrieves the first sibling service of the specified type.protected SReturns the ServiceManager that was passed to initialize() during service initialization.final voidinitialize(S serviceManager) Initializes this service by keeping a reference to the service manager and calling onInitialize().protected abstract voidonInitialize(S serviceManager) Called during initialize() for the subclass to perform implementation specific initialization.voidstart()Default implementation does nothing.voidstop()Default implementation does nothing.voidDefault implementation does nothing.toString()
- 
Constructor Details- 
AbstractServiceprotected AbstractService()
 
- 
- 
Method Details- 
getServiceManagerReturns the ServiceManager that was passed to initialize() during service initialization.
- 
getServiceRetrieves the first sibling service of the specified type.
- 
initializeInitializes this service by keeping a reference to the service manager and calling onInitialize().- Specified by:
- initializein interface- Service<S extends ServiceManager>
 
- 
onInitializeCalled during initialize() for the subclass to perform implementation specific initialization.
- 
startpublic void start()Default implementation does nothing. Implementations can override this to perform custom startup behavior.- Specified by:
- startin interface- Service<S extends ServiceManager>
 
- 
stoppublic void stop()Default implementation does nothing. Implementations can override this to perform custom stop behavior.- Specified by:
- stopin interface- Service<S extends ServiceManager>
 
- 
terminateDefault implementation does nothing. Implementations can override this to perform custom termination behavior.- Specified by:
- terminatein interface- Service<S extends ServiceManager>
 
- 
toString
 
-