Package org.serviceconnector.server
Class Server
java.lang.Object
org.serviceconnector.server.Server
- All Implemented Interfaces:
IServer
- Direct Known Subclasses:
CascadedSC,FileServer,StatefulServer
The Class Server. Represents a server instance on a backend Server. Serves a service. Has control over the max of sessions and holds a connection pool to communicate to a
backend server. Servers activity is observed by a timer. It gets initialized by adding server to server registry.
- Author:
- JTraber
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanThe destroyed, marks if server has been destroyed.protected final doubleThe operation timeout multiplier.protected RemoteNodeConfigurationThe remote node configuration.protected RequesterThe requester.protected StringThe server key.protected doubleThe server timeout milliseconds.protected InetSocketAddressThe socket address. -
Constructor Summary
ConstructorsConstructorDescriptionServer(RemoteNodeConfiguration remoteNodeConfiguration, InetSocketAddress socketAddress) Instantiates a new server. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy server.Gets the connection typegetHost()Gets the host.intGets the max connections.intGets the port number.Gets the requester.Gets the server key.doubleGets the server timeout milliseconds.Gets the socket address.Gets the server timeout.Gets the timeouter task.getType()Gets the server type.voidImmediate connect.booleanChecks if the server has been destroyed.voidsetTimeout(ScheduledFuture<TimeoutWrapper> timeout) Sets the server timeout.voidsetTimeouterTask(TimeoutWrapper timeouterTask) Sets the timeouter task.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.serviceconnector.server.IServer
abortSession, dump
-
Field Details
-
remoteNodeConfiguration
The remote node configuration. -
socketAddress
The socket address. -
requester
The requester. -
serverKey
The server key. -
destroyed
protected volatile boolean destroyedThe destroyed, marks if server has been destroyed. -
operationTimeoutMultiplier
protected final double operationTimeoutMultiplierThe operation timeout multiplier. -
serverTimeoutMillis
protected double serverTimeoutMillisThe server timeout milliseconds.
-
-
Constructor Details
-
Server
Instantiates a new server.- Parameters:
remoteNodeConfiguration- the remote node configurationsocketAddress- the socket address
-
-
Method Details
-
immediateConnect
Immediate connect.- Throws:
Exception- the exception
-
getSocketAddress
Gets the socket address.- Returns:
- the socket address
-
getTimeout
Gets the server timeout.- Returns:
- the server timeout
-
setTimeout
Sets the server timeout.- Parameters:
timeout- the new server timeout
-
setTimeouterTask
Sets the timeouter task.- Parameters:
timeouterTask- the new timeouter task
-
getTimeouterTask
Gets the timeouter task.- Returns:
- the timeouter task
-
getHost
Gets the host.- Returns:
- the host
-
getPortNr
public int getPortNr()Gets the port number.- Returns:
- the port number
-
getConnectionType
Gets the connection type- Returns:
- the host
-
getMaxConnections
public int getMaxConnections()Gets the max connections.- Returns:
- the max connections
-
getType
Gets the server type. -
getServerTimeoutMillis
public double getServerTimeoutMillis()Gets the server timeout milliseconds.- Returns:
- the server timeout milliseconds
-
getServerKey
Gets the server key.- Returns:
- the server key
-
getRequester
Gets the requester.- Returns:
- the requester
-
isDestroyed
public boolean isDestroyed()Checks if the server has been destroyed.- Returns:
- true, if is destroyed
-
destroy
public void destroy()Destroy server. -
toString
-