public interface Connection
Connection represents a transport in the PEPt architecture.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the
Connection. |
Acceptor |
getAcceptor()
Get the
Acceptor that created this Connection. |
ConnectionCache |
getConnectionCache() |
ContactInfo |
getContactInfo()
Get the
ContactInfo that created this Connection
. |
EventHandler |
getEventHandler()
Get the
EventHandler associated with this
Acceptor. |
long |
getTimeStamp()
Timestamps are used for connection management, in particular, for reclaiming idle
Connections. |
boolean |
isBusy()
Indicates if the
Connection is in the process of sending or receiving a message. |
boolean |
isServer()
|
boolean |
read()
Called to read incoming messages.
|
void |
registerWaiter(MessageMediator messageMediator)
Register an invocation's
MessageMediator with the
Connection. |
void |
sendWithoutLock(OutputObject outputObject) |
void |
setConnectionCache(ConnectionCache connectionCache) |
void |
setState(String state)
The "state" of the
Connection. |
void |
setTimeStamp(long time)
Timestamps are used for connection management, in particular, for reclaiming idle
Connections. |
boolean |
shouldRegisterReadEvent()
Used to determine if the
Connection should register with the
TransportManager
Selector to handle read events. |
boolean |
shouldRegisterServerReadEvent()
Used to determine if the
Connection should register with the
TransportManager
Selector to handle read events. |
void |
unregisterWaiter(MessageMediator messageMediator)
Unregister an invocation's
MessageMediator with the
Connection. |
InputObject |
waitForResponse(MessageMediator messageMediator)
If a message expect's a response then this method is called.
|
void |
writeLock()
Grab a write lock on the
Connection. |
void |
writeUnlock()
Release a write lock on the
Connection. |
boolean shouldRegisterReadEvent()
Connection should register with the
TransportManager
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.true if it should be registered.boolean shouldRegisterServerReadEvent()
Connection should register with the
TransportManager
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.true if it should be registered.boolean read()
true if the thread calling read can be released.void close()
Connection.ContactInfo getContactInfo()
ContactInfo that created this Connection
.ContactInfoEventHandler getEventHandler()
EventHandler associated with this
Acceptor.EventHandlerboolean isServer()
true if Connection an Acceptor
created the Connection.boolean isBusy()
Connection is in the process of sending or receiving a message.true if the Connection is busy.long getTimeStamp()
Connections.Connection was last used.void setTimeStamp(long time)
Connections.time - - the "time" the Connection was last used.void setState(String state)
Connection.
param statevoid writeLock()
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 writeUnlock() when it is done.void writeUnlock()
Connection.void sendWithoutLock(OutputObject outputObject)
void registerWaiter(MessageMediator messageMediator)
MessageMediator with the
Connection.
This is useful in protocols which support fragmentation.messageMediator - InputObject waitForResponse(MessageMediator messageMediator)
messageMediator - void unregisterWaiter(MessageMediator messageMediator)
MessageMediator with the
Connection.messageMediator - void setConnectionCache(ConnectionCache connectionCache)
ConnectionCache getConnectionCache()
Copyright © 2023 JBoss by Red Hat. All rights reserved.