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
ConstructorDescriptionDefaultServerAdmin
(AbstractServer<?, ? extends ServerAdmin> server, ServerConfiguration configuration) Instantiates a new DefaultServerAdmin instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal Collection<RemoteClient>
clients()
final Collection<RemoteClient>
final Collection<RemoteClient>
final Collection<String>
final int
final void
disconnect
(UUID clientId) Unregisters the connection from the server, if connection pooling is enabled for the user the connection is pooled.final List<ServerAdmin.GcEvent>
gcEvents
(long since) final int
final long
final double
int
final ServerInformation
serverStatistics
(long since) final void
setConnectionLimit
(int value) final void
shutdown()
Shuts down the serverfinal double
final String
final long
final long
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
-
gcEvents
- Specified by:
gcEvents
in interfaceServerAdmin
- Parameters:
since
- the time since from which to get gc events- Returns:
- a list containing garbage collection notifications
-
threadStatistics
- Specified by:
threadStatistics
in interfaceServerAdmin
- Returns:
- current thread statistics
- Throws:
RemoteException
- in case of an exception
-
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
- Parameters:
user
- the user for which to retrieve the clients- Returns:
- the clients associated with the given user
- Throws:
RemoteException
- in case of a communication error
-
clients
- Specified by:
clients
in interfaceServerAdmin
- Parameters:
clientType
- the type of clients to retrieve- Returns:
- the clients of the given type
-
clients
- Specified by:
clients
in interfaceServerAdmin
- Returns:
- all clients connected to the server
-
clientTypes
- Specified by:
clientTypes
in interfaceServerAdmin
- Returns:
- the identifiers of the client types connected to the server
-
disconnect
Description copied from interface:ServerAdmin
Unregisters the connection from the server, if connection pooling is enabled for the user the connection is pooled.- Specified by:
disconnect
in interfaceServerAdmin
- Parameters:
clientId
- the id of the client- 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
-
requestsPerSecond
public int requestsPerSecond()- Specified by:
requestsPerSecond
in interfaceServerAdmin
- Returns:
- the number of service requests per second
-
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
-
totalMemory
public final long totalMemory()- Specified by:
totalMemory
in interfaceServerAdmin
- Returns:
- the total amount of memory allocated by the server process
-
usedMemory
public final long usedMemory()- Specified by:
usedMemory
in interfaceServerAdmin
- Returns:
- the amount of memory being used by the server process
-
maxMemory
public final long maxMemory()- Specified by:
maxMemory
in interfaceServerAdmin
- Returns:
- the maximum amount of memory available to the server process
-
systemCpuLoad
- Specified by:
systemCpuLoad
in interfaceServerAdmin
- Returns:
- the system cpu load, a negative number if not available
- Throws:
RemoteException
- in case of a communication error- See Also:
-
processCpuLoad
- Specified by:
processCpuLoad
in interfaceServerAdmin
- Returns:
- the java vm process cpu load, a negative number if not available
- Throws:
RemoteException
- in case of a communication error- See Also:
-
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
-