Search in sources :

Example 1 with JGroupsReceiver

use of org.xwiki.observation.remote.jgroups.JGroupsReceiver in project xwiki-platform by xwiki.

the class JGroupsNetworkAdapter method createChannel.

/**
 * Create a new channel.
 *
 * @param channelId the identifier of the channel to create
 * @return the new channel
 * @throws Exception failed to create new channel
 */
private JChannel createChannel(String channelId) throws Exception {
    // load configuration
    ProtocolStackConfigurator channelConf = loadChannelConfiguration(channelId);
    // get Receiver
    JGroupsReceiver channelReceiver;
    try {
        channelReceiver = this.componentManager.getInstance(JGroupsReceiver.class, channelId);
    } catch (ComponentLookupException e) {
        channelReceiver = this.componentManager.getInstance(JGroupsReceiver.class);
    }
    // create channel
    JChannel channel = new JChannel(channelConf);
    channel.setReceiver(channelReceiver);
    channel.setDiscardOwnMessages(true);
    return channel;
}
Also used : JChannel(org.jgroups.JChannel) ProtocolStackConfigurator(org.jgroups.conf.ProtocolStackConfigurator) JGroupsReceiver(org.xwiki.observation.remote.jgroups.JGroupsReceiver) ComponentLookupException(org.xwiki.component.manager.ComponentLookupException)

Aggregations

JChannel (org.jgroups.JChannel)1 ProtocolStackConfigurator (org.jgroups.conf.ProtocolStackConfigurator)1 ComponentLookupException (org.xwiki.component.manager.ComponentLookupException)1 JGroupsReceiver (org.xwiki.observation.remote.jgroups.JGroupsReceiver)1