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 longfinal Collection<RemoteClient>clients()final Collection<RemoteClient>clients(is.codion.common.user.User user) final Collection<RemoteClient>final Collection<String>final intfinal voiddisconnect(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 intfinal longfinal doubleintfinal ServerInformationserverStatistics(long since) final voidsetConnectionLimit(int value) final voidshutdown()Shuts down the serverfinal doublefinal Stringfinal longfinal Collection<is.codion.common.user.User>users()Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods 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:
serverInformationin interfaceServerAdmin- Returns:
- static information about the server
-
systemProperties
- Specified by:
systemPropertiesin interfaceServerAdmin- Returns:
- the server system properties
-
gcEvents
- Specified by:
gcEventsin interfaceServerAdmin- Parameters:
since- the time since from which to get gc events- Returns:
- a list containing garbage collection notifications
-
threadStatistics
- Specified by:
threadStatisticsin interfaceServerAdmin- Returns:
- current thread statistics
- Throws:
RemoteException- in case of an exception
-
users
- Specified by:
usersin interfaceServerAdmin- Returns:
- the users currently connected to the server
- Throws:
RemoteException- in case of a communication error
-
clients
public final Collection<RemoteClient> clients(is.codion.common.user.User user) throws RemoteException - Specified by:
clientsin 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:
clientsin interfaceServerAdmin- Parameters:
clientTypeId- the client type for which to retrieve the clients- Returns:
- the clients associated with the given user
-
clients
- Specified by:
clientsin interfaceServerAdmin- Returns:
- all clients connected to the server
-
clientTypes
- Specified by:
clientTypesin interfaceServerAdmin- Returns:
- the identifiers of the client types connected to the server
-
disconnect
Description copied from interface:ServerAdminUnregisters the connection from the server, if connection pooling is enabled for the user the connection is pooled.- Specified by:
disconnectin interfaceServerAdmin- Parameters:
clientId- the id of the client- Throws:
RemoteException- in case of a communication error
-
shutdown
Description copied from interface:ServerAdminShuts down the server- Specified by:
shutdownin interfaceServerAdmin- Throws:
RemoteException- in case of a communication error
-
requestsPerSecond
public int requestsPerSecond()- Specified by:
requestsPerSecondin interfaceServerAdmin- Returns:
- the number of service requests per second
-
serverStatistics
- Specified by:
serverStatisticsin interfaceServerAdmin- Parameters:
since- the time since from which to retrieve statistics- Returns:
- current statistics for this server
- Throws:
RemoteException- in case of an exception
-
allocatedMemory
public final long allocatedMemory()- Specified by:
allocatedMemoryin interfaceServerAdmin- Returns:
- the total amount of memory allocated by the server process
-
usedMemory
public final long usedMemory()- Specified by:
usedMemoryin interfaceServerAdmin- Returns:
- the amount of memory being used by the server process
-
maxMemory
public final long maxMemory()- Specified by:
maxMemoryin interfaceServerAdmin- Returns:
- the maximum amount of memory available to the server process
-
systemCpuLoad
- Specified by:
systemCpuLoadin 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:
processCpuLoadin 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:
connectionCountin interfaceServerAdmin- Returns:
- the number of active connections
-
getConnectionLimit
public final int getConnectionLimit()- Specified by:
getConnectionLimitin interfaceServerAdmin- Returns:
- the maximum number of concurrent connections this server accepts
-
setConnectionLimit
public final void setConnectionLimit(int value) - Specified by:
setConnectionLimitin interfaceServerAdmin- Parameters:
value- the maximum number of concurrent connections this server accepts
-