/** * Resolves and applies the specified properties to this protocol. * @param properties a map of property string values * @return this protocol * @throws Exception if any of the specified properties are unresolvable or unrecognized. */ public <T extends Protocol> T setProperties(Map<String, String> properties) throws Exception { // These Configurator methods are destructive, so make a defensive copy Map<String, String> copy = new HashMap<>(properties); Configurator.removeDeprecatedProperties(this, copy); Configurator.resolveAndAssignFields(this, copy); Configurator.resolveAndInvokePropertyMethods(this, copy); List<Object> objects = this.getConfigurableObjects(); if (objects != null) { for (Object object : objects) { Configurator.removeDeprecatedProperties(object, copy); Configurator.resolveAndAssignFields(object, copy); Configurator.resolveAndInvokePropertyMethods(object, copy); } } if (!copy.isEmpty()) { throw new IllegalArgumentException(String.format("Unrecognized %s properties: %s", this.getName(), copy.keySet())); } return (T)this; }
/** * Creates a channel from a list of protocols. Note that after a {@link org.jgroups.JChannel#close()}, the protocol * list <em>should not</em> be reused, ie. new JChannel(protocols) would reuse the same protocol list, and this * might lead to problems ! * @param protocols The list of protocols, from bottom to top, ie. the first protocol in the list is the transport, * the last the top protocol * @deprecated Use {@link JChannel#JChannel(List)} instead */ @Deprecated public JChannel(Collection<Protocol> protocols) throws Exception { prot_stack=new ProtocolStack().setChannel(this); for(Protocol prot: protocols) { prot_stack.addProtocol(prot); prot.setProtocolStack(prot_stack); } prot_stack.init(); // Substitute vars with defined system props (if any) List<Protocol> prots=prot_stack.getProtocols(); Map<String,String> map=new HashMap<>(); for(Protocol prot: prots) Configurator.resolveAndAssignFields(prot, map); }
/** * Creates a channel from a list of protocols. Note that after a {@link org.jgroups.JChannel#close()}, the protocol * list <em>should not</em> be reused, ie. new JChannel(protocols) would reuse the same protocol list, and this * might lead to problems ! * @param protocols The list of protocols, from bottom to top, ie. the first protocol in the list is the transport, * the last the top protocol */ public JChannel(List<Protocol> protocols) throws Exception { prot_stack=new ProtocolStack().setChannel(this); for(Protocol prot: protocols) { prot_stack.addProtocol(prot); prot.setProtocolStack(prot_stack); } prot_stack.init(); // Substitute vars with defined system props (if any) List<Protocol> prots=prot_stack.getProtocols(); Map<String,String> map=new HashMap<>(); for(Protocol prot: prots) Configurator.resolveAndAssignFields(prot, map); }
if(additional_objects != null && !additional_objects.isEmpty()) { for(Object obj: additional_objects) { resolveAndAssignFields(obj, properties); resolveAndInvokePropertyMethods(obj, properties);
/** * Resolves and applies the specified properties to this protocol. * @param properties a map of property string values * @return this protocol * @throws Exception if any of the specified properties are unresolvable or unrecognized. */ public <T extends Protocol> T setProperties(Map<String, String> properties) throws Exception { // These Configurator methods are destructive, so make a defensive copy Map<String, String> copy = new HashMap<>(properties); Configurator.removeDeprecatedProperties(this, copy); Configurator.resolveAndAssignFields(this, copy); Configurator.resolveAndInvokePropertyMethods(this, copy); List<Object> objects = this.getConfigurableObjects(); if (objects != null) { for (Object object : objects) { Configurator.removeDeprecatedProperties(object, copy); Configurator.resolveAndAssignFields(object, copy); Configurator.resolveAndInvokePropertyMethods(object, copy); } } if (!copy.isEmpty()) { throw new IllegalArgumentException(String.format("Unrecognized %s properties: %s", this.getName(), copy.keySet())); } return (T)this; }
/** * Creates a channel from a list of protocols. Note that after a {@link org.jgroups.JChannel#close()}, the protocol * list <em>should not</em> be reused, ie. new JChannel(protocols) would reuse the same protocol list, and this * might lead to problems ! * @param protocols The list of protocols, from bottom to top, ie. the first protocol in the list is the transport, * the last the top protocol * @deprecated Use {@link JChannel#JChannel(List)} instead */ @Deprecated public JChannel(Collection<Protocol> protocols) throws Exception { prot_stack=new ProtocolStack().setChannel(this); for(Protocol prot: protocols) { prot_stack.addProtocol(prot); prot.setProtocolStack(prot_stack); } prot_stack.init(); // Substitute vars with defined system props (if any) List<Protocol> prots=prot_stack.getProtocols(); Map<String,String> map=new HashMap<>(); for(Protocol prot: prots) Configurator.resolveAndAssignFields(prot, map); }
/** * Creates a channel from a list of protocols. Note that after a {@link org.jgroups.JChannel#close()}, the protocol * list <em>should not</em> be reused, ie. new JChannel(protocols) would reuse the same protocol list, and this * might lead to problems ! * @param protocols The list of protocols, from bottom to top, ie. the first protocol in the list is the transport, * the last the top protocol */ public JChannel(List<Protocol> protocols) throws Exception { prot_stack=new ProtocolStack().setChannel(this); for(Protocol prot: protocols) { prot_stack.addProtocol(prot); prot.setProtocolStack(prot_stack); } prot_stack.init(); // Substitute vars with defined system props (if any) List<Protocol> prots=prot_stack.getProtocols(); Map<String,String> map=new HashMap<>(); for(Protocol prot: prots) Configurator.resolveAndAssignFields(prot, map); }
if(additional_objects != null && !additional_objects.isEmpty()) { for(Object obj: additional_objects) { resolveAndAssignFields(obj, properties); resolveAndInvokePropertyMethods(obj, properties);
Configurator.resolveAndAssignFields(relay, relayConfig.getProperties()); Configurator.resolveAndInvokePropertyMethods(relay, relayConfig.getProperties()); stack.addProtocol(relay); clusterRole != null ? clusterRole : id, saslProps)); props.put("sasl_props", new PropertyConverters.StringProperties().toString(saslProps)); Configurator.resolveAndAssignFields(sasl, props); Configurator.resolveAndInvokePropertyMethods(sasl, props); channel.getProtocolStack().insertProtocol(sasl, ProtocolStack.Position.BELOW, GMS.class);