/** * When set to true, all messages sent by a member A will be discarded by A. * * @param flag */ public void setDiscardOwnMessages(boolean flag) {ch.setDiscardOwnMessages(flag);}
public QuoteClient() { super(); try { channel=new JChannel(props); channel.setDiscardOwnMessages(true); disp=(RpcDispatcher)new RpcDispatcher(channel, this).setMembershipListener(this); channel.connect(channel_name); } catch(Exception e) { System.err.println("QuoteClient(): " + e); } addWindowListener(this); }
@Override protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
protected void createBridge() { try { if(log.isTraceEnabled()) log.trace("I'm the coordinator, creating a channel (props=" + bridge_props + ", cluster_name=" + bridge_name + ")"); bridge=new JChannel(bridge_props); bridge.setDiscardOwnMessages(true); // don't receive my own messages bridge.setReceiver(new Receiver()); bridge.connect(bridge_name); } catch(Exception e) { log.error(Util.getMessage("FailedCreatingBridgeChannelProps") + bridge_props + ")", e); } }
@Override protected synchronized void initChannel() { this.channel.setDiscardOwnMessages(false); this.connectChannel = true; this.disconnectChannel = true; this.closeChannel = false; } }
/** * When set to true, all messages sent by a member A will be discarded by A. * * @param flag */ public void setDiscardOwnMessages(boolean flag) {ch.setDiscardOwnMessages(flag);}
@Override public void setDiscardOwnMessages(boolean flag) { jchannel.setDiscardOwnMessages(flag); }
/** * Connect to the cluster * @throws Exception */ public void init() throws Exception { logger.info( "Starting Atmosphere JGroups Clustering support with group name {}", this.clusterName); try { this.jchannel.setReceiver(this); this.jchannel.connect(clusterName); this.jchannel.setDiscardOwnMessages(true); } catch (Exception e) { logger.warn("Failed to connect to cluster: " + this.clusterName, e); throw e; } }
/** * Connect to the cluster * @throws Exception */ public void init() throws Exception { logger.info( "Starting Atmosphere JGroups Clustering support with group name {}", this.clusterName); try { this.jchannel.setReceiver(this); this.jchannel.connect(clusterName); this.jchannel.setDiscardOwnMessages(true); } catch (Exception e) { logger.warn("Failed to connect to cluster: " + this.clusterName, e); throw e; } }
/** * The JChannel's setDiscardOwnMessages must be called before constructing the control channel (and the value must never change) * @param channel */ public ControlChannel(JChannel channel) { super(channel); this.dataDiscardOwnMessages = channel.getDiscardOwnMessages(); channel.setDiscardOwnMessages(false); channel.setUpHandler(this); }
private void initiChannel(JChannel channel) throws Exception { openedChannles.add(channel); channel.setDiscardOwnMessages(true); channel.connect("someChannel"); } }
public QuoteClient() { super(); try { channel=new JChannel(props); channel.setDiscardOwnMessages(true); disp=(RpcDispatcher)new RpcDispatcher(channel, this).setMembershipListener(this); channel.connect(channel_name); } catch(Exception e) { System.err.println("QuoteClient(): " + e); } addWindowListener(this); }
@Override protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
@Override public void initialize(RevenoClusterConfiguration config) { this.config = config; Properties props = new Properties(); props.put("jgroups.tcp.bind_addr", ((InetAddress) config.currentNodeAddress()).getHost()); props.put("jgroups.tcp.bind_port", Integer.toString(((InetAddress) config.currentNodeAddress()).getPort())); props.put("jgroups.tcpping.initial_hosts", makeInitialHostsString(config.nodesAddresses())); props.put("jgroups.auth.token", Optional.ofNullable(config.authToken()).orElse("")); setProperties(props); try { String protocol; if (jGroupsConfigFile.startsWith("classpath:/")) { protocol = ResourceLoader.loadResource(new ByteArrayInputStream(DEFAULT_CONFIG.getBytes("UTF-8")), props); } else { protocol = ResourceLoader.loadResource(new File(jGroupsConfigFile), props); } Element xml = ResourceLoader.loadXMLFromString(protocol).getDocumentElement(); channel = new JChannel(xml); channel.setReceiver(new JChannelReceiver()); channel.setDiscardOwnMessages(true); cluster = new JGroupsCluster(config, channel); buffer = createBuffer(); } catch (Exception e) { throw Exceptions.runtime(e); } isInitialized = true; }
/** * INTERNAL: * This method creates JGroupsRemoteConnection to be used by this TransportManager. * It uses a JGroups JChannel using the RCM channel name and specified (or defaulted) config file. * Channel is set to not receive own messages. */ protected JGroupsRemoteConnection createConnection(boolean isLocalConnectionBeingCreated) throws RemoteCommandManagerException { try { JChannel channel; if (configFile != null && !configFile.isEmpty()) { channel = new JChannel(configFile); } else { channel = new JChannel(); } channel.connect(this.rcm.getChannel()); channel.setDiscardOwnMessages(true); return new JGroupsRemoteConnection(this.rcm, channel, isLocalConnectionBeingCreated); } catch (Exception ex) { throw RemoteCommandManagerException.errorCreatingJGroupsConnection(this.configFile, ex); } }
this.cacheReceiver = new JGroupsCacheReceiver(this.cacheManager, this.bootstrapManager); this.channel.setReceiver(this.cacheReceiver); this.channel.setDiscardOwnMessages(true);
channel.setDiscardOwnMessages(true); // do not receive a copy of our own messages channel.setReceiver(new ClusterReceiver()); channel.connect(getClusterName());
/** * 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; }
protected void createBridge() { try { if(log.isTraceEnabled()) log.trace("I'm the coordinator, creating a channel (props=" + bridge_props + ", cluster_name=" + bridge_name + ")"); bridge=new JChannel(bridge_props); bridge.setDiscardOwnMessages(true); // don't receive my own messages bridge.setReceiver(new Receiver()); bridge.connect(bridge_name); } catch(Exception e) { log.error(Util.getMessage("FailedCreatingBridgeChannelProps") + bridge_props + ")", e); } }