Package com.sun.corba.ee.spi.transport
Interface Connection
-
- All Superinterfaces:
Connection
- All Known Implementing Classes:
ConnectionImpl,NoConnectionCacheImpl.NCCConnectionImpl,SocketFactoryConnectionImpl
public interface Connection extends Connection
-
-
Field Summary
Fields Modifier and Type Field Description static intABORTstatic intCLOSE_RECVDstatic intCLOSE_SENTstatic intESTABLISHEDstatic intOPENING
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageMediatorclientReply_1_1_Get()voidclientReply_1_1_Put(MessageMediator x)voidclientReply_1_1_Remove()MessageMediatorclientRequestMapGet(int requestId)voidclose()voidcloseConnectionResources()Clean up all connection resources.AcceptorgetAcceptor()ORBgetBroker()CodeBasegetCodeBase()IORgetCodeBaseIOR()CodeSetComponentInfo.CodeSetContextgetCodeSetContext()ConnectionCachegetConnectionCache()ContactInfogetContactInfo()EventHandlergetEventHandler()java.util.Queue<MessageMediator>getFragmentList(RequestId corbaRequestId)intgetNextRequestId()ResponseWaitingRoomgetResponseWaitingRoom()java.nio.channels.SocketChannelgetSocketChannel()longgetTimeStamp()Timestamps are used for connection management, in particular, for reclaiming idleConnections.booleanhasSocketChannel()booleanisBusy()Indicates if theConnectionis in the process of sending or receiving a message.booleanisClosed()Indicates if theConnectionis closed.booleanisPostInitialContexts()booleanisServer()Indicates whether a CorbaContactInfo or CorbaAcceptor created theConnection.voidpurgeCalls(SystemException systemException, boolean die, boolean lockHeld)booleanread()Called to read incoming messages.voidregisterWaiter(MessageMediator messageMediator)Register an invocation's CorbaMessageMediator with theConnection.voidremoveFragmentList(RequestId corbaRequestId)voidsendCancelRequest(GIOPVersion giopVersion, int requestId)voidsendCancelRequestWithLock(GIOPVersion giopVersion, int requestId)voidsendCloseConnection(GIOPVersion giopVersion)voidsendMessageError(GIOPVersion giopVersion)voidsendWithoutLock(CDROutputObject outputObject)MessageMediatorserverRequest_1_1_Get()voidserverRequest_1_1_Put(MessageMediator x)voidserverRequest_1_1_Remove()MessageMediatorserverRequestMapGet(int requestId)voidserverRequestMapPut(int requestId, MessageMediator messageMediator)voidserverRequestMapRemove(int requestId)voidserverRequestProcessingBegins()voidserverRequestProcessingEnds()voidsetCodeBaseIOR(IOR ior)voidsetCodeSetContext(CodeSetComponentInfo.CodeSetContext csc)voidsetConnectionCache(ConnectionCache connectionCache)voidsetPostInitialContexts()voidsetState(java.lang.String state)The "state" of theConnection.voidsetTimeStamp(long time)Timestamps are used for connection management, in particular, for reclaiming idleConnections.booleanshouldRegisterReadEvent()Used to determine if theConnectionshould register with the CorbaTransportManager Selector to handle read events.booleanshouldRegisterServerReadEvent()Used to determine if theConnectionshould register with the CorbaTransportManager Selector to handle read events.voidunregisterWaiter(MessageMediator messageMediator)Unregister an invocation's * CorbaMessageMediator with theConnection.CDRInputObjectwaitForResponse(MessageMediator messageMediator)If a message expect's a response then this method is called.voidwrite(java.nio.ByteBuffer byteBuffer)voidwriteLock()Grab a write lock on theConnection.voidwriteUnlock()Release a write lock on theConnection.-
Methods inherited from interface com.sun.corba.ee.spi.legacy.connection.Connection
getSocket
-
-
-
-
Field Detail
-
OPENING
static final int OPENING
- See Also:
- Constant Field Values
-
ESTABLISHED
static final int ESTABLISHED
- See Also:
- Constant Field Values
-
CLOSE_SENT
static final int CLOSE_SENT
- See Also:
- Constant Field Values
-
CLOSE_RECVD
static final int CLOSE_RECVD
- See Also:
- Constant Field Values
-
ABORT
static final int ABORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
shouldRegisterReadEvent
boolean shouldRegisterReadEvent()
Used to determine if theConnectionshould register with the CorbaTransportManager 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.- Returns:
trueif it should be registered.
-
shouldRegisterServerReadEvent
boolean shouldRegisterServerReadEvent()
Used to determine if theConnectionshould register with the CorbaTransportManager 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.- Returns:
trueif it should be registered.
-
read
boolean read()
Called to read incoming messages.- Returns:
trueif the thread calling read can be released.
-
close
void close()
-
getAcceptor
Acceptor getAcceptor()
-
getContactInfo
ContactInfo getContactInfo()
-
getEventHandler
EventHandler getEventHandler()
-
isServer
boolean isServer()
Indicates whether a CorbaContactInfo or CorbaAcceptor created theConnection.- Returns:
trueif a CorbaAcceptor created theConnection.
-
isClosed
boolean isClosed()
Indicates if theConnectionis closed.- Returns:
trueif theConnectionis closed.
-
isBusy
boolean isBusy()
Indicates if theConnectionis in the process of sending or receiving a message.- Returns:
trueif theConnectionis busy.
-
getTimeStamp
long getTimeStamp()
Timestamps are used for connection management, in particular, for reclaiming idleConnections.- Returns:
- the "time" the
Connectionwas last used.
-
setTimeStamp
void setTimeStamp(long time)
Timestamps are used for connection management, in particular, for reclaiming idleConnections.- Parameters:
time- - the "time" theConnectionwas last used.
-
setState
void setState(java.lang.String state)
The "state" of theConnection.- Parameters:
state- state to set
-
writeLock
void writeLock()
Grab a write lock on theConnection. If another thread already has a write lock then the calling thread will block until the lock is released. The calling thread must callwriteUnlock()when it is done.
-
writeUnlock
void writeUnlock()
Release a write lock on theConnection.
-
sendWithoutLock
void sendWithoutLock(CDROutputObject outputObject)
-
registerWaiter
void registerWaiter(MessageMediator messageMediator)
Register an invocation's CorbaMessageMediator with theConnection. This is useful in protocols which support fragmentation.- Parameters:
messageMediator- mediator to register
-
waitForResponse
CDRInputObject waitForResponse(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).- Parameters:
messageMediator- mediator to process- Returns:
- stream
-
unregisterWaiter
void unregisterWaiter(MessageMediator messageMediator)
Unregister an invocation's * CorbaMessageMediator with theConnection.- Parameters:
messageMediator- mediator to unregister
-
setConnectionCache
void setConnectionCache(ConnectionCache connectionCache)
-
getConnectionCache
ConnectionCache getConnectionCache()
-
hasSocketChannel
boolean hasSocketChannel()
-
write
void write(java.nio.ByteBuffer byteBuffer) throws java.io.IOException- Throws:
java.io.IOException
-
getNextRequestId
int getNextRequestId()
-
getBroker
ORB getBroker()
-
getCodeSetContext
CodeSetComponentInfo.CodeSetContext getCodeSetContext()
-
setCodeSetContext
void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc)
-
clientRequestMapGet
MessageMediator clientRequestMapGet(int requestId)
-
clientReply_1_1_Put
void clientReply_1_1_Put(MessageMediator x)
-
clientReply_1_1_Get
MessageMediator clientReply_1_1_Get()
-
clientReply_1_1_Remove
void clientReply_1_1_Remove()
-
serverRequest_1_1_Put
void serverRequest_1_1_Put(MessageMediator x)
-
serverRequest_1_1_Get
MessageMediator serverRequest_1_1_Get()
-
serverRequest_1_1_Remove
void serverRequest_1_1_Remove()
-
isPostInitialContexts
boolean isPostInitialContexts()
-
setPostInitialContexts
void setPostInitialContexts()
-
purgeCalls
void purgeCalls(SystemException systemException, boolean die, boolean lockHeld)
-
setCodeBaseIOR
void setCodeBaseIOR(IOR ior)
-
getCodeBaseIOR
IOR getCodeBaseIOR()
-
getCodeBase
CodeBase getCodeBase()
-
sendCloseConnection
void sendCloseConnection(GIOPVersion giopVersion) throws java.io.IOException
- Throws:
java.io.IOException
-
sendMessageError
void sendMessageError(GIOPVersion giopVersion) throws java.io.IOException
- Throws:
java.io.IOException
-
sendCancelRequest
void sendCancelRequest(GIOPVersion giopVersion, int requestId) throws java.io.IOException
- Throws:
java.io.IOException
-
sendCancelRequestWithLock
void sendCancelRequestWithLock(GIOPVersion giopVersion, int requestId) throws java.io.IOException
- Throws:
java.io.IOException
-
getResponseWaitingRoom
ResponseWaitingRoom getResponseWaitingRoom()
-
serverRequestMapPut
void serverRequestMapPut(int requestId, MessageMediator messageMediator)
-
serverRequestMapGet
MessageMediator serverRequestMapGet(int requestId)
-
serverRequestMapRemove
void serverRequestMapRemove(int requestId)
-
getFragmentList
java.util.Queue<MessageMediator> getFragmentList(RequestId corbaRequestId)
-
removeFragmentList
void removeFragmentList(RequestId corbaRequestId)
-
getSocketChannel
java.nio.channels.SocketChannel getSocketChannel()
-
serverRequestProcessingBegins
void serverRequestProcessingBegins()
-
serverRequestProcessingEnds
void serverRequestProcessingEnds()
-
closeConnectionResources
void closeConnectionResources()
Clean up all connection resources. Used when shutting down an ORB.
-
-