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 Details

    • AbstractHostedService

      protected AbstractHostedService()
  • Method Details

    • getServer

      protected Server getServer()
      Returns the server for this hosted service or null if the service is not yet attached.
    • connectionAdded

      public void connectionAdded(Server server, HostedConnection hc)
      Default implementation does nothing. Implementations can override this to perform custom new connection behavior.
      Specified by:
      connectionAdded in interface ConnectionListener
    • connectionRemoved

      public void connectionRemoved(Server server, HostedConnection hc)
      Default implementation does nothing. Implementations can override this to perform custom leaving connection behavior.
      Specified by:
      connectionRemoved in interface ConnectionListener