Class EndpointKey<E>
java.lang.Object
org.glassfish.grizzly.connectionpool.Endpoint<E>
org.glassfish.grizzly.connectionpool.EndpointKey<E>
- Type Parameters:
E-
Simple
Endpoint implementation.
The EndpointKey contains the endpoint address, that will be used by
a ConnectorHandler passed to MultiEndpointPool to establish a
new client-side Connection.
Additionally, the EndpointKey contains an internal key object
(getInternalKey()) that is used in the Endpoint.equals(java.lang.Object)
and Endpoint.hashCode() methods.- Author:
- Alexey Stashok
-
Nested Class Summary
Nested classes/interfaces inherited from class org.glassfish.grizzly.connectionpool.Endpoint
Endpoint.Factory -
Constructor Summary
ConstructorsConstructorDescriptionEndpointKey(Object internalKey, E endpointAddress) Construct EndpointKey based on the given internalKey and endpoint.EndpointKey(Object internalKey, E endpointAddress, E localEndpointAddress) Construct EndpointKey based on the given internalKey, endpoint, and local endpoint.EndpointKey(Object internalKey, E endpointAddress, E localEndpointAddress, org.glassfish.grizzly.ConnectorHandler<E> connectorHandler) EndpointKey(Object internalKey, E endpointAddress, org.glassfish.grizzly.ConnectorHandler<E> connectorHandler) Construct EndpointKey based on the given internalKey, endpoint, andConnectorHandler. -
Method Summary
Modifier and TypeMethodDescriptionorg.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection>connect()org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection>connect(org.glassfish.grizzly.CompletionHandler<org.glassfish.grizzly.Connection> completionHandler) org.glassfish.grizzly.ConnectorHandler<E>getId()toString()
-
Constructor Details
-
EndpointKey
Construct EndpointKey based on the given internalKey and endpoint.- Parameters:
internalKey- the internal key to be used inEndpoint.equals(java.lang.Object)andEndpoint.hashCode()methodsendpointAddress- the endpoint address, that will be used by aConnectorHandlerpassed toMultiEndpointPoolto establish new client-sideConnection
-
EndpointKey
Construct EndpointKey based on the given internalKey, endpoint, and local endpoint.- Parameters:
internalKey- the internal key to be used inEndpoint.equals(java.lang.Object)andEndpoint.hashCode()methodsendpointAddress- the endpoint address, that will be used by aConnectorHandlerpassed toMultiEndpointPoolto establish new client-sideConnectionlocalEndpointAddress- the local address that will be used by theConnectorHandlerto bind the local side of the outgoing connection.
-
EndpointKey
public EndpointKey(Object internalKey, E endpointAddress, org.glassfish.grizzly.ConnectorHandler<E> connectorHandler) Construct EndpointKey based on the given internalKey, endpoint, andConnectorHandler.- Parameters:
internalKey- the internal key to be used inEndpoint.equals(java.lang.Object)andEndpoint.hashCode()methodsendpointAddress- the endpoint address, that will be used by aConnectorHandlerpassed toMultiEndpointPoolto establish new client-sideConnectionconnectorHandler- customizedConnectorHandlerfor this endpoint
-
EndpointKey
public EndpointKey(Object internalKey, E endpointAddress, E localEndpointAddress, org.glassfish.grizzly.ConnectorHandler<E> connectorHandler) - Parameters:
internalKey- the internal key to be used inEndpoint.equals(java.lang.Object)andEndpoint.hashCode()methodsendpointAddress- the endpoint address, that will be used by aConnectorHandlerpassed toMultiEndpointPoolto establish new client-sideConnectionlocalEndpointAddress- the local address that will be used by theConnectorHandlerto bind the local side of the outgoing connection.connectorHandler- customizedConnectorHandlerfor this endpoint
-
-
Method Details
-
connect
public org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection> connect() -
getId
-
getInternalKey
- Returns:
- the internal key used in
Endpoint.equals(java.lang.Object)andEndpoint.hashCode()methods
-
getEndpoint
- Returns:
- the endpoint address, used by a
ConnectorHandlerpassed toMultiEndpointPoolto establish new client-sideConnection
-
getLocalEndpoint
- Returns:
- the local endpoint address that be bound to when making the outgoing connection.
-
getConnectorHandler
- Returns:
- a customized
ConnectorHandler, which will be used to createConnections to this endpoint.
-
toString
-
connect
public org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection> connect(org.glassfish.grizzly.CompletionHandler<org.glassfish.grizzly.Connection> completionHandler)
-