class ConnectionImpl extends AbstractHandleableCloseable<Connection> implements Connection
HandleableCloseable.Key| Modifier and Type | Field and Description |
|---|---|
private Attachments |
attachments |
private ConnectionHandler |
connectionHandler |
private Endpoint |
endpoint |
| Constructor and Description |
|---|
ConnectionImpl(EndpointImpl endpoint,
ConnectionHandlerFactory connectionHandlerFactory,
ConnectionProviderContext connectionProviderContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeAction()
Called exactly once when the
close() method is invoked; the actual close operation should take place here. |
Attachments |
getAttachments()
Get the attachments for this entity.
|
(package private) ConnectionHandler |
getConnectionHandler() |
Endpoint |
getEndpoint()
Get the local endpoint.
|
java.util.Collection<java.security.Principal> |
getPrincipals()
Get the authenticated principals for this connection.
|
java.lang.String |
getRemoteEndpointName()
Get the name of the remote endpoint, if it has one.
|
javax.net.ssl.SSLSession |
getSslSession()
Get the underlying
SSLSession for this connection if one is established. |
UserInfo |
getUserInfo()
Get the UserInfo for this connection.
|
org.xnio.IoFuture<Channel> |
openChannel(java.lang.String serviceType,
org.xnio.OptionMap optionMap)
Open a channel to a remote service on this connection.
|
java.lang.String |
toString() |
addCloseHandler, awaitClosed, awaitClosedUninterruptibly, checkOpen, close, closeAsync, closeComplete, closeFailed, finalize, getExecutor, isOpenclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCloseHandler, awaitClosed, awaitClosedUninterruptibly, close, closeAsyncprivate final Attachments attachments
private final ConnectionHandler connectionHandler
private final Endpoint endpoint
ConnectionImpl(EndpointImpl endpoint, ConnectionHandlerFactory connectionHandlerFactory, ConnectionProviderContext connectionProviderContext)
protected void closeAction()
throws java.io.IOException
AbstractHandleableCloseableclose() method is invoked; the actual close operation should take place here.
This method must call AbstractHandleableCloseable.closeComplete(), directly or indirectly, for the close operation to finish
(it may happen in another thread but it must happen).
This method should not expect the AbstractHandleableCloseable.closeComplete() call to be made from another thread from the same thread pool
that may cause AbstractHandleableCloseable.close(). As close will block, this can result in situations where all threads in the pool are
blocked on AbstractHandleableCloseable.close() method calls, which means the AbstractHandleableCloseable.closeComplete() will never be run.closeAction in class AbstractHandleableCloseable<Connection>RemotingException - if the close failedjava.io.IOExceptionConnectionHandler getConnectionHandler()
public java.util.Collection<java.security.Principal> getPrincipals()
ConnectiongetPrincipals in interface Connectionpublic UserInfo getUserInfo()
ConnectiongetUserInfo in interface Connectionpublic javax.net.ssl.SSLSession getSslSession()
ConnectionSSLSession for this connection if one is established.getSslSession in interface ConnectionSSLSession for the connection if one is established, otherwise returns null.public org.xnio.IoFuture<Channel> openChannel(java.lang.String serviceType, org.xnio.OptionMap optionMap)
ConnectionopenChannel in interface ConnectionserviceType - the service typeoptionMap - the option mappublic java.lang.String getRemoteEndpointName()
ConnectiongetRemoteEndpointName in interface Connectionnull if it is anonymouspublic Endpoint getEndpoint()
ConnectiongetEndpoint in interface Connectionpublic Attachments getAttachments()
AttachablegetAttachments in interface Attachablepublic java.lang.String toString()
toString in class java.lang.Object