Examples of ProtocolConfiguration


Examples of org.jgroups.conf.ProtocolConfiguration

            log.warn("unable to find an address other than loopback for IP version " + ip_version);
            default_ip_address=Util.getLocalhost(ip_version);
        }

        for(int i=0; i < protocol_configs.size(); i++) {
            ProtocolConfiguration protocol_config=protocol_configs.get(i);
            Protocol protocol=protocols.get(i);
            String protocolName=protocol.getName();

            // regenerate the Properties which were destroyed during basic property processing
            Map<String,String> properties=protocol_config.getOriginalProperties();

            Method[] methods=Util.getAllDeclaredMethodsWithAnnotations(protocol.getClass(), Property.class);
            for(int j=0; j < methods.length; j++) {
                if(isSetPropertyMethod(methods[j])) {
                    String propertyName=PropertyHelper.getPropertyName(methods[j]);
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

         removeFailureDetectionTcp(jgroupsCfg);

      if (!flags.isSiteIndexSpecified()) {
         removeRela2(jgroupsCfg);
      } else {
         ProtocolConfiguration protocol = jgroupsCfg.getProtocol(RELAY2);
         protocol.getProperties().put("site", flags.siteName());
         if (flags.relayConfig() != null) //if not specified, use default
            protocol.getProperties().put("config", flags.relayConfig());
      }

      if (!flags.withMerge())
         removeMerge(jgroupsCfg);
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      return replaceProperties(jgroupsCfg, props, TCP);
   }

   private static String replaceProperties(
         JGroupsProtocolCfg cfg, Map<String, String> newProps, ProtocolType type) {
      ProtocolConfiguration protocol = cfg.getProtocol(type);
      ProtocolConfiguration newProtocol =
            new ProtocolConfiguration(protocol.getProtocolName(), newProps);
      cfg.replaceProtocol(type, newProtocol);
      return cfg.toString();
   }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      static List<ProtocolConfiguration> copy(List<ProtocolConfiguration> protocols) {
         // Make a safe copy of the protocol stack to avoid concurrent modification issues
         List<ProtocolConfiguration> copy =
               new ArrayList<ProtocolConfiguration>(protocols.size());
         for (ProtocolConfiguration p : protocols)
            copy.add(new ProtocolConfiguration(
                  p.getProtocolName(), immutableMapCopy(p.getProperties())));

         return copy;
      }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      boolean containsProtocol(ProtocolType type) {
         return getProtocol(type) != null;
      }

      JGroupsProtocolCfg replaceProtocol(ProtocolType type, ProtocolConfiguration newCfg) {
         ProtocolConfiguration oldCfg = protoMap.get(type);
         int position = configurator.getProtocolStack().indexOf(oldCfg);
         // Remove protocol and put new configuration in same position
         return removeProtocol(type).addProtocol(type, newCfg, position);
      }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

         removeFailureDetectionTcp(jgroupsCfg);

      if (!flags.isSiteIndexSpecified()) {
         removeRela2(jgroupsCfg);
      } else {
         ProtocolConfiguration protocol = jgroupsCfg.getProtocol(RELAY2);
         protocol.getProperties().put("site", flags.siteName());
         if (flags.relayConfig() != null) //if not specified, use default
            protocol.getProperties().put("config", flags.relayConfig());
      }

      if (!flags.withMerge())
         removeMerge(jgroupsCfg);
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      return replaceProperties(jgroupsCfg, props, TCP);
   }

   private static String replaceProperties(
         JGroupsProtocolCfg cfg, Map<String, String> newProps, ProtocolType type) {
      ProtocolConfiguration protocol = cfg.getProtocol(type);
      ProtocolConfiguration newProtocol =
            new ProtocolConfiguration(protocol.getProtocolName(), newProps);
      cfg.replaceProtocol(type, newProtocol);
      return cfg.toString();
   }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      static List<ProtocolConfiguration> copy(List<ProtocolConfiguration> protocols) {
         // Make a safe copy of the protocol stack to avoid concurrent modification issues
         List<ProtocolConfiguration> copy =
               new ArrayList<ProtocolConfiguration>(protocols.size());
         for (ProtocolConfiguration p : protocols)
            copy.add(new ProtocolConfiguration(
                  p.getProtocolName(), immutableMapCopy(p.getProperties())));

         return copy;
      }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

      boolean containsProtocol(ProtocolType type) {
         return getProtocol(type) != null;
      }

      JGroupsProtocolCfg replaceProtocol(ProtocolType type, ProtocolConfiguration newCfg) {
         ProtocolConfiguration oldCfg = protoMap.get(type);
         int position = configurator.getProtocolStack().indexOf(oldCfg);
         // Remove protocol and put new configuration in same position
         return removeProtocol(type).addProtocol(type, newCfg, position);
      }
View Full Code Here

Examples of org.jgroups.conf.ProtocolConfiguration

  @Test
  public void should_create_jchannel_using_provided_configurator_and_cluster_name() throws Exception {
    JGroupsChannelFactoryBean factoryBean = new JGroupsChannelFactoryBean();

    ProtocolStackConfigurator protocolStackConfigurator = mock(ProtocolStackConfigurator.class);
    List<ProtocolConfiguration> protocols = asList(new ProtocolConfiguration("UDP"));
    when(protocolStackConfigurator.getProtocolStack()).thenReturn(protocols);


    factoryBean.setProtocolStackConfigurator(protocolStackConfigurator);
    factoryBean.setClusterName("cluster");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.