com.ibm.ulc.comm
Class ORBConnection

java.lang.Object
  |
  +--com.ibm.ulc.util.UlcObject
        |
        +--com.ibm.ulc.comm.UlcConnection
              |
              +--com.ibm.ulc.comm.ORBConnection

public class ORBConnection
extends UlcConnection

A connection with an associated object space. Objects in the object space conform to ICallable. An ORBConnection can optionally send interesting events to a registered listener.

See Also:
Registry, ICallable, IORBListener, Serialized Form

Fields inherited from class com.ibm.ulc.comm.UlcConnection
fgDebug, fgIPAddr, INVALIDPORT
 
Constructor Summary
ORBConnection(java.lang.String urlString, IRequestProcessor rp, boolean dispose, Registry r)
          ORBConnection constructor.
ORBConnection(java.lang.String urlString, IRequestProcessor rp, java.lang.String connId, java.lang.String clientData, boolean dispose, Registry r)
          ORBConnection constructor.
ORBConnection(UlcTransport transport, IRequestProcessor rp, boolean dispose, Registry r)
          ORBConnection constructor.
ORBConnection(UlcTransport transport, IRequestProcessor rp, java.lang.String connId, java.lang.String clientData, boolean dispose, Registry r)
          ORBConnection constructor.
 
Method Summary
 void addListener(IORBListener listener)
           
 Request createRequest()
          Creates a request to be used with this connection.
 void disposeRegistry()
          Disposing the object registry.
 ICallable find(int oid)
          Finds a given object in this connection's registry.
 IAnythingReader getAnythingReader(java.io.InputStream is)
          Creates an AnythingReader used for streaming Anythings.
 IAnythingWriter getAnythingWriter()
          Creates an AnythingWriter used for streaming Anythings.
 long getContextId()
           
 ORBRequest getCurrentRequest()
           
 int getCurrentRequestId()
           
 java.lang.String getLabel()
           
 Registry getRegistry()
          Returns the connection's registry.
 void receivedRequest(int target, java.lang.String request, Anything args)
          Handles receivedRequest notification by informing the listener.
 int register(ICallable c)
          Register an object in this connection's object space.
 void register(int oid, ICallable c)
          Register an object in this object space with a specific ID.
 void send(int oid, java.lang.String request, Anything args)
          Create an ORBRequest for the given target and arguments and send it to the other communication end point.
 void setContextId(long contextId)
           
 void setCurrentRequest(ORBRequest request)
           
protected  void shutdownHook()
          Handles the shutdown of the connection by disposing the object registry.
 void unregister(int oid)
          Remove an object from this connection's object space.
 
Methods inherited from class com.ibm.ulc.comm.UlcConnection
addRequestListener, close, finalize, getApplicationName, getClientData, getFileFromUrlString, getHost, getHostFromUrlString, getId, getLocalHost, getLocalUrlString, getPort, getPortFromUrlString, getProtocolFromUrlString, getReferenceFromUrlString, getRemoteUrlString, getRequestFilter, getRequestListeners, getTransport, getUrlString, postRequest, receive, removeRequestListener, send, setRequestFilter, start
 
Methods inherited from class com.ibm.ulc.util.UlcObject
trouble, trouble2, trouble2Err, troubleErr
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORBConnection

public ORBConnection(UlcTransport transport,
                     IRequestProcessor rp,
                     java.lang.String connId,
                     java.lang.String clientData,
                     boolean dispose,
                     Registry r)
ORBConnection constructor.
Parameters:
transport - com.ibm.ulc.comm.UlcTransport
rp - com.ibm.ulc.comm.IRequestProcessor
connId - java.lang.String
clientData - java.lang.String
dispose - boolean
r - Registry

ORBConnection

public ORBConnection(UlcTransport transport,
                     IRequestProcessor rp,
                     boolean dispose,
                     Registry r)
ORBConnection constructor.
Parameters:
transport - com.ibm.ulc.comm.UlcTransport
rp - com.ibm.ulc.comm.IRequestProcessor
dispose - boolean
r - Registry

ORBConnection

public ORBConnection(java.lang.String urlString,
                     IRequestProcessor rp,
                     java.lang.String connId,
                     java.lang.String clientData,
                     boolean dispose,
                     Registry r)
ORBConnection constructor.
Parameters:
urlString - java.lang.String
rp - com.ibm.ulc.comm.IRequestProcessor
connId - java.lang.String
clientData - java.lang.String
dispose - boolean
r - Registry

ORBConnection

public ORBConnection(java.lang.String urlString,
                     IRequestProcessor rp,
                     boolean dispose,
                     Registry r)
ORBConnection constructor.
Parameters:
urlString - java.lang.String
rp - com.ibm.ulc.comm.IRequestProcessor
dispose - boolean
r - Registry
Method Detail

addListener

public void addListener(IORBListener listener)

createRequest

public Request createRequest()
Creates a request to be used with this connection.
Overrides:
createRequest in class UlcConnection
See Also:
UlcConnection

disposeRegistry

public void disposeRegistry()
Disposing the object registry.

find

public ICallable find(int oid)
Finds a given object in this connection's registry.

getAnythingReader

public IAnythingReader getAnythingReader(java.io.InputStream is)
Creates an AnythingReader used for streaming Anythings. Remembers the received format.

getAnythingWriter

public IAnythingWriter getAnythingWriter()
Creates an AnythingWriter used for streaming Anythings. What kind of writer to use depends on the format of received events.

getContextId

public long getContextId()

getCurrentRequest

public ORBRequest getCurrentRequest()

getCurrentRequestId

public int getCurrentRequestId()

getLabel

public java.lang.String getLabel()

getRegistry

public Registry getRegistry()
Returns the connection's registry.

receivedRequest

public void receivedRequest(int target,
                            java.lang.String request,
                            Anything args)
Handles receivedRequest notification by informing the listener.

register

public void register(int oid,
                     ICallable c)
Register an object in this object space with a specific ID.

register

public int register(ICallable c)
Register an object in this connection's object space. Returns its ID.

send

public void send(int oid,
                 java.lang.String request,
                 Anything args)
Create an ORBRequest for the given target and arguments and send it to the other communication end point.

setContextId

public void setContextId(long contextId)

setCurrentRequest

public void setCurrentRequest(ORBRequest request)

shutdownHook

protected void shutdownHook()
Handles the shutdown of the connection by disposing the object registry.
Overrides:
shutdownHook in class UlcConnection

unregister

public void unregister(int oid)
Remove an object from this connection's object space.