Module is.codion.framework.server
Package is.codion.framework.server
Class AbstractRemoteEntityConnection
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
is.codion.framework.server.AbstractRemoteEntityConnection
- All Implemented Interfaces:
Serializable
,Remote
A base class for remote connections served by a
EntityServer
.
Handles logging of service calls and database connection pooling.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final EntityConnection
A Proxy for logging method callsFields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRemoteEntityConnection
(Domain domain, Database database, RemoteClient remoteClient, int port, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory) Instantiates a new AbstractRemoteEntityConnection and exports it on the given port number -
Method Summary
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
-
Field Details
-
connectionProxy
A Proxy for logging method calls
-
-
Constructor Details
-
AbstractRemoteEntityConnection
protected AbstractRemoteEntityConnection(Domain domain, Database database, RemoteClient remoteClient, int port, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory) throws DatabaseException, RemoteException Instantiates a new AbstractRemoteEntityConnection and exports it on the given port number- Parameters:
domain
- the domain modeldatabase
- defines the underlying databaseremoteClient
- information about the client requesting the connectionport
- the port to use when exporting this remote connectionclientSocketFactory
- the client socket factory to use, null for defaultserverSocketFactory
- the server socket factory to use, null for default- Throws:
RemoteException
- in case of an exceptionDatabaseException
- in case a database connection can not be established, for example if a wrong username or password is provided
-
-
Method Details
-
user
- Returns:
- the user this connection is using
-
connected
public final boolean connected()- Returns:
- true if this connection is connected
-
close
public final void close()Disconnects this connection
-