Package com.sun.corba.ee.spi.transport
Interface Connection
- All Superinterfaces:
Connection
- All Known Implementing Classes:
ConnectionImpl
,NoConnectionCacheImpl.NCCConnectionImpl
,SocketFactoryConnectionImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clientRequestMapGet
(int requestId) void
close()
void
Clean up all connection resources.getFragmentList
(RequestId corbaRequestId) int
long
Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.boolean
boolean
isBusy()
Indicates if theConnection
is in the process of sending or receiving a message.boolean
isClosed()
Indicates if theConnection
is closed.boolean
boolean
isServer()
Indicates whether a CorbaContactInfo or CorbaAcceptor created theConnection
.void
purgeCalls
(SystemException systemException, boolean die, boolean lockHeld) boolean
read()
Called to read incoming messages.void
registerWaiter
(MessageMediator messageMediator) Register an invocation's CorbaMessageMediator with theConnection
.void
removeFragmentList
(RequestId corbaRequestId) void
sendCancelRequest
(GIOPVersion giopVersion, int requestId) void
sendCancelRequestWithLock
(GIOPVersion giopVersion, int requestId) void
sendCloseConnection
(GIOPVersion giopVersion) void
sendMessageError
(GIOPVersion giopVersion) void
sendWithoutLock
(CDROutputObject outputObject) void
void
serverRequestMapGet
(int requestId) void
serverRequestMapPut
(int requestId, MessageMediator messageMediator) void
serverRequestMapRemove
(int requestId) void
void
void
setCodeBaseIOR
(IOR ior) void
void
setConnectionCache
(ConnectionCache connectionCache) void
void
The "state" of theConnection
.void
setTimeStamp
(long time) Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.boolean
Used to determine if theConnection
should register with the CorbaTransportManager Selector to handle read events.boolean
Used to determine if theConnection
should register with the CorbaTransportManager Selector to handle read events.void
unregisterWaiter
(MessageMediator messageMediator) Unregister an invocation's * CorbaMessageMediator with theConnection
.waitForResponse
(MessageMediator messageMediator) If a message expect's a response then this method is called.void
write
(ByteBuffer byteBuffer) void
Grab a write lock on theConnection
.void
Release a write lock on theConnection
.Methods inherited from interface com.sun.corba.ee.spi.legacy.connection.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 theConnection
should 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:
true
if it should be registered.
-
shouldRegisterServerReadEvent
boolean shouldRegisterServerReadEvent()Used to determine if theConnection
should 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:
true
if it should be registered.
-
read
boolean read()Called to read incoming messages.- Returns:
true
if 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:
true
if a CorbaAcceptor created theConnection
.
-
isClosed
boolean isClosed()Indicates if theConnection
is closed.- Returns:
true
if theConnection
is closed.
-
isBusy
boolean isBusy()Indicates if theConnection
is in the process of sending or receiving a message.- Returns:
true
if theConnection
is busy.
-
getTimeStamp
long getTimeStamp()Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.- Returns:
- the "time" the
Connection
was last used.
-
setTimeStamp
void setTimeStamp(long time) Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.- Parameters:
time
- - the "time" theConnection
was last used.
-
setState
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
-
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.
-