use of org.jboss.as.protocol.mgmt.ManagementRequestHandlerFactory in project wildfly-core by wildfly.
the class TransactionalProtocolClientTestCase method startChannelServer.
@Before
public void startChannelServer() throws Exception {
final ChannelServer.Configuration configuration = new ChannelServer.Configuration();
configuration.setEndpointName(ENDPOINT_NAME);
configuration.setUriScheme(URI_SCHEME);
configuration.setBindAddress(new InetSocketAddress("127.0.0.1", PORT));
channelServer = ChannelServer.create(configuration);
//
channelServer.addChannelOpenListener(TEST_CHANNEL, new OpenListener() {
@Override
public void channelOpened(final Channel channel) {
final MockController controller = new MockController();
final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel);
final ManagementChannelHandler channels = new ManagementChannelHandler(strategy, remoteExecutors);
final ManagementRequestHandlerFactory handlerFactory = new TransactionalProtocolOperationHandler(controller, channels, new ResponseAttachmentInputStreamSupport());
channels.addHandlerFactory(handlerFactory);
transferQueue.offer(controller);
channel.addCloseHandler(channels);
channel.receiveMessage(channels.getReceiver());
}
@Override
public void registrationTerminated() {
//
}
});
final ProtocolConnectionConfiguration connectionConfig = ProtocolConnectionConfiguration.create(channelServer.getEndpoint(), new URI("" + URI_SCHEME + "://127.0.0.1:" + PORT + ""));
connectionConfig.setEndpoint(channelServer.getEndpoint());
//
futureConnection = connectionConfig.getEndpoint().getConnection(connectionConfig.getUri());
}
Aggregations