Class AbstractRemoteEntityConnection

java.lang.Object
is.codion.framework.server.AbstractRemoteEntityConnection
All Implemented Interfaces:
Remote

public abstract class AbstractRemoteEntityConnection extends Object implements Remote
A base class for remote connections served by a EntityServer. Handles logging of service calls and database connection pooling.
  • Field Details

    • connectionProxy

      protected final EntityConnection 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 RemoteException
      Instantiates a new AbstractRemoteEntityConnection, exported on the given port number unless the port is negative, in which case the connection is not exported (it serves an HTTP client in-process and needs no RMI stub).
      Parameters:
      domain - the domain model
      database - defines the underlying database
      remoteClient - information about the client requesting the connection
      port - the port to use when exporting this remote connection, negative to not export
      clientSocketFactory - the client socket factory to use, null for default
      serverSocketFactory - the server socket factory to use, null for default
      Throws:
      RemoteException - in case of an exception
      DatabaseException - in case a database connection can not be established, for example if a wrong username or password is provided
  • Method Details

    • user

      public final User 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