Class ClientServiceHandle<T>


  • public final class ClientServiceHandle<T>
    extends Object
    A handle for helping service protocol providers to create and maintain a single channel per connection.
    Author:
    David M. Lloyd
    • Constructor Detail

      • ClientServiceHandle

        public ClientServiceHandle​(String serviceName,
                                   Function<Channel,​org.xnio.IoFuture<T>> constructor)
        Construct a new instance. Only one instance should be constructed per service; instances may be safely cached in static fields.
        Parameters:
        serviceName - the service name (may not be null)
        constructor - the service future construction operation
    • Method Detail

      • getClientService

        public org.xnio.IoFuture<T> getClientService​(Connection connection,
                                                     org.xnio.OptionMap optionMap)
        Get or establish the future client service for the given connection.
        Parameters:
        connection - the connection
        optionMap - the service options
        Returns:
        the future service instance
      • closeChannel

        public void closeChannel()
                          throws IOException
        Close the channel associated with this handle
        Throws:
        IOException