Examples of DefaultChannelGroup


Examples of org.jboss.netty.channel.group.DefaultChannelGroup

    public NettyConsumer(NettyEndpoint nettyEndpoint, Processor processor, NettyConfiguration configuration) {
        super(nettyEndpoint, processor);
        this.context = this.getEndpoint().getCamelContext();
        this.configuration = configuration;
        this.allChannels = new DefaultChannelGroup("NettyConsumer-" + nettyEndpoint.getEndpointUri());
    }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

    /*
     * gather connections related to the targetUuid requested
     */
    @Override
    public void createSession(SourceHandler sourceHandler, Class<? extends TargetHandler> targetHandler, String targetUuid) {
        ChannelGroup group = new DefaultChannelGroup();
        HashSet<String> uuids = new HashSet<>();
        boolean breakOnMatch = targetUuid != null && !targetUuid.isEmpty();
        int sessionID = nextSession.incrementAndGet();
        synchronized (connectedChannels) {
            for (ChannelState state : connectedChannels) {
                if (
                        (targetUuid == MeshyConstants.LINK_ALL) ||
                        (targetUuid == MeshyConstants.LINK_NAMED && state.getRemoteAddress() != null) ||
                        (state.getName() != null && targetUuid.equals(state.getName()))
                        ) {
                    /* prevent dups if >1 connection to the same host */
                    if (state.getName() != null && !uuids.add(state.getName())) {
                        continue;
                    }
                    group.add(state.getChannel());
                    /* add channel callback path to source */
                    state.addSourceHandler(sessionID, sourceHandler);
                    if (breakOnMatch) {
                        break;
                    }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

            ThriftServerDef def = ThriftServerDef.newBuilder()
                                                 .listen(0)
                                                 .withProcessor(processor)
                                                 .speaks(protocolFactory).build();

            server = new NettyServerTransport(def, NettyServerConfig.newBuilder().build(), new DefaultChannelGroup());
            server.start();
        }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

    private void startServer(final ThriftServerDefBuilder thriftServerDefBuilder)
    {
        server = new NettyServerTransport(thriftServerDefBuilder.build(),
                                          NettyServerConfig.newBuilder().build(),
                                          new DefaultChannelGroup());
        server.start();
        port = ((InetSocketAddress)server.getServerChannel().getLocalAddress()).getPort();
    }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

    @Override
    protected void startUp() throws Exception {
        serverTransport = new NettyServerTransport(configuration.thriftServerDef(),
                                                   configuration.nettyServerConfig(),
                                                   new DefaultChannelGroup());
        serverTransport.start();
    }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

    public NettyConsumer(NettyEndpoint nettyEndpoint, Processor processor, NettyConfiguration configuration) {
        super(nettyEndpoint, processor);
        this.context = this.getEndpoint().getCamelContext();
        this.configuration = configuration;
        this.allChannels = new DefaultChannelGroup("NettyProducer-" + nettyEndpoint.getEndpointUri());
    }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

        private final EnumMap<Event.Type, ChannelGroup> groups = new EnumMap<Event.Type, ChannelGroup>(Event.Type.class);

        public ConnectionTracker()
        {
            for (Event.Type type : Event.Type.values())
                groups.put(type, new DefaultChannelGroup(type.toString()));
        }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

        private final EnumMap<Event.Type, ChannelGroup> groups = new EnumMap<Event.Type, ChannelGroup>(Event.Type.class);

        public ConnectionTracker()
        {
            for (Event.Type type : Event.Type.values())
                groups.put(type, new DefaultChannelGroup(type.toString()));
        }
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

     *      be disabled.
     */
    public DefaultSmppServer(final SmppServerConfiguration configuration, SmppServerHandler serverHandler, ExecutorService executor, ScheduledExecutorService monitorExecutor) {
        this.configuration = configuration;
        // the same group we'll put every server channel
        this.channels = new DefaultChannelGroup();
        this.serverHandler = serverHandler;
        // we'll put the "boss" worker for a server in its own pool
        this.bossThreadPool = Executors.newCachedThreadPool();
       
        // a factory for creating channels (connections)
View Full Code Here

Examples of org.jboss.netty.channel.group.DefaultChannelGroup

     * @param monitorExecutor The scheduled executor that all sessions will share
     *      to monitor themselves and expire requests.  If null monitoring will
     *      be disabled.
     */
    public DefaultSmppClient(ExecutorService executors, int expectedSessions, ScheduledExecutorService monitorExecutor) {
        this.channels = new DefaultChannelGroup();
        this.executors = executors;
        this.channelFactory = new NioClientSocketChannelFactory(this.executors, this.executors, expectedSessions);
        this.clientBootstrap = new ClientBootstrap(channelFactory);
        // we use the same default pipeline for all new channels - no need for a factory
        this.clientConnector = new SmppClientConnector(this.channels);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.