Package org.jgroups.conf

Examples of org.jgroups.conf.ProtocolConfiguration


        if(protocol_string == null)
            return null;
       
        for(String component_string: protocol_string) {                      
            retval.add(new ProtocolConfiguration(component_string));
        }
        return retval;
    }
View Full Code Here


     * @param stack The protocol stack
     * @return List of Protocols
     */
    private static List<Protocol> createProtocols(List<ProtocolConfiguration> protocol_configs, final ProtocolStack stack) throws Exception {
        List<Protocol> retval=new LinkedList<Protocol>();
        ProtocolConfiguration protocol_config;
        Protocol layer;
        String singleton_name;

        for(int i=0; i < protocol_configs.size(); i++) {
            protocol_config=protocol_configs.get(i);
            singleton_name=protocol_config.getProperties().get(Global.SINGLETON_NAME);
            if(singleton_name != null && singleton_name.trim().length() > 0) {
               Map<String,Tuple<TP, ProtocolStack.RefCounter>> singleton_transports=ProtocolStack.getSingletonTransports();
                synchronized(singleton_transports) {
                    if(i > 0) { // crude way to check whether protocol is a transport
                        throw new IllegalArgumentException("Property 'singleton_name' can only be used in a transport" +
                                " protocol (was used in " + protocol_config.getProtocolName() + ")");
                    }
                    Tuple<TP, ProtocolStack.RefCounter> val=singleton_transports.get(singleton_name);
                    layer=val != null? val.getVal1() : null;
                    if(layer != null) {
                        retval.add(layer);
View Full Code Here

      // Map protocol -> Map<String, InetAddressInfo>, where the latter is protocol specific
      Map<String, Map<String,InetAddressInfo>> inetAddressMap = new HashMap<String, Map<String, InetAddressInfo>>() ;

      // collect InetAddressInfo
      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();

        // check which InetAddress-related properties are ***non-null ***, and
        // create an InetAddressInfo structure for them
        // Method[] methods=protocol.getClass().getMethods();
            Method[] methods=Util.getAllDeclaredMethodsWithAnnotations(protocol.getClass(), Property.class);
View Full Code Here

            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

     * @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

        if(protocol_string == null)
            return null;
       
        for(String component_string: protocol_string) {                      
            retval.add(new ProtocolConfiguration(component_string));
        }
        return retval;
    }
View Full Code Here

     * @param stack The protocol stack
     * @return List of Protocols
     */
    private static List<Protocol> createProtocols(List<ProtocolConfiguration> protocol_configs, final ProtocolStack stack) throws Exception {
        List<Protocol> retval=new LinkedList<Protocol>();
        ProtocolConfiguration protocol_config;
        Protocol layer;
        String singleton_name;

        for(int i=0; i < protocol_configs.size(); i++) {
            protocol_config=protocol_configs.get(i);
            singleton_name=protocol_config.getProperties().get(Global.SINGLETON_NAME);
            if(singleton_name != null && singleton_name.trim().length() > 0) {
               Map<String,Tuple<TP, ProtocolStack.RefCounter>> singleton_transports=ProtocolStack.getSingletonTransports();
                synchronized(singleton_transports) {
                    if(i > 0) { // crude way to check whether protocol is a transport
                        throw new IllegalArgumentException("Property 'singleton_name' can only be used in a transport" +
                                " protocol (was used in " + protocol_config.getProtocolName() + ")");
                    }
                    Tuple<TP, ProtocolStack.RefCounter> val=singleton_transports.get(singleton_name);
                    layer=val != null? val.getVal1() : null;
                    if(layer != null) {
                        retval.add(layer);
View Full Code Here

      // Map protocol -> Map<String, InetAddressInfo>, where the latter is protocol specific
      Map<String, Map<String,InetAddressInfo>> inetAddressMap = new HashMap<String, Map<String, InetAddressInfo>>() ;

      // collect InetAddressInfo
      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();

        // check which InetAddress-related properties are ***non-null ***, and
        // create an InetAddressInfo structure for them
        // Method[] methods=protocol.getClass().getMethods();
            Method[] methods=Util.getAllDeclaredMethodsWithAnnotations(protocol.getClass(), Property.class);
View Full Code Here

            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

         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

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.