org.tentackle.db.rmi
Class DbOperationRemoteDelegateImpl<T extends DbOperation>

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.RemoteDelegateImpl<T>
                  extended by org.tentackle.db.rmi.DbOperationRemoteDelegateImpl<T>
Type Parameters:
T - the database operation class
All Implemented Interfaces:
Serializable, Remote, DbOperationRemoteDelegate, RemoteDelegate
Direct Known Subclasses:
AppDbOperationRemoteDelegateImpl

public abstract class DbOperationRemoteDelegateImpl<T extends DbOperation>
extends RemoteDelegateImpl<T>
implements DbOperationRemoteDelegate

Base class for the remote delegate of DbOperation.
All other subclasses of DbOperation should extend DbOperationRemoteDelegateImpl to reflect the class hierarchy below DbOperation.

Author:
harald
See Also:
Serialized Form

Field Summary
protected  T dbObject
           
 
Fields inherited from class org.tentackle.db.rmi.RemoteDelegateImpl
clazz, csf, db, port, session, ssf
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz)
          Creates a delegate on the session socket.
DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int socketConfig)
          Creates a delegate on a non-default session socket.
DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          Creates delegate.
 
Method Summary
protected  T newObject()
          Creates a new instance of the required class for methods that return a new object.
protected  void setup()
          Instantiates a singe object and connect it to the db.
 
Methods inherited from class org.tentackle.db.rmi.RemoteDelegateImpl
getClientSocketFactory, getPort, getServerSocketFactory, getSession
 
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, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dbObject

protected T extends DbOperation dbObject
Constructor Detail

DbOperationRemoteDelegateImpl

public DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session,
                                     Class<T> clazz,
                                     int port,
                                     RMIClientSocketFactory csf,
                                     RMIServerSocketFactory ssf)
                              throws RemoteException
Creates delegate.

Parameters:
session - is the RMI session
clazz - is the class the delegate provides service for
port - the port number on which the remote object receives calls, 0 = system default
csf - the client-side socket factory for making calls to the remote object, null = system default
ssf - the server-side socket factory for receiving remote calls, null = system default
Throws:
RemoteException

DbOperationRemoteDelegateImpl

public DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session,
                                     Class<T> clazz)
                              throws RemoteException
Creates a delegate on the session socket.

Parameters:
session - is the RMI session
clazz - is the subclass of DbOperation
Throws:
RemoteException

DbOperationRemoteDelegateImpl

public DbOperationRemoteDelegateImpl(RemoteDbSessionImpl session,
                                     Class<T> clazz,
                                     int socketConfig)
                              throws RemoteException
Creates a delegate on a non-default session socket.

Parameters:
session - is the RMI session
clazz - is the subclass of DbOperation
socketConfig - is of RemoteDbSessionImpl.SOCKETCONFIG_...
Throws:
RemoteException
Method Detail

setup

protected void setup()
              throws RemoteException
Instantiates a singe object and connect it to the db. (if class is not abstract). The object is used for all methods not returning a new object and thus minimizes object construction.

Throws:
RemoteException

newObject

protected T newObject()
                                   throws RemoteException
Creates a new instance of the required class for methods that return a new object.

Returns:
the new object
Throws:
RemoteException


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