Class StatefulService

java.lang.Object
org.serviceconnector.service.Service
org.serviceconnector.service.StatefulService
Direct Known Subclasses:
PublishService, SessionService

public abstract class StatefulService extends Service
The Class StatefulService.
  • Field Details

    • serverIndex

      protected int serverIndex
      The server index.
    • listOfServers

      protected List<StatefulServer> listOfServers
      The list of servers.
  • Constructor Details

    • StatefulService

      public StatefulService(String name, ServiceType type)
      Instantiates a new stateful service.
      Parameters:
      name - the name
      type - the type
  • Method Details

    • addServer

      public void addServer(StatefulServer server)
      Adds the server.
      Parameters:
      server - the server
    • removeServer

      public void removeServer(StatefulServer server)
      Removes the server. Removing server must be synchronized. Avoids exception for client in allocate server logic.
      Parameters:
      server - the server
    • getServerList

      public List<StatefulServer> getServerList()
      Gets the server list.
      Returns:
      the server list
    • getCountServers

      public int getCountServers()
      Gets the count servers.
      Returns:
      the count servers
    • getCountAllocatedSessions

      public int getCountAllocatedSessions()
      Gets the count allocated sessions.
      Returns:
      the count allocated sessions
    • getCountAvailableSessions

      public int getCountAvailableSessions()
      Gets the count available sessions.
      Returns:
      the count available sessions
    • notifyRemovedSession

      public void notifyRemovedSession()
      Notify removed session. Notification of a session removal on given stateful service.
    • toString

      public String toString()
      Overrides:
      toString in class Service
    • dump

      public void dump(XMLDumpWriter writer) throws Exception
      Dump the service into the xml writer.
      Specified by:
      dump in class Service
      Parameters:
      writer - the writer
      Throws:
      Exception - the exception