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 int
ABORT
static int
CLOSE_RECVD
static int
CLOSE_SENT
static int
ESTABLISHED
static int
OPENING
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageMediator
clientReply_1_1_Get()
void
clientReply_1_1_Put(MessageMediator x)
void
clientReply_1_1_Remove()
MessageMediator
clientRequestMapGet(int requestId)
void
close()
void
closeConnectionResources()
Clean up all connection resources.Acceptor
getAcceptor()
ORB
getBroker()
CodeBase
getCodeBase()
IOR
getCodeBaseIOR()
CodeSetComponentInfo.CodeSetContext
getCodeSetContext()
ConnectionCache
getConnectionCache()
ContactInfo
getContactInfo()
EventHandler
getEventHandler()
java.util.Queue<MessageMediator>
getFragmentList(RequestId corbaRequestId)
int
getNextRequestId()
ResponseWaitingRoom
getResponseWaitingRoom()
java.nio.channels.SocketChannel
getSocketChannel()
long
getTimeStamp()
Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.boolean
hasSocketChannel()
boolean
isBusy()
Indicates if theConnection
is in the process of sending or receiving a message.boolean
isClosed()
Indicates if theConnection
is closed.boolean
isPostInitialContexts()
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)
MessageMediator
serverRequest_1_1_Get()
void
serverRequest_1_1_Put(MessageMediator x)
void
serverRequest_1_1_Remove()
MessageMediator
serverRequestMapGet(int requestId)
void
serverRequestMapPut(int requestId, MessageMediator messageMediator)
void
serverRequestMapRemove(int requestId)
void
serverRequestProcessingBegins()
void
serverRequestProcessingEnds()
void
setCodeBaseIOR(IOR ior)
void
setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc)
void
setConnectionCache(ConnectionCache connectionCache)
void
setPostInitialContexts()
void
setState(java.lang.String state)
The "state" of theConnection
.void
setTimeStamp(long time)
Timestamps are used for connection management, in particular, for reclaiming idleConnection
s.boolean
shouldRegisterReadEvent()
Used to determine if theConnection
should register with the CorbaTransportManager Selector to handle read events.boolean
shouldRegisterServerReadEvent()
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
.CDRInputObject
waitForResponse(MessageMediator messageMediator)
If a message expect's a response then this method is called.void
write(java.nio.ByteBuffer byteBuffer)
void
writeLock()
Grab a write lock on theConnection
.void
writeUnlock()
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 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
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.
-
-