mx4j/src/core/javax/management MBeanAttributeInfo.java,1.9,1.10 MBeanConstructorInfo.java,1.8,1.9 MBeanFeatureInfo.java,1.5,1.6 MBeanNotificationInfo.java,1.8,1.9 MBeanOperationInfo.java,1.8,1.9 MBeanParameterInfo.java,1.6,1.7 MBeanPermission.java,1.4,1.5 MBeanServerPermission.java,1.9,1.10

Simone Bordet <[email protected]> Sat, 28 Aug 2004 14:20:04 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/javax/management
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/src/core/javax/management

Modified Files:
	MBeanAttributeInfo.java MBeanConstructorInfo.java 
	MBeanFeatureInfo.java MBeanNotificationInfo.java 
	MBeanOperationInfo.java MBeanParameterInfo.java 
	MBeanPermission.java MBeanServerPermission.java 
Log Message:
Fixed signature of methods, to be compliant with the reference implementation and the specification

Index: MBeanConstructorInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanConstructorInfo.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MBeanConstructorInfo.java	3 Aug 2003 10:15:05 -0000	1.8
--- MBeanConstructorInfo.java	28 Aug 2004 14:20:01 -0000	1.9
***************
*** 19,23 ****
   * @version $Revision$
   */
! public class MBeanConstructorInfo extends MBeanFeatureInfo
  {
     private static final long serialVersionUID = 4433990064191844427L;
--- 19,23 ----
   * @version $Revision$
   */
! public class MBeanConstructorInfo extends MBeanFeatureInfo implements Cloneable
  {
     private static final long serialVersionUID = 4433990064191844427L;
***************
*** 30,33 ****
--- 30,34 ----
     /**
      * Creates a new MBeanConstructorInfo
+     *
      * @param description The constructor description
      * @param constructor The constructor
***************
*** 46,52 ****
     /**
      * Creates a new MBeanConstructorInfo
!     * @param name The constructor's name, normally equals to the class name
      * @param description The constructor description
!     * @param signature The constructor signature
      */
     public MBeanConstructorInfo(String name, String description, MBeanParameterInfo[] signature)
--- 47,54 ----
     /**
      * Creates a new MBeanConstructorInfo
!     *
!     * @param name        The constructor's name, normally equals to the class name
      * @param description The constructor description
!     * @param signature   The constructor signature
      */
     public MBeanConstructorInfo(String name, String description, MBeanParameterInfo[] signature)
***************
*** 56,59 ****
--- 58,73 ----
     }
  
+    public Object clone()
+    {
+       try
+       {
+          return super.clone();
+       }
+       catch (CloneNotSupportedException ignored)
+       {
+          return null;
+       }
+    }
+ 
     /**
      * Returns the signature of this MBeanConstructorInfo

Index: MBeanFeatureInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanFeatureInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MBeanFeatureInfo.java	2 Dec 2002 23:57:26 -0000	1.5
--- MBeanFeatureInfo.java	28 Aug 2004 14:20:01 -0000	1.6
***************
*** 17,21 ****
   * @version $Revision$
   */
! public class MBeanFeatureInfo implements Serializable, Cloneable
  {
     private static final long serialVersionUID = 3952882688968447265L;
--- 17,21 ----
   * @version $Revision$
   */
! public class MBeanFeatureInfo implements Serializable
  {
     private static final long serialVersionUID = 3952882688968447265L;
***************
*** 32,36 ****
     /**
      * Creates a new MBean feature metadata object
!     * @param name The name of the feature
      * @param description The description of the feature
      */
--- 32,37 ----
     /**
      * Creates a new MBean feature metadata object
!     *
!     * @param name        The name of the feature
      * @param description The description of the feature
      */
***************
*** 82,97 ****
        return false;
     }
- 
-    public Object clone()
-    {
-       try
-       {
-          return super.clone();
-       }
-       catch (CloneNotSupportedException ignored)
-       {
-          // Never thrown as this class is Cloneable
-          return null;
-       }
-    }
  }
--- 83,85 ----

Index: MBeanOperationInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanOperationInfo.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MBeanOperationInfo.java	3 Aug 2003 10:15:05 -0000	1.8
--- MBeanOperationInfo.java	28 Aug 2004 14:20:01 -0000	1.9
***************
*** 19,23 ****
   * @version $Revision$
   */
! public class MBeanOperationInfo extends MBeanFeatureInfo
  {
     private static final long serialVersionUID = -6178860474881375330L;
--- 19,23 ----
   * @version $Revision$
   */
! public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable
  {
     private static final long serialVersionUID = -6178860474881375330L;
***************
*** 55,60 ****
     /**
      * Creates a new MBeanOperationInfo.
      * @param description The operation description
!     * @param method The method
      */
     public MBeanOperationInfo(String description, Method method)
--- 55,61 ----
     /**
      * Creates a new MBeanOperationInfo.
+     *
      * @param description The operation description
!     * @param method      The method
      */
     public MBeanOperationInfo(String description, Method method)
***************
*** 73,81 ****
     /**
      * Creates a new MBeanOperationInfo
!     * @param name The operation name
      * @param description The operation description
!     * @param signature The operation signature
!     * @param type The operation return type
!     * @param impact The operation impact
      */
     public MBeanOperationInfo(String name, String description, MBeanParameterInfo[] signature, String type, int impact)
--- 74,83 ----
     /**
      * Creates a new MBeanOperationInfo
!     *
!     * @param name        The operation name
      * @param description The operation description
!     * @param signature   The operation signature
!     * @param type        The operation return type
!     * @param impact      The operation impact
      */
     public MBeanOperationInfo(String name, String description, MBeanParameterInfo[] signature, String type, int impact)
***************
*** 87,90 ****
--- 89,104 ----
     }
  
+    public Object clone()
+    {
+       try
+       {
+          return super.clone();
+       }
+       catch (CloneNotSupportedException ignored)
+       {
+          return null;
+       }
+    }
+ 
     /**
      * Returns the return type of the operation

Index: MBeanServerPermission.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanServerPermission.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MBeanServerPermission.java	2 Jan 2003 10:53:29 -0000	1.9
--- MBeanServerPermission.java	28 Aug 2004 14:20:01 -0000	1.10
***************
*** 11,15 ****
--- 11,17 ----
  import java.io.IOException;
  import java.io.ObjectInputStream;
+ import java.security.BasicPermission;
  import java.security.Permission;
+ import java.security.PermissionCollection;
  import java.util.ArrayList;
  import java.util.Collections;
***************
*** 32,39 ****
   * @version $Revision$
   */
! public final class MBeanServerPermission extends Permission
  {
     private static final long serialVersionUID = 0xb16c9a6bd5fae3d2L;
!    
     private transient ArrayList targets;
     private transient boolean wildcard;
--- 34,41 ----
   * @version $Revision$
   */
! public final class MBeanServerPermission extends BasicPermission
  {
     private static final long serialVersionUID = 0xb16c9a6bd5fae3d2L;
! 
     private transient ArrayList targets;
     private transient boolean wildcard;
***************
*** 41,44 ****
--- 43,47 ----
     /**
      * Creates a new MBeanServerPermission with the specified name and no actions
+     *
      * @param name The comma separated list of target names
      */
***************
*** 50,54 ****
     /**
      * Creates a new MBeanServerPermission with the specified name and actions, but the actions will be ignored
!     * @param name The comma separated list of target names
      * @param actions Ignored
      */
--- 53,58 ----
     /**
      * Creates a new MBeanServerPermission with the specified name and actions, but the actions will be ignored
!     *
!     * @param name    The comma separated list of target names
      * @param actions Ignored
      */
***************
*** 147,150 ****
--- 151,159 ----
     }
  
+    public PermissionCollection newPermissionCollection()
+    {
+       return null;
+    }
+ 
     private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
     {

Index: MBeanNotificationInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanNotificationInfo.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MBeanNotificationInfo.java	3 Aug 2003 10:15:05 -0000	1.8
--- MBeanNotificationInfo.java	28 Aug 2004 14:20:01 -0000	1.9
***************
*** 10,14 ****
  
  import mx4j.util.Utils;
- import mx4j.server.MBeanIntrospector;
  
  /**
--- 10,13 ----
***************
*** 18,22 ****
   * @version $Revision$
   */
! public class MBeanNotificationInfo extends MBeanFeatureInfo
  {
     private static final long serialVersionUID = -3888371564530107064L;
--- 17,21 ----
   * @version $Revision$
   */
! public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable
  {
     private static final long serialVersionUID = -3888371564530107064L;
***************
*** 29,34 ****
     /**
      * Creates a new MBeanNotificationInfo
!     * @param notifsType The types
!     * @param name The classname of the Notifications emitted
      * @param description The description for these notifications
      */
--- 28,34 ----
     /**
      * Creates a new MBeanNotificationInfo
!     *
!     * @param notifsType  The types
!     * @param name        The classname of the Notifications emitted
      * @param description The description for these notifications
      */
***************
*** 39,42 ****
--- 39,54 ----
     }
  
+    public Object clone()
+    {
+       try
+       {
+          return super.clone();
+       }
+       catch (CloneNotSupportedException ignored)
+       {
+          return null;
+       }
+    }
+ 
     /**
      * Returns the types of the notifications emitted.

Index: MBeanParameterInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanParameterInfo.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MBeanParameterInfo.java	3 Aug 2003 10:15:05 -0000	1.6
--- MBeanParameterInfo.java	28 Aug 2004 14:20:01 -0000	1.7
***************
*** 15,19 ****
   * @version $Revision$
   */
! public class MBeanParameterInfo extends MBeanFeatureInfo
  {
     private static final long serialVersionUID = 7432616882776782338L;
--- 15,19 ----
   * @version $Revision$
   */
! public class MBeanParameterInfo extends MBeanFeatureInfo implements Cloneable
  {
     private static final long serialVersionUID = 7432616882776782338L;
***************
*** 26,31 ****
     /**
      * Creates a new MBeanParameterInfo
!     * @param name The parameter name
!     * @param type The parameter type
      * @param description The parameter description
      */
--- 26,32 ----
     /**
      * Creates a new MBeanParameterInfo
!     *
!     * @param name        The parameter name
!     * @param type        The parameter type
      * @param description The parameter description
      */
***************
*** 36,41 ****
--- 37,55 ----
     }
  
+    public Object clone()
+    {
+       try
+       {
+          return super.clone();
+       }
+       catch (CloneNotSupportedException ignored)
+       {
+          return null;
+       }
+    }
+ 
     /**
      * Returns the parameter type
+     *
      * @return
      */

Index: MBeanAttributeInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanAttributeInfo.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MBeanAttributeInfo.java	22 Oct 2003 00:50:49 -0000	1.9
--- MBeanAttributeInfo.java	28 Aug 2004 14:20:01 -0000	1.10
***************
*** 14,23 ****
  
  /**
-  * Metadata class for an MBean attribute.
-  *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
   */
! public class MBeanAttributeInfo extends MBeanFeatureInfo
  {
     private static final long serialVersionUID = 8644704819898565848L;
--- 14,21 ----
  
  /**
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
   */
! public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable
  {
     private static final long serialVersionUID = 8644704819898565848L;
***************
*** 42,49 ****
     /**
      * Creates a new MBeanAttributeInfo
!     * @param name The attribute name
      * @param description The attribute description
!     * @param getter The getter method, or null if write only
!     * @param setter The setter method, or null if read only
      * @throws IntrospectionException If the introspection of the attribute fails
      */
--- 40,48 ----
     /**
      * Creates a new MBeanAttributeInfo
!     *
!     * @param name        The attribute name
      * @param description The attribute description
!     * @param getter      The getter method, or null if write only
!     * @param setter      The setter method, or null if read only
      * @throws IntrospectionException If the introspection of the attribute fails
      */
***************
*** 52,58 ****
        super(name, description);
  
! 	  String getterType = null;
! 	  String setterType = null;
! 	  
        if (getter != null)
        {
--- 51,57 ----
        super(name, description);
  
!       String getterType = null;
!       String setterType = null;
! 
        if (getter != null)
        {
***************
*** 77,90 ****
        }
  
! 	  this.attributeType = reconcileAttributeType(getterType, setterType);
     }
  
     /**
      * Creates a new MBeanAttributeInfo
!     * @param name The attribute name
      * @param description The attribute description
!     * @param isReadable The attribute's readability
!     * @param isWritable The attribute's writability
!     * @param isIs The flag if the attribute's type is boolean
      */
     public MBeanAttributeInfo(String name, String className, String description, boolean isReadable, boolean isWritable, boolean isIs)
--- 76,90 ----
        }
  
!       this.attributeType = reconcileAttributeType(getterType, setterType);
     }
  
     /**
      * Creates a new MBeanAttributeInfo
!     *
!     * @param name        The attribute name
      * @param description The attribute description
!     * @param isReadable  The attribute's readability
!     * @param isWritable  The attribute's writability
!     * @param isIs        The flag if the attribute's type is boolean
      */
     public MBeanAttributeInfo(String name, String className, String description, boolean isReadable, boolean isWritable, boolean isIs)
***************
*** 98,101 ****
--- 98,113 ----
     }
  
+    public Object clone()
+    {
+       try
+       {
+          return super.clone();
+       }
+       catch (CloneNotSupportedException ignored)
+       {
+          return null;
+       }
+    }
+ 
     public String getType()
     {
***************
*** 158,186 ****
  
     private String reconcileAttributeType(String getterType, String setterType)
! 	   throws IntrospectionException
     {
! 	   String result = null;	// only unchanged if getterType == null && setterType == null
  
! 	   if (getterType == null && setterType != null)
! 	   {
! 		   result = setterType;
! 	   }
! 	   else if (getterType != null && setterType == null)
! 	   {
! 		   result = getterType;
! 	   }
! 	   else if (getterType != null && setterType != null)
! 	   {
! 		   if (getterType.compareToIgnoreCase(setterType) == 0)
! 		   {
! 			   result = getterType;
! 		   }
! 		   else
! 		   {
! 			   throw new IntrospectionException("Attribute setter/getter types don't match");
! 		   }
! 	   }
  
! 	   return result;
     }
  }
--- 170,198 ----
  
     private String reconcileAttributeType(String getterType, String setterType)
!            throws IntrospectionException
     {
!       String result = null; // only unchanged if getterType == null && setterType == null
  
!       if (getterType == null && setterType != null)
!       {
!          result = setterType;
!       }
!       else if (getterType != null && setterType == null)
!       {
!          result = getterType;
!       }
!       else if (getterType != null && setterType != null)
!       {
!          if (getterType.compareToIgnoreCase(setterType) == 0)
!          {
!             result = getterType;
!          }
!          else
!          {
!             throw new IntrospectionException("Attribute setter/getter types don't match");
!          }
!       }
  
!       return result;
     }
  }

Index: MBeanPermission.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanPermission.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MBeanPermission.java	21 Feb 2004 21:28:00 -0000	1.4
--- MBeanPermission.java	28 Aug 2004 14:20:01 -0000	1.5
***************
*** 64,78 ****
  
     /**
-     * Creates a new MBeanPermission, but it is never used; here only for signature compliance.
-     * @param name The target name
-     */
-    public MBeanPermission(String name)
-    {
-       this(name, null);
-    }
- 
-    /**
      * Creates a new MBeanPermission
!     * @param name The target name
      * @param actions The comma separated list of actions
      */
--- 64,70 ----
  
     /**
      * Creates a new MBeanPermission
!     *
!     * @param name    The target name
      * @param actions The comma separated list of actions
      */
***************
*** 88,95 ****
      * Creates a new MBeanPermission. If the parts composing the target name are all specified as null,
      * the wildcard target name '*' is assumed.
!     * @param className The className part of the target name, may be null
      * @param memberName The memberName part of the target name, may be null
      * @param objectName The ObjectName part of the target name, may be null
!     * @param actions The comma separated list of actions
      */
     public MBeanPermission(String className, String memberName, ObjectName objectName, String actions)
--- 80,88 ----
      * Creates a new MBeanPermission. If the parts composing the target name are all specified as null,
      * the wildcard target name '*' is assumed.
!     *
!     * @param className  The className part of the target name, may be null
      * @param memberName The memberName part of the target name, may be null
      * @param objectName The ObjectName part of the target name, may be null
!     * @param actions    The comma separated list of actions
      */
     public MBeanPermission(String className, String memberName, ObjectName objectName, String actions)



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click