/** * Returns the protocol stack configuration in string format. An example of this property is * <pre>"UDP:PING:FDALL:STABLE:NAKACK2:UNICAST3:FRAG2:GMS"</pre> */ public String getProperties() {return prot_stack != null? prot_stack.printProtocolSpec(true) : null;}
@SafeVarargs public final void insertProtocol(Protocol prot, Position position, Class<? extends Protocol>... neighbor_prots) throws Exception { if(neighbor_prots == null) throw new IllegalArgumentException("neighbor_prots is null"); Protocol neighbor=findProtocol(neighbor_prots); if(neighbor == null) throw new IllegalArgumentException("protocol \"" + Arrays.toString(neighbor_prots) + "\" not found in " + stack.printProtocolSpec(false)); insertProtocolInStack(prot, neighbor, position); }
public void insertProtocol(Protocol prot, Position position, Class<? extends Protocol> neighbor_prot) throws Exception { if(neighbor_prot == null) throw new IllegalArgumentException("neighbor_prot is null"); Protocol neighbor=findProtocol(neighbor_prot); if(neighbor == null) throw new IllegalArgumentException("protocol \"" + neighbor_prot + "\" not found in " + stack.printProtocolSpec(false)); if(position == Position.BELOW && neighbor instanceof TP) throw new IllegalArgumentException("\"" + prot + "\" cannot be inserted below the transport (" + neighbor + ")"); insertProtocolInStack(prot, neighbor, position); }
/** Dumps all protocols in string format. If include_props is set, the attrs of each protocol are also printed */ @ManagedOperation public String printProtocolSpec(boolean include_props) { ProtocolStack ps=getProtocolStack(); return ps != null? ps.printProtocolSpec(include_props) : null; }
public String getProperties() { return ch.getProtocolStack() != null? ch.getProtocolStack().printProtocolSpec(true) : null; }
/** * Inserts an already created (and initialized) protocol into the protocol list. Sets the links * to the protocols above and below correctly and adjusts the linked list of protocols accordingly. * Note that this method may change the value of top_prot or bottom_prot. * @param prot The protocol to be inserted. Before insertion, a sanity check will ensure that none * of the existing protocols have the same name as the new protocol. * @param position Where to place the protocol with respect to the neighbor_prot (ABOVE, BELOW) * @param neighbor_prot The name of the neighbor protocol. An exception will be thrown if this name * is not found * @exception Exception Will be thrown when the new protocol cannot be created, or inserted. */ public void insertProtocol(Protocol prot, Position position, String neighbor_prot) throws Exception { if(neighbor_prot == null) throw new IllegalArgumentException("neighbor_prot is null"); Protocol neighbor=findProtocol(neighbor_prot); if(neighbor == null) throw new IllegalArgumentException("protocol " + neighbor_prot + " not found in " + printProtocolSpec(false)); if(position == Position.BELOW && neighbor instanceof TP) throw new IllegalArgumentException("Cannot insert protocol " + prot.getName() + " below transport protocol"); insertProtocolInStack(prot, neighbor, position); }
public Map<String, String> handleProbe(String... keys) { for(String key: keys) { if(Objects.equals(key, "props")) { String tmp=printProtocolSpec(true); HashMap<String, String> map=new HashMap<>(1); map.put("props", tmp);
@Override public JChannel get() { try { JChannel channel = this.factory.get().createChannel(this.name); if (JGroupsLogger.ROOT_LOGGER.isTraceEnabled()) { JGroupsLogger.ROOT_LOGGER.tracef("JGroups channel %s created with configuration:%n %s", this.name, channel.getProtocolStack().printProtocolSpec(true)); } channel.stats(this.statisticsEnabled); if (this.server != null) { try { JmxConfigurator.registerChannel(channel, this.server.get(), this.name); } catch (Exception e) { JGroupsLogger.ROOT_LOGGER.debug(e.getLocalizedMessage(), e); } } channel.connect(this.cluster.get()); return channel; } catch (Exception e) { throw new IllegalStateException(e); } }
/** * Returns a pretty-printed form of all the protocols. If include_properties is set, * the properties for each protocol will also be printed. */ public String printProtocolSpec(boolean include_properties) { return prot_stack != null ? prot_stack.printProtocolSpec(include_properties) : null; }
/** * Returns the protocol stack configuration in string format. An example of this property is * <pre>"UDP:PING:FDALL:STABLE:NAKACK2:UNICAST3:FRAG2:GMS"</pre> */ public String getProperties() {return prot_stack != null? prot_stack.printProtocolSpec(true) : null;}
@SafeVarargs public final void insertProtocol(Protocol prot, Position position, Class<? extends Protocol>... neighbor_prots) throws Exception { if(neighbor_prots == null) throw new IllegalArgumentException("neighbor_prots is null"); Protocol neighbor=findProtocol(neighbor_prots); if(neighbor == null) throw new IllegalArgumentException("protocol \"" + Arrays.toString(neighbor_prots) + "\" not found in " + stack.printProtocolSpec(false)); insertProtocolInStack(prot, neighbor, position); }
public void insertProtocol(Protocol prot, Position position, Class<? extends Protocol> neighbor_prot) throws Exception { if(neighbor_prot == null) throw new IllegalArgumentException("neighbor_prot is null"); Protocol neighbor=findProtocol(neighbor_prot); if(neighbor == null) throw new IllegalArgumentException("protocol \"" + neighbor_prot + "\" not found in " + stack.printProtocolSpec(false)); if(position == Position.BELOW && neighbor instanceof TP) throw new IllegalArgumentException("\"" + prot + "\" cannot be inserted below the transport (" + neighbor + ")"); insertProtocolInStack(prot, neighbor, position); }
/** Dumps all protocols in string format. If include_props is set, the attrs of each protocol are also printed */ @ManagedOperation public String printProtocolSpec(boolean include_props) { ProtocolStack ps=getProtocolStack(); return ps != null? ps.printProtocolSpec(include_props) : null; }
public String getProperties() { return ch.getProtocolStack() != null? ch.getProtocolStack().printProtocolSpec(true) : null; }
/** * Inserts an already created (and initialized) protocol into the protocol list. Sets the links * to the protocols above and below correctly and adjusts the linked list of protocols accordingly. * Note that this method may change the value of top_prot or bottom_prot. * @param prot The protocol to be inserted. Before insertion, a sanity check will ensure that none * of the existing protocols have the same name as the new protocol. * @param position Where to place the protocol with respect to the neighbor_prot (ABOVE, BELOW) * @param neighbor_prot The name of the neighbor protocol. An exception will be thrown if this name * is not found * @exception Exception Will be thrown when the new protocol cannot be created, or inserted. */ public void insertProtocol(Protocol prot, Position position, String neighbor_prot) throws Exception { if(neighbor_prot == null) throw new IllegalArgumentException("neighbor_prot is null"); Protocol neighbor=findProtocol(neighbor_prot); if(neighbor == null) throw new IllegalArgumentException("protocol " + neighbor_prot + " not found in " + printProtocolSpec(false)); if(position == Position.BELOW && neighbor instanceof TP) throw new IllegalArgumentException("Cannot insert protocol " + prot.getName() + " below transport protocol"); insertProtocolInStack(prot, neighbor, position); }
@Override public void start(StartContext context) throws StartException { try { this.channel = this.factory.getValue().createChannel(this.name); } catch (Exception e) { throw new StartException(e); } if (LOGGER.isTraceEnabled()) { String output = this.channel.getProtocolStack().printProtocolSpec(true); LOGGER.tracef("JGroups channel %s created with configuration:\n %s", this.name, output); } }
public Map<String, String> handleProbe(String... keys) { for(String key: keys) { if(Objects.equals(key, "props")) { String tmp=printProtocolSpec(true); HashMap<String, String> map=new HashMap<>(1); map.put("props", tmp);
throw new Exception("protocol \"" + neighbor_prot + "\" not found in " + stack.printProtocolSpec(false));
@Override public JChannel get() { try { JChannel channel = this.factory.get().createChannel(this.name); if (JGroupsLogger.ROOT_LOGGER.isTraceEnabled()) { JGroupsLogger.ROOT_LOGGER.tracef("JGroups channel %s created with configuration:%n %s", this.name, channel.getProtocolStack().printProtocolSpec(true)); } channel.stats(this.statisticsEnabled); if (this.server != null) { try { JmxConfigurator.registerChannel(channel, this.server.get(), this.name); } catch (Exception e) { JGroupsLogger.ROOT_LOGGER.debug(e.getLocalizedMessage(), e); } } channel.connect(this.cluster.get()); return channel; } catch (Exception e) { throw new IllegalStateException(e); } }
@Override public void start(StartContext context) throws StartException { ChannelFactory factory = this.factory.getValue(); try { this.channel = factory.createChannel(this.id); this.channel.addChannelListener(this); // Don't connect the channel here // This will be done by Infinispan (see AS7-5904) } catch (Exception e) { throw new StartException(e); } if (ROOT_LOGGER.isTraceEnabled()) { String output = this.channel.getProtocolStack().printProtocolSpec(true); ROOT_LOGGER.tracef("JGroups channel named %s created with configuration:\n %s", this.id, output); } }