Top Description Fields Constructors Methods
org.glassfish.grizzly.connectionpool

public Class EndpointKey<E>

extends Endpoint<E>
Class Inheritance
Imports
org.glassfish.grizzly.Connection, .ConnectorHandler, .GrizzlyFuture

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 org.glassfish.grizzly.Connection. Additionally, the EndpointKey contains an internal key object (getInternalKey()) that is used in the equals(java.lang.Object) and hashCode() methods.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private final ConnectorHandler<E>
private final Object
private final E
private final E

Constructor Summary

AccessConstructor and Description
public
EndpointKey(final Object
the internal key to be used in equals(java.lang.Object) and hashCode() methods
internalKey
,
final E
the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection
endpointAddress
)

Construct EndpointKey based on the given internalKey and endpoint.

public
EndpointKey(final Object
the internal key to be used in equals(java.lang.Object) and hashCode() methods
internalKey
,
final E
the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection
endpointAddress
,
final E
the local address that will be used by the ConnectorHandler to bind the local side of the outgoing connection.
localEndpointAddress
)

Construct EndpointKey based on the given internalKey, endpoint, and local endpoint.

public
EndpointKey(final Object
the internal key to be used in equals(java.lang.Object) and hashCode() methods
internalKey
,
final E
the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection
endpointAddress
,
final ConnectorHandler<E>
customized ConnectorHandler for this endpoint
connectorHandler
)

Construct EndpointKey based on the given internalKey, endpoint, and ConnectorHandler.

public
EndpointKey(final Object
the internal key to be used in equals(java.lang.Object) and hashCode() methods
internalKey
,
final E
the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection
endpointAddress
,
final E
the local address that will be used by the ConnectorHandler to bind the local side of the outgoing connection.
localEndpointAddress
,
final ConnectorHandler<E>
customized ConnectorHandler for this endpoint
connectorHandler
)

Method Summary

Modifier and TypeMethod and Description
public GrizzlyFuture<Connection<L>>
public ConnectorHandler<E>
getConnectorHandler()

Returns: a customized ConnectorHandler, which will be used to create org.glassfish.grizzly.Connections to this endpoint.

public E
getEndpoint()

Returns: the endpoint address, used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

public Object
public Object
getInternalKey()

Returns: the internal key used in equals(java.lang.Object) and hashCode() methods

public E
getLocalEndpoint()

Returns: the local endpoint address that be bound to when making the outgoing connection.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.glassfish.grizzly.connectionpool.Endpoint:
equalshashCodeonConnect

Field Detail

connectorHandlerback to summary
private final ConnectorHandler<E> connectorHandler
internalKeyback to summary
private final Object internalKey
localEndpointAddressback to summary
private final E localEndpointAddress
targetEndpointAddressback to summary
private final E targetEndpointAddress

Constructor Detail

EndpointKeyback to summary
public EndpointKey(final Object internalKey, final E endpointAddress)

Construct EndpointKey based on the given internalKey and endpoint.

Parameters
internalKey:Object

the internal key to be used in equals(java.lang.Object) and hashCode() methods

endpointAddress:E

the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

EndpointKeyback to summary
public EndpointKey(final Object internalKey, final E endpointAddress, final E localEndpointAddress)

Construct EndpointKey based on the given internalKey, endpoint, and local endpoint.

Parameters
internalKey:Object

the internal key to be used in equals(java.lang.Object) and hashCode() methods

endpointAddress:E

the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

localEndpointAddress:E

the local address that will be used by the ConnectorHandler to bind the local side of the outgoing connection.

EndpointKeyback to summary
public EndpointKey(final Object internalKey, final E endpointAddress, final ConnectorHandler<E> connectorHandler)

Construct EndpointKey based on the given internalKey, endpoint, and ConnectorHandler.

Parameters
internalKey:Object

the internal key to be used in equals(java.lang.Object) and hashCode() methods

endpointAddress:E

the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

connectorHandler:ConnectorHandler<E>

customized ConnectorHandler for this endpoint

EndpointKeyback to summary
public EndpointKey(final Object internalKey, final E endpointAddress, final E localEndpointAddress, final ConnectorHandler<E> connectorHandler)
Parameters
internalKey:Object

the internal key to be used in equals(java.lang.Object) and hashCode() methods

endpointAddress:E

the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

localEndpointAddress:E

the local address that will be used by the ConnectorHandler to bind the local side of the outgoing connection.

connectorHandler:ConnectorHandler<E>

customized ConnectorHandler for this endpoint

Method Detail

connectback to summary
public GrizzlyFuture<Connection<L>> connect()

Implements abstract org.glassfish.grizzly.connectionpool.Endpoint.connect.

Annotations
@Override
@SuppressWarnings:unchecked
getConnectorHandlerback to summary
public ConnectorHandler<E> getConnectorHandler()
Returns:ConnectorHandler<E>

a customized ConnectorHandler, which will be used to create org.glassfish.grizzly.Connections to this endpoint.

getEndpointback to summary
public E getEndpoint()
Returns:E

the endpoint address, used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side org.glassfish.grizzly.Connection

getIdback to summary
public Object getId()

Implements abstract org.glassfish.grizzly.connectionpool.Endpoint.getId.

Annotations
@Override
getInternalKeyback to summary
public Object getInternalKey()
Returns:Object

the internal key used in equals(java.lang.Object) and hashCode() methods

getLocalEndpointback to summary
public E getLocalEndpoint()
Returns:E

the local endpoint address that be bound to when making the outgoing connection.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override