org.tentackle.db.rmi
Class RemoteDelegateImpl<T>

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>
Type Parameters:
T - the class handled by this delegate
All Implemented Interfaces:
Serializable, Remote, RemoteDelegate
Direct Known Subclasses:
DbObjectRemoteDelegateImpl, DbOperationRemoteDelegateImpl, ModificationThreadRemoteDelegateImpl

public abstract class RemoteDelegateImpl<T>
extends UnicastRemoteObject
implements RemoteDelegate

All remote delegates must extend this class

Author:
harald
See Also:
Serialized Form

Field Summary
protected  Class<T> clazz
          class handled by this delegate
protected  RMIClientSocketFactory csf
          the client socket factory
protected  Db db
          the local db-connection
protected  int port
          the connection port
protected  RemoteDbSessionImpl session
          the server session
protected  RMIServerSocketFactory ssf
          the server socket factory
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz)
          Creates delegate on the session socket.
RemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int socketConfig)
          Creates delegate running on one of the four different predefined session sockets.
RemoteDelegateImpl(RemoteDbSessionImpl session, Class<T> clazz, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          Creates a delegate.
 
Method Summary
 RMIClientSocketFactory getClientSocketFactory()
          Gets the client socket factory.
 int getPort()
          Gets the port number.
 RMIServerSocketFactory getServerSocketFactory()
          Gets the server socket factory.
 RemoteDbSessionImpl getSession()
          Gets the server session.
 
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

session

protected RemoteDbSessionImpl session
the server session


db

protected Db db
the local db-connection


clazz

protected Class<T> clazz
class handled by this delegate


port

protected int port
the connection port


csf

protected RMIClientSocketFactory csf
the client socket factory


ssf

protected RMIServerSocketFactory ssf
the server socket factory

Constructor Detail

RemoteDelegateImpl

public RemoteDelegateImpl(RemoteDbSessionImpl session,
                          Class<T> clazz,
                          int port,
                          RMIClientSocketFactory csf,
                          RMIServerSocketFactory ssf)
                   throws RemoteException
Creates a 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

RemoteDelegateImpl

public RemoteDelegateImpl(RemoteDbSessionImpl session,
                          Class<T> clazz)
                   throws RemoteException
Creates delegate on the session socket. This should be the default constructor.

Parameters:
session - is the RMI session
clazz - is the class the delegate provides service for
Throws:
RemoteException

RemoteDelegateImpl

public RemoteDelegateImpl(RemoteDbSessionImpl session,
                          Class<T> clazz,
                          int socketConfig)
                   throws RemoteException
Creates delegate running on one of the four different predefined session sockets. Useful, for example, if the session usually is non-ssl but certain data needs ssl.

Parameters:
session - is the RMI session
clazz - is the class the delegate provides service for
socketConfig - is of RemoteDbSessionImpl.SOCKETCONFIG_...
Throws:
RemoteException
Method Detail

getSession

public RemoteDbSessionImpl getSession()
Gets the server session.

Returns:
the session

getPort

public int getPort()
Gets the port number.

Returns:
the port for this delegate

getClientSocketFactory

public RMIClientSocketFactory getClientSocketFactory()
Gets the client socket factory.

Returns:
the csf for this delegate

getServerSocketFactory

public RMIServerSocketFactory getServerSocketFactory()
Gets the server socket factory.

Returns:
the ssf for this delegate


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