[jboss-cvs] JBossAS SVN: r85290 - in trunk/system-jmx/src: tests/org/jboss/test/system/metadata/value/valuefactory/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 5 07:02:54 EST 2009
Author: adrian at jboss.org
Date: 2009-03-05 07:02:54 -0500 (Thu, 05 Mar 2009)
New Revision: 85290
Modified:
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryValueMetaData.java
trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ValueFactoryParsingUnitTestCase.java
Log:
[JBAS-6559] - Remove use of DeploymentException from internals of ServiceController
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java 2009-03-05 11:11:38 UTC (rev 85289)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java 2009-03-05 12:02:54 UTC (rev 85290)
@@ -26,7 +26,7 @@
import java.beans.PropertyEditorManager;
import java.lang.reflect.Constructor;
-import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.util.Classes;
/**
@@ -78,7 +78,7 @@
return this.valueTypeName;
}
- public Object getValue(ServiceValueContext valueContext) throws DeploymentException
+ public Object getValue(ServiceValueContext valueContext) throws Exception
{
if (this.parameterTypeName == null)
throw new IllegalStateException("Must set parameterTypeName");
@@ -128,13 +128,13 @@
return (a == b || (a != null && a.equals(b)));
}
- public static Object getValue(ClassLoader serviceValueContextClassloader, String textValue, String typeName, String targetAttributeName) throws DeploymentException
+ public static Object getValue(ClassLoader serviceValueContextClassloader, String textValue, String typeName, String targetAttributeName) throws Exception
{
if (textValue == null)
return null;
// see if it is a primitive type first
- Class typeClass = Classes.getPrimitiveTypeForName(typeName);
+ Class<?> typeClass = Classes.getPrimitiveTypeForName(typeName);
if (typeClass == null)
{
// nope try look up
@@ -144,7 +144,7 @@
}
catch (ClassNotFoundException e)
{
- throw new DeploymentException("Class not found for attribute: " + targetAttributeName, e);
+ throw new ConfigurationException("Class not found for attribute: " + targetAttributeName, e);
}
}
@@ -157,14 +157,14 @@
try
{
// See if there is a ctor(String) for the type
- Class[] sig = {String.class};
- Constructor ctor = typeClass.getConstructor(sig);
+ Class<?>[] sig = {String.class};
+ Constructor<?> ctor = typeClass.getConstructor(sig);
Object[] args = {textValue};
return ctor.newInstance(args);
}
catch (Exception e)
{
- throw new DeploymentException("No property editor for attribute: " + targetAttributeName + "; type=" + typeClass.getName());
+ throw new ConfigurationException("No property editor for attribute: " + targetAttributeName + "; type=" + typeClass.getName());
}
}
else
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryValueMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryValueMetaData.java 2009-03-05 11:11:38 UTC (rev 85289)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryValueMetaData.java 2009-03-05 12:02:54 UTC (rev 85290)
@@ -33,7 +33,6 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.dependency.spi.DependencyItem;
import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
-import org.jboss.deployers.spi.DeploymentException;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.reflect.spi.MethodInfo;
@@ -73,7 +72,9 @@
*
* @param dependency the dependency
* @param method the property name
+ * @param parameters the parameters
* @param dependentState the dependent state
+ * @param defaultValue the default value
*/
@SuppressWarnings("unchecked")
public ServiceValueFactoryValueMetaData(Object dependency, String method, List<ServiceValueFactoryParameterMetaData> parameters, ControllerState dependentState, ServiceTextValueMetaData defaultValue)
@@ -180,7 +181,7 @@
visitor.visit(this);
}
- private Object[] getParameterValues(ServiceValueContext valueContext, ControllerContext factoryContext) throws DeploymentException
+ private Object[] getParameterValues(ServiceValueContext valueContext, ControllerContext factoryContext) throws Exception
{
if (parameterValues != null)
return parameterValues;
@@ -197,7 +198,7 @@
return parameterValues;
}
- private String[] getParameterTypes(ServiceValueContext valueContext, ControllerContext factoryContext) throws DeploymentException
+ private String[] getParameterTypes(ServiceValueContext valueContext, ControllerContext factoryContext) throws Exception
{
if (parameterTypes != null)
return parameterTypes;
@@ -210,7 +211,7 @@
return parameterTypes;
}
- private void analyzeParameters(ServiceValueContext valueContext, KernelControllerContext factoryContext) throws DeploymentException
+ private void analyzeParameters(ServiceValueContext valueContext, KernelControllerContext factoryContext) throws Exception
{
BeanInfo beanInfo = factoryContext.getBeanInfo();
Set<MethodInfo> allMethods = beanInfo.getMethods();
@@ -228,7 +229,7 @@
}
}
- private void extractParameters(ServiceValueContext valueContext) throws DeploymentException
+ private void extractParameters(ServiceValueContext valueContext) throws Exception
{
parameterTypes = new String[parameterMetaData.size()];
parameterValues = new Object[parameterMetaData.size()];
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java 2009-03-05 11:11:38 UTC (rev 85289)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java 2009-03-05 12:02:54 UTC (rev 85290)
@@ -27,12 +27,11 @@
import java.beans.PropertyEditor;
import java.beans.PropertyEditorManager;
-import org.jboss.deployers.spi.DeploymentException;
+import junit.framework.TestCase;
+
import org.jboss.util.propertyeditor.ElementEditor;
import org.w3c.dom.Element;
-import junit.framework.TestCase;
-
/**
* A ServiceValueFactoryParameterMetaDataUnitTestCase.
*
@@ -129,7 +128,7 @@
getValue(Thread.currentThread().getContextClassLoader(), ONE, HASH_MAP, ATTR);
fail("Should not have a property editor for HashMap");
}
- catch (DeploymentException expected) {}
+ catch (Exception expected) {}
}
public void testGetValueUnknownType()
@@ -139,7 +138,7 @@
getValue(Thread.currentThread().getContextClassLoader(), ONE, "com.foo.Bar", ATTR);
fail("Should not succeed with bogus type");
}
- catch (DeploymentException expected) {}
+ catch (Exception expected) {}
}
}
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ValueFactoryParsingUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ValueFactoryParsingUnitTestCase.java 2009-03-05 11:11:38 UTC (rev 85289)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ValueFactoryParsingUnitTestCase.java 2009-03-05 12:02:54 UTC (rev 85290)
@@ -26,7 +26,6 @@
import java.util.List;
import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.spi.DeploymentException;
import org.jboss.system.metadata.ServiceValueFactoryParameterMetaData;
import org.jboss.system.metadata.ServiceValueMetaData;
import org.jboss.test.system.metadata.value.AbstractValueTest;
More information about the jboss-cvs-commits
mailing list