org.tentackle.appworx.rmi
Class AppRemoteDbSessionImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.tentackle.db.rmi.RemoteDbSessionImpl
                  extended by org.tentackle.appworx.rmi.AppRemoteDbSessionImpl
All Implemented Interfaces:
Serializable, Remote, AppRemoteDbSession, RemoteDbSession

public class AppRemoteDbSessionImpl
extends RemoteDbSessionImpl
implements AppRemoteDbSession

Extends RemoteDbSessionImpl using AppUserInfo and AppDbObjectCache.

Author:
harald
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tentackle.db.rmi.RemoteDbSessionImpl
sessions
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
AppRemoteDbSessionImpl(RemoteDbConnectionImpl con, UserInfo clientInfo, UserInfo serverInfo)
          Creates a session on a given connection.
 
Method Summary
protected  void closeDb()
          Closes the database connection (and thus rolls back any pending transaction).
 long getUserId()
          Gets the object id associated with the AppUserInfo passed in to AppRemoteDbConnection#login.
 
Methods inherited from class org.tentackle.db.rmi.RemoteDbSessionImpl
cleanup, cleanupSessions, close, finalize, getClientSocketFactory, getClientSocketFactory, getClientUserInfo, getConnection, getDb, getDbObjectClass, getDbRemoteDelegate, getPort, getPort, getRemoteDelegate, getServerSocketFactory, getServerSocketFactory, getServerUserInfo, isOpen, log, openDb, startCleanupThread, toString
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.tentackle.db.rmi.RemoteDbSession
close, getDbRemoteDelegate, getRemoteDelegate, log
 

Constructor Detail

AppRemoteDbSessionImpl

public AppRemoteDbSessionImpl(RemoteDbConnectionImpl con,
                              UserInfo clientInfo,
                              UserInfo serverInfo)
                       throws RemoteException
Creates a session on a given connection.

Parameters:
con - the connection
clientInfo - the UserInfo from the client
serverInfo - the UserInfo to establish the connection to the database server
Throws:
RemoteException - if the session could not initiated.
Method Detail

getUserId

public long getUserId()
               throws RemoteException
Description copied from interface: AppRemoteDbSession
Gets the object id associated with the AppUserInfo passed in to AppRemoteDbConnection#login.

Specified by:
getUserId in interface AppRemoteDbSession
Returns:
the user id
Throws:
RemoteException

closeDb

protected void closeDb()
Closes the database connection (and thus rolls back any pending transaction). If the db is pooled, it will be returned to the pool instead of being closed.

If the db is pooled, it will be returned to the pool instead of being closed. Otherwise all entries in the AppDbObjectCache will be removed for that db.

Overrides:
closeDb in class RemoteDbSessionImpl


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de