[jboss-cvs] JBossAS SVN: r70486 - projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 6 10:34:20 EST 2008


Author: adrian at jboss.org
Date: 2008-03-06 10:34:19 -0500 (Thu, 06 Mar 2008)
New Revision: 70486

Modified:
   projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractInstanceClassFactory.java
   projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java
   projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/DeploymentTemplateInfoFactory.java
Log:
Source code tidyup

Modified: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractInstanceClassFactory.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractInstanceClassFactory.java	2008-03-06 15:33:08 UTC (rev 70485)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractInstanceClassFactory.java	2008-03-06 15:34:19 UTC (rev 70486)
@@ -55,6 +55,7 @@
 /**
  * A base InstanceClassFactory implementation that 
  * 
+ * @param <T> the instance type
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
@@ -147,6 +148,9 @@
    /**
     * Default InstanceClassFactory implementation simply returns the
     * instance class. 
+    * 
+    * @param instance the instance
+    * @return the class
     */
    public Class<? extends Serializable> getManagedObjectClass(Object instance)
    {
@@ -197,7 +201,7 @@
          ArrayMetaType arrayType = ArrayMetaType.class.cast(propertyType);
          if (AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE == arrayType.getElementType())
          {
-            Collection cvalue = getAsCollection(value);
+            Collection<?> cvalue = getAsCollection(value);
             ArrayMetaType moType = new ArrayMetaType(1, AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
             ArrayValueSupport moArrayValue = new ArrayValueSupport(moType);
             List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
@@ -216,7 +220,7 @@
          CollectionMetaType collectionType = CollectionMetaType.class.cast(propertyType);
          if (AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE == collectionType.getElementType())
          {
-            Collection cvalue = getAsCollection(value);
+            Collection<?> cvalue = getAsCollection(value);
             List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
             for(Object element : cvalue)
             {
@@ -239,7 +243,7 @@
     * @param beanInfo the bean info
     * @param property the property
     * @param object the object
-    * @param the meta value
+    * @param value the meta value
     */
    public void setValue(BeanInfo beanInfo, ManagedProperty property, T object, MetaValue value)
    {
@@ -262,7 +266,7 @@
     *
     * @param type the type info
     * @return transformer instance
-    * @throws Exception for any error
+    * @throws Throwable for any error
     */
    protected RuntimeComponentNameTransformer getComponentNameTransformer(TypeInfo type) throws Throwable
    {
@@ -299,7 +303,7 @@
       propertyInfo.set(object, unwrapValue);
    }
 
-   protected Collection getAsCollection(Object value)
+   protected Collection<?> getAsCollection(Object value)
    {
       if( value.getClass().isArray() )
          return Arrays.asList(value);

Modified: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java	2008-03-06 15:33:08 UTC (rev 70485)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java	2008-03-06 15:34:19 UTC (rev 70486)
@@ -25,8 +25,6 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.UndeclaredThrowableException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -39,15 +37,14 @@
 
 import org.jboss.beans.info.spi.BeanInfo;
 import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.config.plugins.property.PropertyConfiguration;
 import org.jboss.config.spi.Configuration;
 import org.jboss.logging.Logger;
 import org.jboss.managed.api.Fields;
 import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedOperation;
-import org.jboss.managed.api.ManagedOperation.Impact;
 import org.jboss.managed.api.ManagedParameter;
 import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.ManagedOperation.Impact;
 import org.jboss.managed.api.annotation.AnnotationDefaults;
 import org.jboss.managed.api.annotation.ManagementComponent;
 import org.jboss.managed.api.annotation.ManagementConstants;

Modified: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/DeploymentTemplateInfoFactory.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/DeploymentTemplateInfoFactory.java	2008-03-06 15:33:08 UTC (rev 70485)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/factory/DeploymentTemplateInfoFactory.java	2008-03-06 15:34:19 UTC (rev 70486)
@@ -37,10 +37,7 @@
 import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.api.annotation.ManagementConstants;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementObjectRef;
 import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ManagementRuntimeRef;
 import org.jboss.managed.plugins.BasicDeploymentTemplateInfo;
 import org.jboss.managed.plugins.DefaultFieldsImpl;
 import org.jboss.managed.plugins.WritethroughManagedPropertyImpl;
@@ -166,7 +163,7 @@
             }
          }
       }
-      Class[] parameterTypes = {String.class, String.class, Map.class};
+      Class<?>[] parameterTypes = {String.class, String.class, Map.class};
       Constructor<? extends DeploymentTemplateInfo> ctor = infoClass.getConstructor(parameterTypes);
       DeploymentTemplateInfo info = ctor.newInstance(name, description, infoProps);
       return info;
@@ -180,9 +177,6 @@
       boolean includeProperty = (managementProperty.ignored() == false);
       if (includeProperty)
       {
-         ManagementObjectID id = propertyInfo.getUnderlyingAnnotation(ManagementObjectID.class);
-         ManagementObjectRef ref = propertyInfo.getUnderlyingAnnotation(ManagementObjectRef.class);
-         ManagementRuntimeRef runtimeRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
          HashMap<String, Annotation> propAnnotations = new HashMap<String, Annotation>();
          propAnnotations.put(ManagementProperty.class.getName(), managementProperty);
 
@@ -277,7 +271,7 @@
             ManagedPropertyConstraintsPopulator populator = factory.newInstance();
             if (populator != null)
             {
-               Class clazz = propertyInfo.getBeanInfo().getClassInfo().getType();
+               Class<?> clazz = propertyInfo.getBeanInfo().getClassInfo().getType();
                populator.populateManagedProperty(clazz, propertyInfo, fields);
             }
          }




More information about the jboss-cvs-commits mailing list