Package org.jgroups.conf

Examples of org.jgroups.conf.ProtocolConfiguration


    Vector<Protocol> protocols = new Vector<Protocol>() ;
   
    // create the layer described by DEFAULTS
    protocol = Configurator.createProtocol(defaultProps, stack) ;
    // process the defaults
    protocol_configs.add(new ProtocolConfiguration(defaultProps)) ;
    protocols.add(protocol) ;
    Configurator.setDefaultValues(protocol_configs, protocols, StackType.IPv4) ;
   
    // get the value which should have been assigned a default
    int a = ((DEFAULTS)protocol).getA() ;
View Full Code Here


   
    // create the layer described by INETADDRESSES
    protocol = Configurator.createProtocol(configurableObjectsProps, stack) ;
   
    // process the defaults (want this eventually)
    protocol_configs.add(new ProtocolConfiguration(configurableObjectsProps)) ;
    protocols.add(protocol) ;
       
    // get the value which should have been assigned a default
    List<Object> configObjs = ((CONFIGOBJPROTOCOL)protocol).getConfigurableObjects() ;
    assert configObjs.size() == 1 ;
View Full Code Here

    Vector<Protocol> protocols = new Vector<Protocol>() ;
   
    // create the layer described by IPCHECK
    protocol = Configurator.createProtocol(ipCheckNoConsistentProps, stack) ;
    // process the defaults
    protocol_configs.add(new ProtocolConfiguration(ipCheckNoConsistentProps)) ;
    protocols.add(protocol) ;
   
        Map<String, Map<String,InetAddressInfo>> inetAddressMap = null ;
    try {
          inetAddressMap = Configurator.createInetAddressMap(protocol_configs, protocols) ;
View Full Code Here

    Vector<Protocol> protocols = new Vector<Protocol>() ;
   
    // create the layer described by IPCHECK
    protocol = Configurator.createProtocol(ipCheckConsistentProps, stack) ;
    // process the defaults
    protocol_configs.add(new ProtocolConfiguration(ipCheckConsistentProps)) ;
    protocols.add(protocol) ;
   
    Map<String, Map<String,InetAddressInfo>> inetAddressMap = null ;

    inetAddressMap = Configurator.createInetAddressMap(protocol_configs, protocols) ;
View Full Code Here

    }

    private JChannel createSharedChannel(String singleton_name) throws ChannelException {
        ProtocolStackConfigurator config=ConfiguratorFactory.getStackConfigurator(channel_conf);
        List<ProtocolConfiguration> protocols=config.getProtocolStack();
        ProtocolConfiguration transport=protocols.get(0);
        transport.getProperties().put(Global.SINGLETON_NAME, singleton_name);
        return new JChannel(config);
    }
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

     * @param stack The protocol stack
     * @return Protocol The newly created protocol
     * @exception Exception Will be thrown when the new protocol cannot be created
     */
    public static Protocol createProtocol(String prot_spec, ProtocolStack stack) throws Exception {
        ProtocolConfiguration config;
        Protocol prot;

        if(prot_spec == null) throw new Exception("Configurator.createProtocol(): prot_spec is null");

        // parse the configuration for this protocol
        config=new ProtocolConfiguration(prot_spec);

        // create an instance of the protocol class and configure it
        prot=createLayer(stack, config);
        prot.init();
        return prot;
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.