final Connection connection = IoFutureHelper.get(futureConnection, 5000, TimeUnit.MILLISECONDS);
// create a remoting EJB receiver for this connection
final EJBReceiver receiver = new RemotingConnectionEJBReceiver(connection);
// associate it with the client context
EJBClientContext context = EJBClientContext.create();
context.registerEJBReceiver(receiver);
return EJBClientContext.setSelector(new ClosableContextSelector(context, endpoint, connection, receiver));
}
private class ClosableContextSelector implements ContextSelector<EJBClientContext>, Closeable {
private EJBClientContext context;