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 intfinal voiddisconnect(UUID clientId) Disconnects the given client from the serverfinal intprotected intfinal ServerInformationfinal voidsetConnectionLimit(int value) final voidshutdown()Shuts down the serverstatistics(long since) final Stringfinal Collection<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
-
serializationFilterPatterns
- Specified by:
serializationFilterPatternsin interfaceServerAdmin- Returns:
- the active serialization filter patterns
-
users
- Specified by:
usersin interfaceServerAdmin- Returns:
- the users currently connected to the server
-
clients
- Specified by:
clientsin interfaceServerAdmin- Returns:
- all clients connected to the server
-
disconnect
Description copied from interface:ServerAdminDisconnects the given client from the server- Specified by:
disconnectin interfaceServerAdmin- Parameters:
clientId- the id of the client to disconnect- 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
-
statistics
- Specified by:
statisticsin 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:
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
-
requestsPerSecond
protected int requestsPerSecond()- Returns:
- the number of service requests per second
-