Package org.jgroups.conf

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


      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

      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

         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

      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

      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

      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

  @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

         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

      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

TOP

Related Classes of org.jgroups.conf.ProtocolConfiguration

Copyright © 2018 www.massapicom. 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.