Package org.cometd.bayeux

Examples of org.cometd.bayeux.ChannelId


    protected ChannelId newChannelId(String channelId)
    {
        // Save some parsing by checking if there is already one
        AbstractSessionChannel channel = getChannels().get(channelId);
        return channel == null ? new ChannelId(channelId) : channel.getChannelId();
    }
View Full Code Here


        AbstractSessionChannel channel = channelRef.getReference();
        channel.notifyMessageListeners(message);
        if (channelRef.isMarked())
            channel.release();

        ChannelId channelId = channel.getChannelId();
        for (String wildChannelName : channelId.getWilds())
        {
            MarkedReference<AbstractSessionChannel> wildChannelRef = getReleasableChannel(wildChannelName);
            AbstractSessionChannel wildChannel = wildChannelRef.getReference();
            wildChannel.notifyMessageListeners(message);
            if (wildChannelRef.isMarked())
View Full Code Here

        bayeuxClient.handshake();
        assertTrue(bayeuxClient.waitFor(1000, BayeuxClient.State.CONNECTED));

        String channel = "/a/" + value1 + "/" + value2 + "/d";
        assertFalse(new ChannelId(SubscriberWithParametersService.CHANNEL).bind(new ChannelId(channel)).isEmpty());

        bayeuxClient.getChannel(channel).publish("data");
        assertTrue(latch.await(5, TimeUnit.SECONDS));
    }
View Full Code Here

                        if (!ChannelId.isMeta(channel))
                            throw new IllegalArgumentException("Annotation @" + Listener.class.getSimpleName() +
                                    " on method '" + method.getName() + "' in class '" +
                                    method.getDeclaringClass().getName() + "' must specify a meta channel");

                        ChannelId channelId = new ChannelId(channel);
                        if (channelId.isTemplate())
                            channel = channelId.getWilds().get(0);

                        ListenerCallback listenerCallback = new ListenerCallback(bean, method, paramNames, channelId, channel);
                        clientSession.getChannel(channel).addListener(listenerCallback);

                        List<ListenerCallback> callbacks = listeners.get(bean);
View Full Code Here

        }
    }

    private ChannelId getChannelId(String channelName)
    {
        ChannelId result = channelIds.get(channelName);
        if (result == null)
        {
            result = new ChannelId(channelName);
            ChannelId existing = channelIds.putIfAbsent(channelName, result);
            if (existing != null)
                result = existing;
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.cometd.bayeux.ChannelId

Copyright © 2018 www.massapicom. 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.