当前位置: 首页>>代码示例>>Java>>正文


Java Channel.receiveMessage方法代码示例

本文整理汇总了Java中org.jboss.remoting3.Channel.receiveMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Channel.receiveMessage方法的具体用法?Java Channel.receiveMessage怎么用?Java Channel.receiveMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.remoting3.Channel的用法示例。


在下文中一共展示了Channel.receiveMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connectionOpened

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public void connectionOpened(final Connection connection) throws IOException {
    final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap());
    if(setChannel(channel)) {
        channel.receiveMessage(channelHandler.getReceiver());
        channel.addCloseHandler(channelHandler);
        try {
            if (runningMode == RunningMode.ADMIN_ONLY) {
                // Fetch the domain configuration
                channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get();
            } else {
                // Start the registration process
                channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get();
            }
        } catch (Exception e) {
            if(e.getCause() instanceof IOException) {
                throw (IOException) e.getCause();
            }
            throw new IOException(e);
        }
        // Registered
        registered();
    } else {
        channel.closeAsync();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:RemoteDomainConnection.java

示例2: createReceiving

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
/**
 * Create a model controller client which is exclusively receiving messages on an existing channel.
 *
 * @param channel the channel
 * @param executorService an executor
 * @return the created client
 */
public static ModelControllerClient createReceiving(final Channel channel, final ExecutorService executorService) {
    final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel);
    final ManagementChannelHandler handler = new ManagementChannelHandler(strategy, executorService);
    final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient(handler);
    handler.addHandlerFactory(client);
    channel.addCloseHandler(new CloseHandler<Channel>() {
        @Override
        public void handleClose(Channel closed, IOException exception) {
            handler.shutdown();
            try {
                handler.awaitCompletion(1, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            } finally {
                handler.shutdownNow();
            }
        }
    });
    channel.receiveMessage(handler.getReceiver());
    return client;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:29,代码来源:ExistingChannelModelControllerClient.java

示例3: connectionOpened

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public void connectionOpened(final Connection connection) throws IOException {
    final Channel channel = openChannel(connection, serviceType, channelOptions);
    if(setChannel(channel)) {
        channel.receiveMessage(receiver);
    } else {
        channel.closeAsync();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:10,代码来源:ManagementClientChannelStrategy.java

示例4: create

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
public static SimpleClient create(final Channel channel, final ExecutorService executorService) {
    final SimpleClient client = new SimpleClient(channel, executorService);
    channel.addCloseHandler(new CloseHandler<Channel>() {
        @Override
        public void handleClose(Channel closed, IOException exception) {
            client.shutdownNow();
        }
    });
    channel.receiveMessage(ManagementChannelReceiver.createDelegating(client));
    return client;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:SimpleHandlers.java

示例5: connectionOpened

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public void connectionOpened(final Connection connection) throws IOException {
    final Channel channel = openChannel(connection, "management", OptionMap.EMPTY);
    if(setChannel(channel)) {
        channel.receiveMessage(channelHandler.getReceiver());
        channel.addCloseHandler(channelHandler);
    } else {
        channel.closeAsync();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:TestControllerClient.java

示例6: startReceiving

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public ManagementChannelHandler startReceiving(final Channel channel) {
    final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor());
    handler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir);
    // Assemble the request handlers for the domain channel
    handler.addHandlerFactory(new HostControllerRegistrationHandler(handler, domainController, operationExecutor,
            getExecutor(), slaveHostRegistrations, domainHostExcludeRegistry));
    handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, getResponseAttachmentSupport(), getClientRequestExecutor()));
    handler.addHandlerFactory(new MasterDomainControllerOperationHandlerImpl(domainController, getExecutor()));
    handler.addHandlerFactory(pongRequestHandler);
    handler.addHandlerFactory(new DomainTransactionalProtocolOperationHandler(txOperationExecutor, handler, getResponseAttachmentSupport()));
    channel.receiveMessage(handler.getReceiver());
    return handler;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:MasterDomainControllerOperationHandlerService.java

示例7: startReceiving

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public ManagementChannelHandler startReceiving(final Channel channel) {
    final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel);
    final ManagementChannelHandler channelHandler = new ManagementChannelHandler(strategy, executorService);
    channelHandler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir);
    final ServerToHostProtocolHandler registrationHandler = new ServerToHostProtocolHandler(serverInventory.getValue(), operationExecutor, domainController, channelHandler, registrations, expressionResolver);
    channelHandler.addHandlerFactory(new ManagementPongRequestHandler());
    channelHandler.addHandlerFactory(registrationHandler);
    channel.receiveMessage(channelHandler.getReceiver());
    return channelHandler;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:ServerToHostOperationHandlerFactoryService.java

示例8: startReceiving

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public ManagementChannelHandler startReceiving(Channel channel) {
    final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel),
            getExecutor());

    handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler,
            getResponseAttachmentSupport(), getClientRequestExecutor(), channel.getConnection().getLocalIdentity()));

    channel.receiveMessage(handler.getReceiver());
    return handler;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:ModelControllerClientOperationHandlerFactoryService.java

示例9: createClient

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
/**
 * Create the protocol client to talk to the remote controller.
 *
 * @param channel the remoting channel
 * @return the client
 * @throws Exception
 */
TransactionalProtocolClient createClient(final Channel channel) {
    channels.add(channel);
    final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel);
    final ManagementChannelHandler channelAssociation = new ManagementChannelHandler(strategy, clientExecutor);
    final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation);
    channel.addCloseHandler(channelAssociation);
    channel.receiveMessage(channelAssociation.getReceiver());
    return client;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:TransactionalProtocolClientTestCase.java

示例10: connectionOpened

import org.jboss.remoting3.Channel; //导入方法依赖的package包/类
@Override
public void connectionOpened(final Connection connection) throws IOException {
    final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap());
    if(setChannel(channel)) {
        channel.receiveMessage(channelHandler.getReceiver());
        channel.addCloseHandler(channelHandler);
    } else {
        channel.closeAsync();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:HostControllerConnection.java


注:本文中的org.jboss.remoting3.Channel.receiveMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。