[jboss-cvs] JBossAS SVN: r109379 - in trunk: component-matrix and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 18 17:59:29 EST 2010
Author: smarlow at redhat.com
Date: 2010-11-18 17:59:28 -0500 (Thu, 18 Nov 2010)
New Revision: 109379
Removed:
trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolDataProtocolStackConfigurator.java
Modified:
trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigMapper.java
trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigurationsMapper.java
trunk/component-matrix/pom.xml
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JChannelFactoryOverrideUnitTestCase.java
Log:
JBAS-8494 JGroups compononent upgrade to 2.11.0 and support for JGroups 2.10.x-2.11.x
Deleted: trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolDataProtocolStackConfigurator.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolDataProtocolStackConfigurator.java 2010-11-18 21:48:38 UTC (rev 109378)
+++ trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolDataProtocolStackConfigurator.java 2010-11-18 22:59:28 UTC (rev 109379)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.ha.framework.server.managed;
-
-import org.jgroups.conf.ProtocolData;
-import org.jgroups.conf.ProtocolStackConfigurator;
-
-/**
- *
- *
- * @author Brian Stansberry
- *
- * @version $Revision: $
- */
-public class ProtocolDataProtocolStackConfigurator implements ProtocolStackConfigurator
-{
- private final ProtocolData[] protocolData;
-
- /**
- * Create a new ProtocolDataProtocolStackConfigurator.
- *
- */
- public ProtocolDataProtocolStackConfigurator(ProtocolData[] protocolData)
- {
- if (protocolData == null)
- {
- throw new IllegalArgumentException("null protocolData");
- }
- this.protocolData = protocolData;
- }
-
- public ProtocolData[] getProtocolStack()
- {
- return this.protocolData;
- }
-
- public String getProtocolStackString()
- {
- StringBuilder buf=new StringBuilder();
- for (int i = 0; i < protocolData.length; i++)
- {
- buf.append(protocolData[i].getProtocolString(false));
- if(i < protocolData.length - 1)
- {
- buf.append(':');
- }
- }
- return buf.toString();
- }
-
-}
Modified: trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigMapper.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigMapper.java 2010-11-18 21:48:38 UTC (rev 109378)
+++ trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigMapper.java 2010-11-18 22:59:28 UTC (rev 109379)
@@ -23,11 +23,14 @@
package org.jboss.ha.framework.server.managed;
import java.lang.reflect.Type;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.jboss.ha.core.channelfactory.ProtocolData;
+import org.jboss.ha.core.channelfactory.ProtocolParameter;
import org.jboss.metatype.api.types.CollectionMetaType;
import org.jboss.metatype.api.types.CompositeMetaType;
import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
@@ -43,8 +46,6 @@
import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.metatype.spi.values.MetaMapper;
-import org.jgroups.conf.ProtocolData;
-import org.jgroups.conf.ProtocolParameter;
/**
* MetaMapper for the ProtocolData[] description of a JGroups protocol stack
@@ -175,20 +176,18 @@
{
CompositeValue protocolValue = (CompositeValue) elements[i];
String protName = (String) ((SimpleValue) protocolValue.get("name")).getValue();
- String protDesc = (String) ((SimpleValue) protocolValue.get("description")).getValue();
+ // String protDesc = (String) ((SimpleValue) protocolValue.get("description")).getValue();
String protClass = (String) ((SimpleValue) protocolValue.get("className")).getValue();
CompositeValue paramsValue = (CompositeValue) protocolValue.get("protocolParameters");
Set<String> paramNames = paramsValue.getMetaType().keySet();
- ProtocolParameter[] protParams = new ProtocolParameter[paramNames.size()];
- int j = 0;
+ 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[j] = new ProtocolParameter(paramName, paramVal);
- j++;
+ protParams.add(new ProtocolParameter(paramName, paramVal));
}
- protocolData[i] = new ProtocolData(protName, protDesc, protClass, protParams);
+ protocolData[i] = new ProtocolData(protName, protClass, protParams);
}
return protocolData;
}
Modified: trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigurationsMapper.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigurationsMapper.java 2010-11-18 21:48:38 UTC (rev 109378)
+++ trunk/cluster/src/main/java/org/jboss/ha/framework/server/managed/ProtocolStackConfigurationsMapper.java 2010-11-18 22:59:28 UTC (rev 109379)
@@ -26,7 +26,9 @@
import java.util.HashMap;
import java.util.Map;
+import org.jboss.ha.core.channelfactory.ProtocolData;
import org.jboss.ha.core.channelfactory.ProtocolStackConfigInfo;
+import org.jboss.ha.core.channelfactory.ProtocolStackUtil;
import org.jboss.metatype.api.types.CompositeMetaType;
import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
import org.jboss.metatype.api.types.MetaType;
@@ -39,9 +41,6 @@
import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.metatype.spi.values.MetaMapper;
-import org.jgroups.conf.ConfiguratorFactory;
-import org.jgroups.conf.ProtocolData;
-import org.jgroups.conf.ProtocolStackConfigurator;
/**
* {@link MetaMapper} for a map of {@link ProtocolStackConfigInfo}s keyed by
@@ -141,12 +140,11 @@
String description = (String) ((SimpleValue) stackValue.get("description")).getValue();
CollectionValue protocolsValue = (CollectionValue) stackValue.get("configuration");
- ProtocolData[] protocolData = CONFIG_MAPPER.unwrapMetaValue(protocolsValue);
- ProtocolStackConfigurator configurator = new ProtocolDataProtocolStackConfigurator(protocolData);
+ ProtocolData[] protocolData = CONFIG_MAPPER.unwrapMetaValue(protocolsValue);
// fixes http://jira.jboss.com/jira/browse/JGRP-290
- ConfiguratorFactory.substituteVariables(configurator); // replace vars with system props
+ ProtocolStackUtil.substituteVariables(protocolData); // replace vars with system props
- result.put(stack, new ProtocolStackConfigInfo(name, description, configurator));
+ result.put(stack, new ProtocolStackConfigInfo(name, description, protocolData));
}
return result;
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2010-11-18 21:48:38 UTC (rev 109378)
+++ trunk/component-matrix/pom.xml 2010-11-18 22:59:28 UTC (rev 109379)
@@ -79,7 +79,7 @@
<version.org.jboss.classpool>1.0.0.Alpha6</version.org.jboss.classpool>
<version.org.jboss.cluster.client>1.1.2.Final</version.org.jboss.cluster.client>
<version.org.jboss.cluster.server.api>2.0.0.CR1</version.org.jboss.cluster.server.api>
- <version.org.jboss.cluster.server.core>1.0.0.CR1</version.org.jboss.cluster.server.core>
+ <version.org.jboss.cluster.server.core>1.0.0.CR2</version.org.jboss.cluster.server.core>
<version.org.jboss.cluster.server.ispn>1.0.0.CR6</version.org.jboss.cluster.server.ispn>
<version.org.jboss.cluster.cache.spi>3.0.0.CR1</version.org.jboss.cluster.cache.spi>
<version.org.jboss.cluster.cache.ispn>1.0.0.CR7</version.org.jboss.cluster.cache.ispn>
@@ -140,7 +140,7 @@
<version.org.jboss.weld>1.1.0.Beta2</version.org.jboss.weld>
<version.org.jboss.xnio>2.1.0.CR2</version.org.jboss.xnio>
<version.org.jboss.xnio.metadata>2.1.0.CR5</version.org.jboss.xnio.metadata>
- <version.org.jgroups>2.10.1.GA</version.org.jgroups>
+ <version.org.jgroups>2.11.0.GA</version.org.jgroups>
<version.org.slf4j>1.5.6</version.org.slf4j>
<version.ch.qos.cal10n>0.7.2</version.ch.qos.cal10n>
<version.org.springframework>3.0.1.RELEASE</version.org.springframework>
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JChannelFactoryOverrideUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JChannelFactoryOverrideUnitTestCase.java 2010-11-18 21:48:38 UTC (rev 109378)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JChannelFactoryOverrideUnitTestCase.java 2010-11-18 22:59:28 UTC (rev 109379)
@@ -30,14 +30,13 @@
import junit.framework.TestCase;
+import org.jboss.ha.core.channelfactory.ProtocolData;
+import org.jboss.ha.core.channelfactory.ProtocolParameter;
import org.jboss.ha.core.channelfactory.ProtocolStackConfigInfo;
import org.jboss.ha.framework.server.JChannelFactory;
-import org.jboss.ha.framework.server.managed.ProtocolDataProtocolStackConfigurator;
import org.jboss.logging.Logger;
import org.jgroups.Channel;
import org.jgroups.JChannel;
-import org.jgroups.conf.ProtocolData;
-import org.jgroups.conf.ProtocolParameter;
import org.jgroups.protocols.TP;
/**
@@ -134,19 +133,19 @@
assertNotNull(origTransport);
ProtocolParameter[] origParams = origTransport.getParametersAsArray();
ProtocolParameter[] newParams = origParams.clone();
- ProtocolData newTransport = new ProtocolData(origTransport.getProtocolName(), origTransport.getDescription(), origTransport.getClassName(), newParams);
+ 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(), new ProtocolDataProtocolStackConfigurator(newConfig));
+ 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", new ProtocolDataProtocolStackConfigurator(addedConfig));
+ ProtocolStackConfigInfo added = new ProtocolStackConfigInfo("added", "added", addedConfig);
newMap.put("added", added);
assertTrue(newMap.containsKey("shared2"));
More information about the jboss-cvs-commits
mailing list