Class EndpointKey<E>

java.lang.Object
org.glassfish.grizzly.connectionpool.Endpoint<E>
org.glassfish.grizzly.connectionpool.EndpointKey<E>
Type Parameters:
E -

public class EndpointKey<E> extends Endpoint<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

    Constructors
    Constructor
    Description
    EndpointKey(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, and ConnectorHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection>
     
    org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection>
    connect(org.glassfish.grizzly.CompletionHandler<org.glassfish.grizzly.Connection> completionHandler)
     
    org.glassfish.grizzly.ConnectorHandler<E>
     
     
     
     
     
     

    Methods inherited from class org.glassfish.grizzly.connectionpool.Endpoint

    equals, hashCode, onConnect

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EndpointKey

      public EndpointKey(Object internalKey, E endpointAddress)
      Construct EndpointKey based on the given internalKey and endpoint.
      Parameters:
      internalKey - the internal key to be used in Endpoint.equals(java.lang.Object) and Endpoint.hashCode() methods
      endpointAddress - the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side Connection
    • EndpointKey

      public EndpointKey(Object internalKey, E endpointAddress, E localEndpointAddress)
      Construct EndpointKey based on the given internalKey, endpoint, and local endpoint.
      Parameters:
      internalKey - the internal key to be used in Endpoint.equals(java.lang.Object) and Endpoint.hashCode() methods
      endpointAddress - the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side Connection
      localEndpointAddress - the local address that will be used by the ConnectorHandler to 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, and ConnectorHandler.
      Parameters:
      internalKey - the internal key to be used in Endpoint.equals(java.lang.Object) and Endpoint.hashCode() methods
      endpointAddress - the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side Connection
      connectorHandler - customized ConnectorHandler for 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 in Endpoint.equals(java.lang.Object) and Endpoint.hashCode() methods
      endpointAddress - the endpoint address, that will be used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side Connection
      localEndpointAddress - the local address that will be used by the ConnectorHandler to bind the local side of the outgoing connection.
      connectorHandler - customized ConnectorHandler for this endpoint
  • Method Details

    • connect

      public org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection> connect()
      Specified by:
      connect in class Endpoint<E>
    • getId

      public Object getId()
      Specified by:
      getId in class Endpoint<E>
    • getInternalKey

      public Object getInternalKey()
      Returns:
      the internal key used in Endpoint.equals(java.lang.Object) and Endpoint.hashCode() methods
    • getEndpoint

      public E getEndpoint()
      Returns:
      the endpoint address, used by a ConnectorHandler passed to MultiEndpointPool to establish new client-side Connection
    • getLocalEndpoint

      public E getLocalEndpoint()
      Returns:
      the local endpoint address that be bound to when making the outgoing connection.
    • getConnectorHandler

      public org.glassfish.grizzly.ConnectorHandler<E> getConnectorHandler()
      Returns:
      a customized ConnectorHandler, which will be used to create Connections to this endpoint.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • connect

      public org.glassfish.grizzly.GrizzlyFuture<org.glassfish.grizzly.Connection> connect(org.glassfish.grizzly.CompletionHandler<org.glassfish.grizzly.Connection> completionHandler)
      Specified by:
      connect in class Endpoint<E>