Examples of ProtocolParameter


Examples of org.jboss.ha.core.channelfactory.ProtocolParameter

      ProtocolData origTransport = origConfig[0];
      assertNotNull(origTransport);
      ProtocolParameter[] origParams = origTransport.getParametersAsArray();
      ProtocolParameter[] newParams = origParams.clone();     
      ProtocolData newTransport = new ProtocolData(origTransport.getProtocolName(), origTransport.getClassName(), newParams);
      ProtocolParameter overrideParam = new ProtocolParameter("max_bundle_size", "50000");
      newTransport.override(new ProtocolParameter[]{overrideParam});
      ProtocolData[] newConfig = origConfig.clone();
      newConfig[0] = newTransport;
     
      ProtocolStackConfigInfo updated = new ProtocolStackConfigInfo(unshared1.getName(), unshared1.getDescription(), newConfig);
     
      Map<String, ProtocolStackConfigInfo> newMap = new HashMap<String, ProtocolStackConfigInfo>(origMap);
      newMap.put("unshared1", updated);
   
      ProtocolData[] addedConfig = origConfig.clone();
      ProtocolStackConfigInfo added = new ProtocolStackConfigInfo("added", "added", addedConfig);
      newMap.put("added", added);
     
      assertTrue(newMap.containsKey("shared2"));
      newMap.remove("shared2");
     
      factory.setProtocolStackConfigurations(newMap);
     
      if (startBeforeOverride == false)
      {
         factory.create();
         factory.start();
      }
     
      Map<String, ProtocolStackConfigInfo> reread = factory.getProtocolStackConfigurations();
      origKeys.remove("shared2");
      origKeys.add("added");
      assertEquals(origKeys, reread.keySet());
     
      ProtocolStackConfigInfo addedInfo = reread.get("added");
      assertEquals("added", addedInfo.getName());
      assertEquals("added", addedInfo.getDescription());
      ProtocolData[] readAdded = addedInfo.getConfiguration();
      assertEquals(addedConfig.length, readAdded.length);
      for (int i = 0; i < readAdded.length; i++)
      {
         assertEquals(addedConfig[i], readAdded[i]);
         ProtocolParameter[] inputParams = addedConfig[i].getParametersAsArray();
         ProtocolParameter[] outputParams = readAdded[i].getParametersAsArray();
         assertEquals(inputParams.length, outputParams.length);
         @SuppressWarnings("unchecked")
         Map<String, ProtocolParameter> paramMap = readAdded[i].getParameters();
         for (int j = 0; j < inputParams.length; j++)
         {
            ProtocolParameter param = paramMap.get(inputParams[j].getName());
            assertNotNull(param);
            assertEquals(inputParams[j].getValue(), param.getValue());
         }
      }
     
      ProtocolStackConfigInfo updatedInfo = reread.get("unshared1");
      assertEquals("unshared1", updatedInfo.getName());
      ProtocolData[] readUpdated = updatedInfo.getConfiguration();
      assertEquals(origConfig.length, readUpdated.length);
      for (int i = 0; i < readUpdated.length; i++)
      {
         assertEquals(origConfig[i], readUpdated[i]);
         ProtocolParameter[] inputParams = origConfig[i].getParametersAsArray();
         ProtocolParameter[] outputParams = readUpdated[i].getParametersAsArray();
         assertEquals(inputParams.length, outputParams.length);
         @SuppressWarnings("unchecked")
         Map<String, ProtocolParameter> paramMap = readUpdated[i].getParameters();
         for (int j = 0; j < inputParams.length; j++)
         {
            String name = inputParams[j].getName();
            ProtocolParameter param = paramMap.get(name);
            assertNotNull(param);
            if ("max_bundle_size".equals(name))
            {
               assertEquals("50000", param.getValue());
            }
            else
            {
               assertEquals(inputParams[j].getValue(), param.getValue());
            }
         }
      }
     
      // Validate that the overrides actuall affect created channels
View Full Code Here

Examples of org.jboss.ha.core.channelfactory.ProtocolParameter

         List<ProtocolParameter> protParams = new ArrayList<ProtocolParameter>(paramNames.size());
         for (String paramName : paramNames)
         {
            CompositeValue paramValue = (CompositeValue) paramsValue.get(paramName);
            String paramVal = (String) ((SimpleValue) paramValue.get("value")).getValue();
            protParams.add(new ProtocolParameter(paramName, paramVal));
         }
         protocolData[i] = new ProtocolData(protName, protClass, protParams);
      }
      return protocolData;
   }
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

      ProtocolStackConfigurator result = null;
      try
      {
         ProtocolData[] protocols=orig.getProtocolStack();
         ProtocolData transport=protocols[0];
         ProtocolParameter singletonParam = new ProtocolParameter(Global.SINGLETON_NAME, singletonName);
         transport.override(new ProtocolParameter[]{ singletonParam});
         result = orig;
      }
      catch (UnsupportedOperationException uoe)
      {
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

               String[] split = unsplit.split(";");
                params = new ProtocolParameter[split.length];
               for (int j = 0; j < split.length; j++)
               {
                  String[] keyVal = split[j].split("=");
                  params[j] = new ProtocolParameter(keyVal[0], keyVal[1]);
               }
            }
            else
            {
               params = new ProtocolParameter[0];
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

    private static JChannel createSharedChannel(String singleton_name) throws ChannelException {
        ProtocolStackConfigurator config=ConfiguratorFactory.getStackConfigurator(CHANNEL_CONFIG);
        ProtocolData[] protocols=config.getProtocolStack();
        ProtocolData transport=protocols[0];
        transport.getParameters().put(Global.SINGLETON_NAME, new ProtocolParameter(Global.SINGLETON_NAME, singleton_name));
        return new JChannel(config);
    }
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

      ProtocolStackConfigurator result = null;
      try
      {
         ProtocolData[] protocols=orig.getProtocolStack();
         ProtocolData transport=protocols[0];
         ProtocolParameter singletonParam = new ProtocolParameter(Global.SINGLETON_NAME, singletonName);
         transport.override(new ProtocolParameter[]{ singletonParam});
         result = orig;
      }
      catch (UnsupportedOperationException uoe)
      {
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

               String[] split = unsplit.split(";");
                params = new ProtocolParameter[split.length];
               for (int j = 0; j < split.length; j++)
               {
                  String[] keyVal = split[j].split("=");
                  params[j] = new ProtocolParameter(keyVal[0], keyVal[1]);
               }
            }
            else
            {
               params = new ProtocolParameter[0];
View Full Code Here

Examples of org.jgroups.conf.ProtocolParameter

      ProtocolStackConfigurator result = null;
      try
      {
         ProtocolData[] protocols=orig.getProtocolStack();
         ProtocolData transport=protocols[0];
         ProtocolParameter singletonParam = new ProtocolParameter(Global.SINGLETON_NAME, singletonName);
         transport.override(new ProtocolParameter[]{ singletonParam});
         result = orig;
      }
      catch (UnsupportedOperationException uoe)
      {
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.