Interface Connection
- All Superinterfaces:
Connection
- All Known Implementing Classes:
ConnectionImpl, NoConnectionCacheImpl.NCCConnectionImpl, SocketFactoryConnectionImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclientRequestMapGet(int requestId) voidclose()voidClean up all connection resources.getFragmentList(RequestId corbaRequestId) intlongTimestamps are used for connection management, in particular, for reclaiming idleConnections.booleanbooleanisBusy()Indicates if theConnectionis in the process of sending or receiving a message.booleanisClosed()Indicates if theConnectionis closed.booleanbooleanisServer()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) voidvoidserverRequestMapGet(int requestId) voidserverRequestMapPut(int requestId, MessageMediator messageMediator) voidserverRequestMapRemove(int requestId) voidvoidvoidsetCodeBaseIOR(IOR ior) voidvoidsetConnectionCache(ConnectionCache connectionCache) voidvoidThe "state" of theConnection.voidsetTimeStamp(long time) Timestamps are used for connection management, in particular, for reclaiming idleConnections.booleanUsed to determine if theConnectionshould register with the CorbaTransportManager Selector to handle read events.booleanUsed to determine if theConnectionshould register with the CorbaTransportManager Selector to handle read events.voidunregisterWaiter(MessageMediator messageMediator) Unregister an invocation's * CorbaMessageMediator with theConnection.waitForResponse(MessageMediator messageMediator) If a message expect's a response then this method is called.voidwrite(ByteBuffer byteBuffer) voidGrab a write lock on theConnection.voidRelease a write lock on theConnection.Methods inherited from interface Connection
getSocket
-
Field Details
-
OPENING
static final int OPENING- See Also:
-
ESTABLISHED
static final int ESTABLISHED- See Also:
-
CLOSE_SENT
static final int CLOSE_SENT- See Also:
-
CLOSE_RECVD
static final int CLOSE_RECVD- See Also:
-
ABORT
static final int ABORT- See Also:
-
-
Method Details
-
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
-
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
-
registerWaiter
Register an invocation's CorbaMessageMediator with theConnection. This is useful in protocols which support fragmentation.- Parameters:
messageMediator- mediator to register
-
waitForResponse
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
Unregister an invocation's * CorbaMessageMediator with theConnection.- Parameters:
messageMediator- mediator to unregister
-
setConnectionCache
-
getConnectionCache
ConnectionCache getConnectionCache() -
hasSocketChannel
boolean hasSocketChannel() -
write
- Throws:
IOException
-
getNextRequestId
int getNextRequestId() -
getBroker
ORB getBroker() -
getCodeSetContext
CodeSetComponentInfo.CodeSetContext getCodeSetContext() -
setCodeSetContext
-
clientRequestMapGet
-
clientReply_1_1_Put
-
clientReply_1_1_Get
MessageMediator clientReply_1_1_Get() -
clientReply_1_1_Remove
void clientReply_1_1_Remove() -
serverRequest_1_1_Put
-
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
-
setCodeBaseIOR
-
getCodeBaseIOR
IOR getCodeBaseIOR() -
getCodeBase
CodeBase getCodeBase() -
sendCloseConnection
- Throws:
IOException
-
sendMessageError
- Throws:
IOException
-
sendCancelRequest
- Throws:
IOException
-
sendCancelRequestWithLock
- Throws:
IOException
-
getResponseWaitingRoom
ResponseWaitingRoom getResponseWaitingRoom() -
serverRequestMapPut
-
serverRequestMapGet
-
serverRequestMapRemove
void serverRequestMapRemove(int requestId) -
getFragmentList
-
removeFragmentList
-
getSocketChannel
SocketChannel getSocketChannel() -
serverRequestProcessingBegins
void serverRequestProcessingBegins() -
serverRequestProcessingEnds
void serverRequestProcessingEnds() -
closeConnectionResources
void closeConnectionResources()Clean up all connection resources. Used when shutting down an ORB.
-