org.tentackle.appworx.rmi
Class AppDbOperationRemoteDelegateImpl<T extends AppDbOperation>

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>
                      extended by org.tentackle.appworx.rmi.AppDbOperationRemoteDelegateImpl<T>
Type Parameters:
T - the AppDbOperation class
All Implemented Interfaces:
Serializable, Remote, AppDbOperationRemoteDelegate, DbOperationRemoteDelegate, RemoteDelegate

public abstract class AppDbOperationRemoteDelegateImpl<T extends AppDbOperation>
extends DbOperationRemoteDelegateImpl<T>
implements AppDbOperationRemoteDelegate

Implementation of the remote delegate for AppDbOperation.
Never instantiated.

Author:
harald
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tentackle.db.rmi.DbOperationRemoteDelegateImpl
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
AppDbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz)
          Creates a delegate on the session socket.
AppDbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int socketConfig)
          Create a delegate on a non-default session socket.
AppDbOperationRemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          Creates delegate.
 
Method Summary
protected  T newObject(ContextDb cb)
          Creates a new instance of the required class in the given context for methods that return a new object.
protected  void setContextDb(ContextDb cb)
          Sets the contextdb in the default object.
protected  void setup()
          Instantiates a singe object and connect it to the database context.
 
Methods inherited from class org.tentackle.db.rmi.DbOperationRemoteDelegateImpl
newObject
 
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
 

Constructor Detail

AppDbOperationRemoteDelegateImpl

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

Parameters:
session - the RMI session
clazz - 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

AppDbOperationRemoteDelegateImpl

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

Parameters:
session - the RMI session
clazz - the subclass of DbObject
Throws:
RemoteException

AppDbOperationRemoteDelegateImpl

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

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

setup

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

Overrides:
setup in class DbOperationRemoteDelegateImpl<T extends AppDbOperation>
Throws:
RemoteException

setContextDb

protected void setContextDb(ContextDb cb)
Sets the contextdb in the default object.

Parameters:
cb - the db context

newObject

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

Parameters:
cb - the db context
Returns:
the created object
Throws:
RemoteException


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