[jboss-cvs] JBossAS SVN: r59655 - in projects/microcontainer/trunk: container/src/main/org/jboss/reflect/plugins/introspection and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jan 15 15:42:39 EST 2007
Author: alesj
Date: 2007-01-15 15:42:03 -0500 (Mon, 15 Jan 2007)
New Revision: 59655
Added:
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertorFactory.java
Removed:
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java
Modified:
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/NullProgressionConvertor.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/SimpleProgressionConvertor.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ValueConvertor.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/NumberInfo.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/PrimitiveInfo.java
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/TypeInfo.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/config/Configurator.java
Log:
TypeInfo.isAssignableFrom, moving ProgressionConvertor[Factory] to SPI - using it in NumberInfo (part of SPI) and ValueConvertor
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -474,6 +474,15 @@
return (Object[]) Array.newInstance(clazz.getComponentType(), size);
}
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ if (info == null)
+ {
+ throw new NullPointerException("Parameter info cannot be null!");
+ }
+ return getType().isAssignableFrom(info.getType());
+ }
+
public TypeInfo[] getActualTypeArguments()
{
return null;
@@ -563,6 +572,11 @@
{
throw new UnreachableStatementException();
}
+
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ throw new UnreachableStatementException();
+ }
}
static class UnknownClassInfo extends UnknownTypeInfo implements ClassInfo
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/NullProgressionConvertor.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/NullProgressionConvertor.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/NullProgressionConvertor.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -21,6 +21,8 @@
*/
package org.jboss.reflect.plugins;
+import org.jboss.reflect.spi.ProgressionConvertor;
+
/**
* Null progression implementation - doesn't progress at all.
*
Deleted: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.reflect.plugins;
-
-/**
- * JBMICROCONT-119 issue
- * Support integer progression, e.g. float -> int or Float -> Integer and vice versa
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public interface ProgressionConvertor
-{
-
- /**
- * Check if progression is supported.
- *
- * @param target
- * @param source
- * @return true, if we can progress source's value class type to target class
- */
- boolean canProgress(Class<? extends Object> target, Class<? extends Object> source);
-
- /**
- * Do the actual progression.
- *
- * @param target class type
- * @param value to progress
- * @return progressed value - it's class type now equals to target
- * @throws Throwable for any error
- */
- Object doProgression(Class<? extends Object> target, Object value) throws Throwable;
-
-}
Deleted: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -1,75 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.reflect.plugins;
-
-import java.security.PrivilegedExceptionAction;
-import java.security.AccessController;
-
-import org.jboss.reflect.plugins.introspection.ReflectionUtils;
-
-/**
- * Singleton progression instance factory.
- * We can change the progression convertor with system property
- * or setting the convertor class name at the singleton factory instance.
- * This way we can still change the convertor at runtime before actual usage -
- * in MC beans definition or other IoC - via XML.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class ProgressionConvertorFactory
-{
- private static ProgressionConvertorFactory instance = new ProgressionConvertorFactory();
-
- private String convertorClassName = SimpleProgressionConvertor.class.getName();
- private ProgressionConvertor convertor;
-
- public static ProgressionConvertorFactory getInstance()
- {
- return instance;
- }
-
- public ProgressionConvertor getConvertor() throws Throwable
- {
- // TODO - some more config options; by deployment, app, server, cluster, ...
- if (convertor == null)
- {
- ConvertorLookup lookup = new ConvertorLookup();
- String convertorClass = AccessController.doPrivileged(lookup);
- convertor = (ProgressionConvertor) ReflectionUtils.newInstance(convertorClass);
- }
- return convertor;
- }
-
- public void setConvertorClassName(String convertorClassName)
- {
- this.convertorClassName = convertorClassName;
- }
-
- private class ConvertorLookup implements PrivilegedExceptionAction<String>
- {
- public String run() throws Exception
- {
- return System.getProperty("org.jboss.reflect.plugins.progressionConvertor", convertorClassName);
- }
- }
-
-}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/SimpleProgressionConvertor.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/SimpleProgressionConvertor.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/SimpleProgressionConvertor.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -26,6 +26,8 @@
import java.math.BigInteger;
import java.math.BigDecimal;
+import org.jboss.reflect.spi.ProgressionConvertor;
+
/**
* Simple progression code.
* @see javax.management.monitor.GaugeMonitor
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ValueConvertor.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ValueConvertor.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ValueConvertor.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -29,6 +29,8 @@
import org.jboss.logging.Logger;
import org.jboss.reflect.plugins.introspection.ReflectionUtils;
+import org.jboss.reflect.spi.ProgressionConvertor;
+import org.jboss.reflect.spi.ProgressionConvertorFactory;
import org.jboss.util.propertyeditor.PropertyEditors;
/**
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -200,6 +200,11 @@
return delegate.newArrayInstance(size);
}
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ return delegate.isAssignableFrom(info);
+ }
+
public TypeInfo[] getActualTypeArguments()
{
if (typeArguments == ClassInfoImpl.UNKNOWN_TYPES)
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -342,6 +342,15 @@
return (Object[]) Array.newInstance(clazz.getComponentType(), size);
}
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ if (info == null)
+ {
+ throw new NullPointerException("Parameter info cannot be null!");
+ }
+ return getType().isAssignableFrom(info.getType());
+ }
+
public Object convertValue(Object value) throws Throwable
{
return ValueConvertor.convertValue(getType(), value);
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/NumberInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/NumberInfo.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/NumberInfo.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -146,6 +146,23 @@
return values[ordinal];
}
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ if (super.isAssignableFrom(info))
+ {
+ return true;
+ }
+ try
+ {
+ ProgressionConvertor pc = ProgressionConvertorFactory.getInstance().getConvertor();
+ return pc.canProgress(getType(), info.getType());
+ }
+ catch (Throwable throwable)
+ {
+ return false;
+ }
+ }
+
// --- delegate
public ConstructorInfo getDeclaredConstructor(TypeInfo[] parameters)
@@ -267,7 +284,7 @@
{
builder.append(name);
}
-
+
public Object clone()
{
return this;
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/PrimitiveInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/PrimitiveInfo.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/PrimitiveInfo.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -180,6 +180,11 @@
throw new UnsupportedOperationException("Not an array " + name);
}
+ public boolean isAssignableFrom(TypeInfo info)
+ {
+ return (info == this);
+ }
+
public String toString()
{
return name;
Copied: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java (from rev 59628, projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java)
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertor.java 2007-01-14 20:59:42 UTC (rev 59628)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertor.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.reflect.spi;
+
+/**
+ * JBMICROCONT-119 issue
+ * Support integer progression, e.g. float -> int or Float -> Integer and vice versa
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ProgressionConvertor
+{
+
+ /**
+ * Check if progression is supported.
+ *
+ * @param target
+ * @param source
+ * @return true, if we can progress source's value class type to target class
+ */
+ boolean canProgress(Class<? extends Object> target, Class<? extends Object> source);
+
+ /**
+ * Do the actual progression.
+ *
+ * @param target class type
+ * @param value to progress
+ * @return progressed value - it's class type now equals to target
+ * @throws Throwable for any error
+ */
+ Object doProgression(Class<? extends Object> target, Object value) throws Throwable;
+
+}
Copied: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertorFactory.java (from rev 59628, projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java)
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ProgressionConvertorFactory.java 2007-01-14 20:59:42 UTC (rev 59628)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/ProgressionConvertorFactory.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.reflect.spi;
+
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+
+import org.jboss.reflect.plugins.SimpleProgressionConvertor;
+import org.jboss.reflect.plugins.introspection.ReflectionUtils;
+
+/**
+ * Singleton progression instance factory.
+ * We can change the progression convertor with system property
+ * or setting the convertor class name at the singleton factory instance.
+ * This way we can still change the convertor at runtime before actual usage -
+ * in MC beans definition or other IoC - via XML.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ProgressionConvertorFactory
+{
+ private static ProgressionConvertorFactory instance = new ProgressionConvertorFactory();
+
+ private String convertorClassName = SimpleProgressionConvertor.class.getName();
+ private ProgressionConvertor convertor;
+
+ public static ProgressionConvertorFactory getInstance()
+ {
+ return instance;
+ }
+
+ public ProgressionConvertor getConvertor() throws Throwable
+ {
+ // TODO - some more config options; by deployment, app, server, cluster, ...
+ if (convertor == null)
+ {
+ ConvertorLookup lookup = new ConvertorLookup();
+ String convertorClass = AccessController.doPrivileged(lookup);
+ convertor = (ProgressionConvertor) ReflectionUtils.newInstance(convertorClass);
+ }
+ return convertor;
+ }
+
+ public void setConvertorClassName(String convertorClassName)
+ {
+ this.convertorClassName = convertorClassName;
+ }
+
+ private class ConvertorLookup implements PrivilegedExceptionAction<String>
+ {
+ public String run() throws Exception
+ {
+ return System.getProperty("org.jboss.reflect.plugins.progressionConvertor", convertorClassName);
+ }
+ }
+
+}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/TypeInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/TypeInfo.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/spi/TypeInfo.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -92,4 +92,17 @@
* @throws Throwable for any error
*/
Object[] newArrayInstance(int size) throws Throwable;
+
+ /**
+ * Mostly using
+ * @see java.lang.Class#isAssignableFrom
+ * NumberInfo tests for progression
+ *
+ * @param info
+ * @return the boolean value indicating whether objects of the
+ * TypeInfo info can be assigned to objects of this TypeInfo
+ * @exception NullPointerException if the specified TypeInfo parameter is
+ * null.
+ */
+ boolean isAssignableFrom(TypeInfo info);
}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/config/Configurator.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/config/Configurator.java 2007-01-15 20:01:40 UTC (rev 59654)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/config/Configurator.java 2007-01-15 20:42:03 UTC (rev 59655)
@@ -43,15 +43,11 @@
import org.jboss.joinpoint.spi.MethodJoinpoint;
import org.jboss.joinpoint.spi.TargettedJoinpoint;
import org.jboss.kernel.spi.config.KernelConfig;
-import org.jboss.reflect.spi.ConstructorInfo;
-import org.jboss.reflect.spi.MethodInfo;
-import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.reflect.plugins.ProgressionConvertor;
-import org.jboss.reflect.plugins.ProgressionConvertorFactory;
+import org.jboss.reflect.spi.*;
/**
* Configuration utilities.
- *
+ *
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
@@ -59,7 +55,7 @@
{
/**
* Instantiate and configure a bean
- *
+ *
* @param config the confg
* @param info the bean info
* @param metaData the bean metadata
@@ -76,7 +72,7 @@
/**
* Instantiate a bean
- *
+ *
* @param config the kernel config
* @param info the bean info
* @param metaData the bean metadata
@@ -98,7 +94,7 @@
/**
* Get a constructor joinpoint
- *
+ *
* @param config the kernel config
* @param info the bean info
* @param metaData the constructor metadata
@@ -147,7 +143,7 @@
joinPoint.setTarget(factory);
MethodInfo minfo = joinPoint.getMethodInfo();
- // Set the parameters
+ // Set the parameters
if (minfo != null)
{
TypeInfo[] pinfos = minfo.getParameterTypes();
@@ -169,7 +165,7 @@
MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true);
MethodInfo minfo = joinPoint.getMethodInfo();
- // Set the parameters
+ // Set the parameters
if (minfo != null)
{
TypeInfo[] pinfos = minfo.getParameterTypes();
@@ -199,7 +195,7 @@
/**
* Find a constructor
- *
+ *
* @param trace whether trace is enabled
* @param info the bean info
* @param metaData the constructor metadata
@@ -216,7 +212,7 @@
/**
* Resolve a constructor
- *
+ *
* @param trace whether trace is enabled
* @param info the bean info
* @param metaData the constructor metadata
@@ -245,7 +241,7 @@
/**
* Configure a bean
- *
+ *
* @param object the object to configure
* @param info the bean info
* @param metaData the bean metadata
@@ -277,7 +273,7 @@
/**
* Configure a bean property
- *
+ *
* @param object the object to configure
* @param info the bean info
* @param cl the classloader
@@ -308,7 +304,7 @@
/**
* Configure a bean property
- *
+ *
* @param object the object to configure
* @param info the property info
* @param cl the classloader
@@ -383,7 +379,7 @@
/**
* Get the property setters for a bean
- *
+ *
* @param info the bean info
* @param metaData the bean metadata
* @return the property setters
@@ -417,7 +413,7 @@
/**
* Get property setter for an property
- *
+ *
* @param info the bean info
* @param cl the classloader
* @param metaData the property metadata
@@ -448,7 +444,7 @@
/**
* Get property setter for an property
- *
+ *
* @param info the property info
* @param cl the classloader
* @param metaData the property metadata
@@ -510,7 +506,7 @@
/**
* Unconfigure a bean
- *
+ *
* @param object the object to unconfigure
* @param info the bean info
* @param metaData the bean metadata
@@ -539,7 +535,7 @@
/**
* Unconfigure a bean property
- *
+ *
* @param object the object to unconfigure
* @param cl the classloader
* @param info the bean info
@@ -578,7 +574,7 @@
/**
* Get property nuller joinpoints for a bean
- *
+ *
* @param info the bean info
* @param metaData the bean metadata
* @return the join points
@@ -607,7 +603,7 @@
/**
* Get property nuller joinpoint for a property
- *
+ *
* @param info the bean info
* @param metaData the property metadata
* @return the join point
@@ -637,7 +633,7 @@
/**
* Get property nuller joinpoint for a property
- *
+ *
* @param info the property info
* @param metaData the property metadata
* @return the join point
@@ -660,7 +656,7 @@
/**
* Get the property info
- *
+ *
* @param trace whether trace is enabled
* @param info the bean info
* @param name the property name
@@ -697,7 +693,7 @@
// to work properly, use the bean's classloader if there isn't one provided
if (cl == null)
cl = info.getClassInfo().getType().getClassLoader();
-
+
Set<PropertyInfo> properties = info.getProperties();
if (properties != null && properties.size() > 0)
{
@@ -714,13 +710,13 @@
}
}
}
-
+
throw new JoinpointException("Property " + name + " not found for " + info);
}
/**
* Find a method
- *
+ *
* @param info the bean info
* @param cl the classloader
* @param name the method name
@@ -738,7 +734,7 @@
/**
* Find a method
- *
+ *
* @param trace whether trace is enabled
* @param info the bean info
* @param cl the classloader
@@ -761,7 +757,7 @@
JoinpointFactory jpf = info.getJoinpointFactory();
MethodJoinpoint joinPoint = jpf.getMethodJoinpoint(minfo);
- // Set the parameters
+ // Set the parameters
if (minfo != null)
{
TypeInfo[] pinfos = minfo.getParameterTypes();
@@ -774,7 +770,7 @@
/**
* Get the parameters types
- *
+ *
* @param trace whether trace is enabled
* @param parameters the parameter metadata
* @return an array of parameter types
@@ -797,7 +793,7 @@
/**
* Get the parameters types
- *
+ *
* @param trace whether trace is enabled
* @param parameters the parameter types
* @return an array of parameter types
@@ -817,7 +813,7 @@
/**
* Get the parameters
- *
+ *
* @param trace whether trace is enabled
* @param cl the classloader
* @param pinfos the parameter infos
@@ -844,9 +840,9 @@
/**
* Get the classloader for some BeanMetaData
- *
+ *
* @param metaData the metaData
- * @return the classloader
+ * @return the classloader
* @throws Throwable for any error
*/
public static ClassLoader getClassLoader(BeanMetaData metaData) throws Throwable
@@ -859,9 +855,9 @@
/**
* Get the classloader for some ClassLoaderMetaData
- *
+ *
* @param metaData the metaData
- * @return the classloader
+ * @return the classloader
* @throws Throwable for any error
*/
public static ClassLoader getClassLoader(ClassLoaderMetaData metaData) throws Throwable
@@ -886,7 +882,7 @@
/**
* Test whether type names can be assigned to type infos
- *
+ *
* TODO isAssignableFrom should be part of the TypeInfo api
* with comparisons made between TypeInfos
*
@@ -909,7 +905,7 @@
{
if (typeNames[i] != null)
{
- // todo - is there some better way to do this - via Container?
+ // TODO - use typeInfos[i].isAssignableFrom(otherTypeInfo)
Class clazz = Class.forName(typeNames[i], true, cl);
if (typeInfos[i].getType().isAssignableFrom(clazz) == false)
{
More information about the jboss-cvs-commits
mailing list