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


Java OpenListener类代码示例

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


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

示例1: addChannelOpenListener

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
public Registration addChannelOpenListener(final String channelName, final OpenListener openListener) throws ServiceRegistrationException {
    return endpoint.registerService(channelName, new OpenListener() {
        public void channelOpened(final Channel channel) {
            if (openListener != null) {
                openListener.channelOpened(channel);
            }
        }

        public void registrationTerminated() {
            if (openListener != null) {
                openListener.registrationTerminated();
            }
        }
    }, OptionMap.EMPTY);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:ChannelServer.java

示例2: addChannelOpenListener

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
public void addChannelOpenListener(final String channelName, final OpenListener openListener) throws ServiceRegistrationException {
    registration = endpoint.registerService(channelName, new OpenListener() {
        public void channelOpened(final Channel channel) {
            if (openListener != null) {
                openListener.channelOpened(channel);
            }
        }

        public void registrationTerminated() {
            if (openListener != null) {
                openListener.registrationTerminated();
            }
        }
    }, OptionMap.EMPTY);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:ChannelServer.java

示例3: setupRemoting

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
public void setupRemoting(final ManagementChannelInitialization initialization) throws IOException {
    //executorService = Executors.newCachedThreadPool();
    final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("Remoting"), Boolean.FALSE, null, "Remoting %f thread %t", null, null);
    executorService = new QueueExecutor(EXECUTOR_MAX_THREADS / 4 + 1, EXECUTOR_MAX_THREADS, EXECUTOR_KEEP_ALIVE_TIME, TimeUnit.MILLISECONDS, 500, threadFactory, true, null);

    final ChannelServer.Configuration configuration = new ChannelServer.Configuration();
    configuration.setEndpointName(ENDPOINT_NAME);
    configuration.setUriScheme(URI_SCHEME);
    configuration.setBindAddress(new InetSocketAddress("127.0.0.1", PORT));
    configuration.setExecutor(executorService);
    channelServer = ChannelServer.create(configuration);

    channelServer.addChannelOpenListener(TEST_CHANNEL, new OpenListener() {

        @Override
        public void registrationTerminated() {
        }

        @Override
        public void channelOpened(Channel channel) {
            serverChannel = channel;
            initialization.startReceiving(channel);
            clientConnectedLatch.countDown();
        }
    });
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:RemoteChannelPairSetup.java

示例4: setupRemoting

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
public void setupRemoting(final ManagementMessageHandler handler) throws IOException {
    //executorService = new ThreadPoolExecutor(16, 16, 1L, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>());
    ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("Remoting"), Boolean.FALSE, null, "Remoting %f thread %t", null, null);
    executorService = new QueueExecutor(EXECUTOR_MAX_THREADS / 4 + 1, EXECUTOR_MAX_THREADS, EXECUTOR_KEEP_ALIVE_TIME, TimeUnit.MILLISECONDS, 500, threadFactory, true, null);

    ChannelServer.Configuration configuration = new ChannelServer.Configuration();
    configuration.setEndpointName(ENDPOINT_NAME);
    configuration.setUriScheme(URI_SCHEME);
    configuration.setBindAddress(new InetSocketAddress("127.0.0.1", PORT));
    configuration.setExecutor(executorService);
    channelServer = ChannelServer.create(configuration);

    final Channel.Receiver receiver = ManagementChannelReceiver.createDelegating(handler);

    this.registration = channelServer.addChannelOpenListener(TEST_CHANNEL, new OpenListener() {

        @Override
        public void registrationTerminated() {
        }

        @Override
        public void channelOpened(Channel channel) {
            serverChannel = channel;
            serverChannel.receiveMessage(receiver);
            clientConnectedLatch.countDown();
        }
    });
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:29,代码来源:RemoteChannelPairSetup.java

示例5: startChannelServer

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
@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());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:35,代码来源:TransactionalProtocolClientTestCase.java

示例6: getServiceOpenListener

import org.jboss.remoting3.OpenListener; //导入依赖的package包/类
public OpenListener getServiceOpenListener ( String serviceType ) {
    return null;
}
 
开发者ID:hucheat,项目名称:APacheSynapseSimplePOC,代码行数:4,代码来源:JBoss.java


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