java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
is.codion.common.rmi.server.DefaultServerAdmin
- All Implemented Interfaces:
ServerAdmin
,Serializable
,Remote
A base server admin implementation.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.rmi.server.ServerAdmin
ServerAdmin.GcEvent, ServerAdmin.ServerStatistics, ServerAdmin.ThreadStatistics
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultServerAdmin
(AbstractServer<?, ? extends ServerAdmin> server, ServerConfiguration configuration) Instantiates a new DefaultServerAdmin instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal Collection
<RemoteClient> clients()
final int
final void
disconnect
(UUID clientId) Disconnects the given client from the serverfinal int
protected int
final ServerInformation
serverStatistics
(long since) final void
setConnectionLimit
(int value) final void
shutdown()
Shuts down the serverfinal String
final Collection
<User> users()
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Constructor Details
-
DefaultServerAdmin
public DefaultServerAdmin(AbstractServer<?, ? extends ServerAdmin> server, ServerConfiguration configuration) throws RemoteExceptionInstantiates a new DefaultServerAdmin instance.- Parameters:
server
- the server to administerconfiguration
- the server configuration- Throws:
RemoteException
- in case of an exception
-
-
Method Details
-
serverInformation
- Specified by:
serverInformation
in interfaceServerAdmin
- Returns:
- static information about the server
-
systemProperties
- Specified by:
systemProperties
in interfaceServerAdmin
- Returns:
- the server system properties
-
users
- Specified by:
users
in interfaceServerAdmin
- Returns:
- the users currently connected to the server
- Throws:
RemoteException
- in case of a communication error
-
clients
- Specified by:
clients
in interfaceServerAdmin
- Returns:
- all clients connected to the server
-
disconnect
Description copied from interface:ServerAdmin
Disconnects the given client from the server- Specified by:
disconnect
in interfaceServerAdmin
- Parameters:
clientId
- the id of the client to disconnect- Throws:
RemoteException
- in case of a communication error
-
shutdown
Description copied from interface:ServerAdmin
Shuts down the server- Specified by:
shutdown
in interfaceServerAdmin
- Throws:
RemoteException
- in case of a communication error
-
serverStatistics
- Specified by:
serverStatistics
in interfaceServerAdmin
- Parameters:
since
- the time since from which to retrieve statistics- Returns:
- current statistics for this server
- Throws:
RemoteException
- in case of an exception
-
connectionCount
public final int connectionCount()- Specified by:
connectionCount
in interfaceServerAdmin
- Returns:
- the number of active connections
-
getConnectionLimit
public final int getConnectionLimit()- Specified by:
getConnectionLimit
in interfaceServerAdmin
- Returns:
- the maximum number of concurrent connections this server accepts
-
setConnectionLimit
public final void setConnectionLimit(int value) - Specified by:
setConnectionLimit
in interfaceServerAdmin
- Parameters:
value
- the maximum number of concurrent connections this server accepts
-
requestsPerSecond
protected int requestsPerSecond()- Returns:
- the number of service requests per second
-