commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler AttributeInfo.java ConstructorInfo.java FeatureInfo.java NotificationInfo.java OperationInfo.java ParameterInfo.java ManagedBean.java
Date Tue, 07 Jan 2003 06:39:36 GMT
costin      2003/01/06 22:39:36

  Modified:    modeler/src/java/org/apache/commons/modeler
                        AttributeInfo.java ConstructorInfo.java
                        FeatureInfo.java NotificationInfo.java
                        OperationInfo.java ParameterInfo.java
                        ManagedBean.java
  Log:
  Added Serializable.
  
  Regroup fields at the beggining of the class.
  
  Computed info is transient ( we serialize only the data that is needed )
  
  Revision  Changes    Path
  1.3       +19 -25    jakarta-commons/modeler/src/java/org/apache/commons/modeler/AttributeInfo.java
  
  Index: AttributeInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/AttributeInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AttributeInfo.java	13 Nov 2002 06:25:32 -0000	1.2
  +++ AttributeInfo.java	7 Jan 2003 06:39:36 -0000	1.3
  @@ -68,6 +68,7 @@
   import javax.management.Descriptor;
   import javax.management.modelmbean.ModelMBeanAttributeInfo;
   import java.lang.reflect.Method;
  +import java.io.Serializable;
   
   
   /**
  @@ -78,7 +79,7 @@
    * @version $Revision$ $Date$
    */
   
  -public class AttributeInfo extends FeatureInfo {
  +public class AttributeInfo extends FeatureInfo implements Serializable {
   
   
       // ----------------------------------------------------- Instance Variables
  @@ -88,9 +89,21 @@
        * The <code>ModelMBeanAttributeInfo</code> object that corresponds
        * to this <code>AttributeInfo</code> instance.
        */
  -    ModelMBeanAttributeInfo info = null;
  +    protected transient ModelMBeanAttributeInfo info = null;
  +    protected String displayName = null;
  +    protected String getMethod = null;
  +    protected String setMethod = null;
   
  +    protected transient Method getMethodObj = null;
  +    protected transient Method setMethodObj = null;
   
  +    protected boolean readable = true;
  +    protected boolean writeable = true;
  +
  +    protected boolean is = false;
  +    protected String type = null;
  +
  +    protected String persist;
       // ------------------------------------------------------------- Properties
   
   
  @@ -104,7 +117,6 @@
           this.info = null;
       }
   
  -
       /**
        * Override the <code>name</code> property setter.
        *
  @@ -115,12 +127,9 @@
           this.info = null;
       }
   
  -
       /**
        * The display name of this attribute.
        */
  -    protected String displayName = null;
  -
       public String getDisplayName() {
           return (this.displayName);
       }
  @@ -129,14 +138,9 @@
           this.displayName = displayName;
       }
   
  -
       /**
        * The name of the property getter method, if non-standard.
        */
  -    protected String getMethod = null;
  -    protected Method getMethodObj = null;
  -    protected Method setMethodObj = null;
  -
       public String getGetMethod() {
           return (this.getMethod);
       }
  @@ -165,8 +169,6 @@
       /**
        * Is this a boolean attribute with an "is" getter?
        */
  -    protected boolean is = false;
  -
       public boolean isIs() {
           return (this.is);
       }
  @@ -180,8 +182,6 @@
       /**
        * Is this attribute readable by management applications?
        */
  -    protected boolean readable = true;
  -
       public boolean isReadable() {
           return (this.readable);
       }
  @@ -195,8 +195,6 @@
       /**
        * The name of the property setter method, if non-standard.
        */
  -    protected String setMethod = null;
  -
       public String getSetMethod() {
           return (this.setMethod);
       }
  @@ -210,8 +208,6 @@
       /**
        * The fully qualified Java class name of this attribute.
        */
  -    protected String type = null;
  -
       public String getType() {
           return (this.type);
       }
  @@ -225,8 +221,6 @@
       /**
        * Is this attribute writeable by management applications?
        */
  -    protected boolean writeable = true;
  -
       public boolean isWriteable() {
           return (this.writeable);
       }
  
  
  
  1.2       +9 -10     jakarta-commons/modeler/src/java/org/apache/commons/modeler/ConstructorInfo.java
  
  Index: ConstructorInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ConstructorInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConstructorInfo.java	30 Apr 2002 20:58:51 -0000	1.1
  +++ ConstructorInfo.java	7 Jan 2003 06:39:36 -0000	1.2
  @@ -68,6 +68,7 @@
   import javax.management.Descriptor;
   import javax.management.MBeanParameterInfo;
   import javax.management.modelmbean.ModelMBeanConstructorInfo;
  +import java.io.Serializable;
   
   
   /**
  @@ -78,7 +79,7 @@
    * @version $Revision$ $Date$
    */
   
  -public class ConstructorInfo extends FeatureInfo {
  +public class ConstructorInfo extends FeatureInfo implements Serializable {
   
   
       // ----------------------------------------------------- Instance Variables
  @@ -88,7 +89,9 @@
        * The <code>ModelMBeanConstructorInfo</code> object that corresponds
        * to this <code>ConstructorInfo</code> instance.
        */
  -    ModelMBeanConstructorInfo info = null;
  +    transient ModelMBeanConstructorInfo info = null;
  +    protected String displayName = null;
  +    protected ParameterInfo parameters[] = new ParameterInfo[0];
   
   
       // ------------------------------------------------------------- Properties
  @@ -119,8 +122,6 @@
       /**
        * The display name of this attribute.
        */
  -    protected String displayName = null;
  -
       public String getDisplayName() {
           return (this.displayName);
       }
  @@ -133,8 +134,6 @@
       /**
        * The set of parameters for this constructor.
        */
  -    protected ParameterInfo parameters[] = new ParameterInfo[0];
  -
       public ParameterInfo[] getSignature() {
           return (this.parameters);
       }
  
  
  
  1.2       +9 -9      jakarta-commons/modeler/src/java/org/apache/commons/modeler/FeatureInfo.java
  
  Index: FeatureInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/FeatureInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FeatureInfo.java	30 Apr 2002 20:58:51 -0000	1.1
  +++ FeatureInfo.java	7 Jan 2003 06:39:36 -0000	1.2
  @@ -64,6 +64,8 @@
   
   package org.apache.commons.modeler;
   
  +import java.io.Serializable;
  +
   
   /**
    * <p>Convenience base class for <code>AttributeInfo</code>,
  @@ -75,8 +77,10 @@
    * @version $Revision$ $Date$
    */
   
  -public class FeatureInfo {
  +public class FeatureInfo implements Serializable {
   
  +    protected String description = null;
  +    protected String name = null;
   
       // ------------------------------------------------------------- Properties
   
  @@ -84,8 +88,6 @@
       /**
        * The human-readable description of this feature.
        */
  -    protected String description = null;
  -
       public String getDescription() {
           return (this.description);
       }
  @@ -99,8 +101,6 @@
        * The name of this feature, which must be unique among features in the
        * same collection.
        */
  -    protected String name = null;
  -
       public String getName() {
           return (this.name);
       }
  
  
  
  1.2       +8 -9      jakarta-commons/modeler/src/java/org/apache/commons/modeler/NotificationInfo.java
  
  Index: NotificationInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/NotificationInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NotificationInfo.java	30 Apr 2002 20:58:51 -0000	1.1
  +++ NotificationInfo.java	7 Jan 2003 06:39:36 -0000	1.2
  @@ -66,6 +66,7 @@
   
   
   import javax.management.modelmbean.ModelMBeanNotificationInfo;
  +import java.io.Serializable;
   
   
   /**
  @@ -76,7 +77,7 @@
    * @version $Revision$ $Date$
    */
   
  -public class NotificationInfo extends FeatureInfo {
  +public class NotificationInfo extends FeatureInfo implements Serializable {
   
   
       // ----------------------------------------------------- Instance Variables
  @@ -86,8 +87,8 @@
        * The <code>ModelMBeanNotificationInfo</code> object that corresponds
        * to this <code>NotificationInfo</code> instance.
        */
  -    ModelMBeanNotificationInfo info = null;
  -
  +    transient ModelMBeanNotificationInfo info = null;
  +    protected String notifTypes[] = new String[0];
   
       // ------------------------------------------------------------- Properties
   
  @@ -117,8 +118,6 @@
       /**
        * The set of notification types for this MBean.
        */
  -    protected String notifTypes[] = new String[0];
  -
       public String[] getNotifTypes() {
           return (this.notifTypes);
       }
  
  
  
  1.3       +11 -23    jakarta-commons/modeler/src/java/org/apache/commons/modeler/OperationInfo.java
  
  Index: OperationInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/OperationInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OperationInfo.java	26 Dec 2002 18:22:19 -0000	1.2
  +++ OperationInfo.java	7 Jan 2003 06:39:36 -0000	1.3
  @@ -71,6 +71,7 @@
   import javax.management.Descriptor;
   import javax.management.MBeanParameterInfo;
   import javax.management.modelmbean.ModelMBeanOperationInfo;
  +import java.io.Serializable;
   
   
   /**
  @@ -81,10 +82,7 @@
    * @version $Revision$ $Date$
    */
   
  -public class OperationInfo extends FeatureInfo {
  -    private static Log log = LogFactory.getLog(OperationInfo.class);
  -
  -
  +public class OperationInfo extends FeatureInfo implements Serializable {
   
       // ----------------------------------------------------------- Constructors
   
  @@ -136,7 +134,11 @@
        * The <code>ModelMBeanOperationInfo</code> object that corresponds
        * to this <code>OperationInfo</code> instance.
        */
  -    ModelMBeanOperationInfo info = null;
  +    transient ModelMBeanOperationInfo info = null;
  +    protected String impact = "UNKNOWN";
  +    protected String role = "operation";
  +    protected String returnType = "void";    // FIXME - Validate
  +    protected ParameterInfo parameters[] = new ParameterInfo[0];
   
   
       // ------------------------------------------------------------- Properties
  @@ -168,8 +170,6 @@
        * The "impact" of this operation, which should be a (case-insensitive)
        * string value "ACTION", "ACTION_INFO", "INFO", or "UNKNOWN".
        */
  -    protected String impact = "UNKNOWN";
  -
       public String getImpact() {
           return (this.impact);
       }
  @@ -186,8 +186,6 @@
        * The role of this operation ("getter", "setter", "operation", or
        * "constructor").
        */
  -    protected String role = "operation";
  -
       public String getRole() {
           return (this.role);
       }
  @@ -201,8 +199,6 @@
        * The fully qualified Java class name of the return type for this
        * operation.
        */
  -    protected String returnType = "void";    // FIXME - Validate
  -
       public String getReturnType() {
           return (this.returnType);
       }
  @@ -211,17 +207,13 @@
           this.returnType = returnType;
       }
   
  -
       /**
        * The set of parameters for this operation.
        */
  -    protected ParameterInfo parameters[] = new ParameterInfo[0];
  -
       public ParameterInfo[] getSignature() {
           return (this.parameters);
       }
   
  -
       // --------------------------------------------------------- Public Methods
   
   
  @@ -266,10 +258,6 @@
               impact = ModelMBeanOperationInfo.ACTION_INFO;
           else if ("INFO".equals(getImpact()))
               impact = ModelMBeanOperationInfo.INFO;
  -
  -        if( log.isTraceEnabled())
  -            log.trace("createOperationInfo " + getName() + " " + getReturnType() + " "
+
  -                        getDescription());
   
           info = new ModelMBeanOperationInfo
               (getName(), getDescription(), parameters,
  
  
  
  1.3       +8 -18     jakarta-commons/modeler/src/java/org/apache/commons/modeler/ParameterInfo.java
  
  Index: ParameterInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ParameterInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParameterInfo.java	26 Dec 2002 18:22:19 -0000	1.2
  +++ ParameterInfo.java	7 Jan 2003 06:39:36 -0000	1.3
  @@ -69,6 +69,7 @@
   import org.apache.commons.logging.LogFactory;
   
   import javax.management.MBeanParameterInfo;
  +import java.io.Serializable;
   
   
   /**
  @@ -79,11 +80,7 @@
    * @version $Revision$ $Date$
    */
   
  -public class ParameterInfo extends FeatureInfo {
  -    private static Log log = LogFactory.getLog(ParameterInfo.class);
  -
  -
  -
  +public class ParameterInfo extends FeatureInfo implements Serializable {
       // ----------------------------------------------------------- Constructors
   
   
  @@ -121,8 +118,8 @@
        * The <code>MBeanParameterInfo</code> object that corresponds
        * to this <code>ParameterInfo</code> instance.
        */
  -    MBeanParameterInfo info = null;
  -
  +    transient MBeanParameterInfo info = null;
  +    protected String type = null;
   
       // ------------------------------------------------------------- Properties
   
  @@ -152,8 +149,6 @@
       /**
        * The fully qualified Java class name of this parameter.
        */
  -    protected String type = null;
  -
       public String getType() {
           return (this.type);
       }
  @@ -177,9 +172,6 @@
           if (info != null)
               return (info);
   
  -        if( log.isTraceEnabled())
  -            log.trace("createParameterInfo " + getName() + " " + getType() + " " +
  -                    getDescription());
           // Create and return a new information object
           info = new MBeanParameterInfo
               (getName(), getType(), getDescription());
  @@ -204,6 +196,4 @@
           return (sb.toString());
   
       }
  -
  -
   }
  
  
  
  1.4       +16 -26    jakarta-commons/modeler/src/java/org/apache/commons/modeler/ManagedBean.java
  
  Index: ManagedBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ManagedBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ManagedBean.java	26 Dec 2002 18:22:19 -0000	1.3
  +++ ManagedBean.java	7 Jan 2003 06:39:36 -0000	1.4
  @@ -94,8 +94,19 @@
        * The <code>ModelMBeanInfo</code> object that corresponds
        * to this <code>ManagedBean</code> instance.
        */
  -    ModelMBeanInfo info = null;
  +    transient ModelMBeanInfo info = null;
  +    protected AttributeInfo attributes[] = new AttributeInfo[0];
  +    protected String className =
  +            "org.apache.commons.modeler.BaseModelMBean";
  +    protected ConstructorInfo constructors[] = new ConstructorInfo[0];
  +    protected String description = null;
  +    protected String domain = null;
  +    protected String group = null;
  +    protected String name = null;
   
  +    protected NotificationInfo notifications[] = new NotificationInfo[0];
  +    protected OperationInfo operations[] = new OperationInfo[0];
  +    protected String type = null;
   
       // ------------------------------------------------------------- Properties
   
  @@ -103,8 +114,6 @@
       /**
        * The collection of attributes for this MBean.
        */
  -    protected AttributeInfo attributes[] = new AttributeInfo[0];
  -
       public AttributeInfo[] getAttributes() {
           return (this.attributes);
       }
  @@ -116,9 +125,6 @@
        * class (<code>javax.management.modelmbean.RequiredModeLMBean</code>)
        * will be utilized.
        */
  -    protected String className =
  -        //        "javax.management.modelmbean.RequiredModelMBean";
  -        "org.apache.commons.modeler.BaseModelMBean";
       public String getClassName() {
           return (this.className);
       }
  @@ -132,8 +138,6 @@
       /**
        * The collection of constructors for this MBean.
        */
  -    protected ConstructorInfo constructors[] = new ConstructorInfo[0];
  -
       public ConstructorInfo[] getConstructors() {
           return (this.constructors);
       }
  @@ -142,8 +146,6 @@
       /**
        * The human-readable description of this MBean.
        */
  -    protected String description = null;
  -
       public String getDescription() {
           return (this.description);
       }
  @@ -158,8 +160,6 @@
        * The (optional) <code>ObjectName</code> domain in which this MBean
        * should be registered in the MBeanServer.
        */
  -    protected String domain = null;
  -
       public String getDomain() {
           return (this.domain);
       }
  @@ -172,8 +172,6 @@
       /**
        * The (optional) group to which this MBean belongs.
        */
  -    protected String group = null;
  -
       public String getGroup() {
           return (this.group);
       }
  @@ -187,8 +185,6 @@
        * The name of this managed bean, which must be unique among all
        * MBeans managed by a particular MBeans server.
        */
  -    protected String name = null;
  -
       public String getName() {
           return (this.name);
       }
  @@ -202,8 +198,6 @@
       /**
        * The collection of notifications for this MBean.
        */
  -    protected NotificationInfo notifications[] = new NotificationInfo[0];
  -
       public NotificationInfo[] getNotifications() {
           return (this.notifications);
       }
  @@ -212,8 +206,6 @@
       /**
        * The collection of operations for this MBean.
        */
  -    protected OperationInfo operations[] = new OperationInfo[0];
  -
       public OperationInfo[] getOperations() {
           return (this.operations);
       }
  @@ -224,8 +216,6 @@
        * implementation class described by the managed bean described
        * by this descriptor.
        */
  -    protected String type = null;
  -
       public String getType() {
           return (this.type);
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message