public abstract class RemoteDbConnectionImpl extends RemoteServerObject implements RemoteDbConnection
Overview of what happens in a Tentackle RMI application server:
ref| Constructor and Description |
|---|
RemoteDbConnectionImpl(DbServer server,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
Creates a connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkClientVersionInfo(Serializable clientVersionInfo)
Checks the client's version information.
|
abstract RemoteDbSession |
createSession(SessionInfo clientInfo)
Creates the session.
Needs to be implemented by the application. |
int |
exportRemoteObject(Remote remoteObject,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
Exports the given remote object.
|
protected void |
finalize()
Overridden to detect unwanted garbage collection as this
should never happen.
|
RMIClientSocketFactory |
getClientSocketFactory(Session session,
SessionInfo clientInfo,
SessionInfo serverInfo)
Gets the client socket factory according to the userinfos.
|
int |
getPort(Session session,
SessionInfo clientInfo,
SessionInfo serverInfo)
Gets the tcp port for this connection.
|
DbServer |
getServer()
Gets the DbServer.
|
RMIServerSocketFactory |
getServerSocketFactory(Session session,
SessionInfo clientInfo,
SessionInfo serverInfo)
Gets the server socket factory.
|
Serializable |
getServerVersionInfo()
Gets the application-specific version information of the server.
|
int |
getSessionTimeout(Session session,
SessionInfo clientInfo,
SessionInfo serverInfo)
Gets the session timeout count.
|
RemoteDbSession |
login(SessionInfo clientInfo)
Login to remote RMI-server.
|
void |
logout(RemoteDbSession session)
Logout from remote RMI-Server.
|
void |
unexportRemoteObject(Remote remoteObject)
Exports the given remote object.
|
getRMICsf, getRMIPort, getRMISsfclone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogpublic RemoteDbConnectionImpl(DbServer server, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
server - the DbServerport - the tcp-port, 0 = system defaultcsf - the client socket factory, null = system defaultssf - the server socket factory, null = system defaultRemoteExceptionDbServerpublic DbServer getServer()
public int getSessionTimeout(Session session, SessionInfo clientInfo, SessionInfo serverInfo)
session - the session attached to the RemoteDbSessionclientInfo - the UserInfo from the clientserverInfo - the UserInfo to establish the connection to the database serverpublic int getPort(Session session, SessionInfo clientInfo, SessionInfo serverInfo)
session - the session attached to the RemoteDbSessionclientInfo - the UserInfo from the clientserverInfo - the UserInfo to establish the connection to the database serverpublic RMIClientSocketFactory getClientSocketFactory(Session session, SessionInfo clientInfo, SessionInfo serverInfo)
session - the session attached to the RemoteDbSessionclientInfo - the UserInfo from the clientserverInfo - the UserInfo to establish the connection to the database serverpublic RMIServerSocketFactory getServerSocketFactory(Session session, SessionInfo clientInfo, SessionInfo serverInfo)
session - the session attached to the RemoteDbSessionclientInfo - the UserInfo from the clientserverInfo - the UserInfo to establish the connection to the database serverpublic void checkClientVersionInfo(Serializable clientVersionInfo) throws VersionInfoIncompatibleException
The default implementation does nothing.
It is invoked from Db.open() for remote connections.
clientVersionInfo - the server's version info from RemoteDbConnection.VersionInfoIncompatibleException - if versions are not compatiblepublic abstract RemoteDbSession createSession(SessionInfo clientInfo) throws RemoteException
clientInfo - the client info (login info)RemoteException - if creation failedpublic int exportRemoteObject(Remote remoteObject, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
Notice that the delegate must not extend UnicastRemoteObject!
remoteObject - the object to exportport - the port to export the object on, 0 if autocsf - the client-side socket factory for making calls to the remote object, null if system defaultssf - the server-side socket factory for receiving remote calls, null if system defaultRemoteException - if export failedpublic void unexportRemoteObject(Remote remoteObject) throws RemoteException
remoteObject - the object to unexportRemoteExceptionprotected void finalize()
throws Throwable
public Serializable getServerVersionInfo() throws RemoteException
RemoteDbConnectiongetServerVersionInfo in interface RemoteDbConnectionRemoteExceptionpublic RemoteDbSession login(SessionInfo clientInfo) throws RemoteException
RemoteDbConnectionlogin in interface RemoteDbConnectionclientInfo - the user informationRemoteException - if some error, for example wrong passordpublic void logout(RemoteDbSession session) throws RemoteException
RemoteDbConnectionlogout in interface RemoteDbConnectionsession - to be closedRemoteException - if some errorCopyright © 2016 Krake Softwaretechnik. All rights reserved.