Package org.serviceconnector.service
Class StatefulService
java.lang.Object
org.serviceconnector.service.Service
org.serviceconnector.service.StatefulService
- Direct Known Subclasses:
PublishService,SessionService
The Class StatefulService.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<StatefulServer>The list of servers.protected intThe server index. -
Constructor Summary
ConstructorsConstructorDescriptionStatefulService(String name, ServiceType type) Instantiates a new stateful service. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddServer(StatefulServer server) Adds the server.voiddump(XMLDumpWriter writer) Dump the service into the xml writer.intGets the count allocated sessions.intGets the count available sessions.intGets the count servers.Gets the server list.voidNotify removed session.voidremoveServer(StatefulServer server) Removes the server.toString()Methods inherited from class org.serviceconnector.service.Service
getName, getType, isEnabled, setEnabled
-
Field Details
-
serverIndex
protected int serverIndexThe server index. -
listOfServers
The list of servers.
-
-
Constructor Details
-
StatefulService
Instantiates a new stateful service.- Parameters:
name- the nametype- the type
-
-
Method Details
-
addServer
Adds the server.- Parameters:
server- the server
-
removeServer
Removes the server. Removing server must be synchronized. Avoids exception for client in allocate server logic.- Parameters:
server- the server
-
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
-
dump
Dump the service into the xml writer.
-