FileDocCategorySizeDatePackage
Connection.javaAPI DocJava SE 5 API6203Fri Aug 26 14:54:34 BST 2005com.sun.corba.se.pept.transport

Connection

public interface Connection

Connection represents a transport in the PEPt architecture.

author
Harold Carr

Fields Summary
Constructors Summary
Methods Summary
public voidclose()
Close the Connection.

public AcceptorgetAcceptor()
Get the {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} that created this Connection.

return
{@link com.sun.corba.se.pept.transport.Acceptor Acceptor}

public ConnectionCachegetConnectionCache()

public ContactInfogetContactInfo()
Get the {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} that created this Connection.

return
{@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}

public com.sun.corba.se.pept.transport.EventHandlergetEventHandler()
Get the {@link com.sun.corba.se.pept.transport.EventHandler EventHandler} associated with this Acceptor.

return
{@link com.sun.corba.se.pept.transport.EventHandler EventHandler}

public longgetTimeStamp()
Timestamps are used for connection management, in particular, for reclaiming idle Connections.

return
the "time" the Connection was last used.

public booleanisBusy()
Indicates if the Connection is in the process of sending or receiving a message.

return
true if the Connection is busy.

public booleanisServer()
Indicates whether a {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} or a {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} created the Connection.

return
true if Connection an {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} created the Connection.

public booleanread()
Called to read incoming messages.

return
true if the thread calling read can be released.

public voidregisterWaiter(com.sun.corba.se.pept.protocol.MessageMediator messageMediator)
Register an invocation's {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} with the Connection. This is useful in protocols which support fragmentation.

param
messageMediator

public voidsendWithoutLock(com.sun.corba.se.pept.encoding.OutputObject outputObject)

public voidsetConnectionCache(ConnectionCache connectionCache)

public voidsetState(java.lang.String state)
The "state" of the Connection. param state

public voidsetTimeStamp(long time)
Timestamps are used for connection management, in particular, for reclaiming idle Connections.

param
time - the "time" the Connection was last used.

public booleanshouldRegisterReadEvent()
Used to determine if the Connection should register with the {@link com.sun.corba.se.pept.transport.TransportManager TransportManager} {@link com.sun.corba.se.pept.transport.Selector Selector} to handle read events. For example, an HTTP transport would not register since the requesting thread would just block on read when waiting for the reply.

return
true if it should be registered.

public booleanshouldRegisterServerReadEvent()
Used to determine if the Connection should register with the {@link com.sun.corba.se.pept.transport.TransportManager TransportManager} {@link com.sun.corba.se.pept.transport.Selector Selector} to handle read events. For example, an HTTP transport would not register since the requesting thread would just block on read when waiting for the reply.

return
true if it should be registered.

public voidunregisterWaiter(com.sun.corba.se.pept.protocol.MessageMediator messageMediator)
Unregister an invocation's {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} with the Connection.

param
messageMediator

public com.sun.corba.se.pept.encoding.InputObjectwaitForResponse(com.sun.corba.se.pept.protocol.MessageMediator messageMediator)
If a message expect's a response then this method is called. This method might block on a read (e.g., HTTP), put the calling thread to sleep while another thread read's the response (e.g., GIOP), or it may use the calling thread to perform the server-side work (e.g., Solaris Doors).

param
messageMediator

public voidwriteLock()
Grab a write lock on the Connection. If another thread already has a write lock then the calling thread will block until the lock is released. The calling thread must call {@link #writeUnlock} when it is done.

public voidwriteUnlock()
Release a write lock on the Connection.