Package org.jboss.remoting3
Class ClientServiceHandle<T>
- java.lang.Object
-
- org.jboss.remoting3.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 Summary
Constructors Constructor Description ClientServiceHandle(String serviceName, Function<Channel,org.xnio.IoFuture<T>> constructor)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeChannel()
Close the channel associated with this handleorg.xnio.IoFuture<T>
getClientService(Connection connection, org.xnio.OptionMap optionMap)
Get or establish the future client service for the given connection.
-
-
-
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 instatic
fields.- Parameters:
serviceName
- the service name (may not benull
)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 connectionoptionMap
- the service options- Returns:
- the future service instance
-
closeChannel
public void closeChannel() throws IOException
Close the channel associated with this handle- Throws:
IOException
-
-