mx4j/src/core/javax/management/modelmbean ModelMBeanAttributeInfo.java,1.12,1.13 ModelMBeanConstructorInfo.java,1.11,1.12 ModelMBeanInfoSupport.java,1.14,1.15 ModelMBeanNotificationInfo.java,1.9,1.10 ModelMBeanOperationInfo.java,1.8,1.9
Simone Bordet <[email protected]> Tue, 05 Oct 2004 14:46:49 +0000
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17000/src/core/javax/management/modelmbean
Modified Files:
ModelMBeanAttributeInfo.java ModelMBeanConstructorInfo.java
ModelMBeanInfoSupport.java ModelMBeanNotificationInfo.java
ModelMBeanOperationInfo.java
Log Message:
Fix for bug #1031965: cloning of MMB metadata was not properly implemented
Index: ModelMBeanNotificationInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanNotificationInfo.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ModelMBeanNotificationInfo.java 7 Sep 2004 12:44:17 -0000 1.9
--- ModelMBeanNotificationInfo.java 5 Oct 2004 14:46:47 -0000 1.10
***************
*** 45,48 ****
--- 45,53 ----
}
+ public Object clone()
+ {
+ return new ModelMBeanNotificationInfo(this);
+ }
+
public Descriptor getDescriptor()
{
Index: ModelMBeanOperationInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanOperationInfo.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ModelMBeanOperationInfo.java 4 Sep 2004 15:44:04 -0000 1.8
--- ModelMBeanOperationInfo.java 5 Oct 2004 14:46:47 -0000 1.9
***************
*** 56,59 ****
--- 56,64 ----
}
+ public Object clone()
+ {
+ return new ModelMBeanOperationInfo(this);
+ }
+
public Descriptor getDescriptor()
{
Index: ModelMBeanConstructorInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanConstructorInfo.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ModelMBeanConstructorInfo.java 7 Sep 2004 12:44:17 -0000 1.11
--- ModelMBeanConstructorInfo.java 5 Oct 2004 14:46:47 -0000 1.12
***************
*** 52,55 ****
--- 52,66 ----
}
+ ModelMBeanConstructorInfo(ModelMBeanConstructorInfo copy)
+ {
+ super(copy.getName(), copy.getDescription(), copy.getSignature());
+ checkAndSetDescriptor(copy.getDescriptor());
+ }
+
+ public Object clone()
+ {
+ return new ModelMBeanConstructorInfo(this);
+ }
+
public Descriptor getDescriptor()
{
***************
*** 73,77 ****
// Not sure what to do here: javadoc says IllegalArgument, but for example ModelMBeanInfo throws RuntimeOperations
// which is consistent with the fact that all exception thrown by the JMX implementation should be JMX exceptions
- // throw new IllegalArgumentException("Invalid descriptor");
throw new RuntimeOperationsException(new IllegalArgumentException("Invalid descriptor"));
}
--- 84,87 ----
***************
*** 111,115 ****
List names = Arrays.asList(descriptor.getFieldNames());
! // Remember that names are lower case
if (!names.contains("name") ||
!names.contains("descriptortype") ||
--- 121,125 ----
List names = Arrays.asList(descriptor.getFieldNames());
! // Remember that names are lower case
if (!names.contains("name") ||
!names.contains("descriptortype") ||
Index: ModelMBeanAttributeInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanAttributeInfo.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ModelMBeanAttributeInfo.java 7 Sep 2004 12:44:16 -0000 1.12
--- ModelMBeanAttributeInfo.java 5 Oct 2004 14:46:47 -0000 1.13
***************
*** 58,61 ****
--- 58,66 ----
}
+ public Object clone()
+ {
+ return new ModelMBeanAttributeInfo(this);
+ }
+
public Descriptor getDescriptor()
{
***************
*** 80,84 ****
// which is consistent with the fact that all exception thrown by the JMX implementation should be JMX exceptions
throw new RuntimeOperationsException(new IllegalArgumentException("Invalid descriptor"));
- // throw new IllegalArgumentException("Invalid descriptor");
}
}
--- 85,88 ----
Index: ModelMBeanInfoSupport.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanInfoSupport.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ModelMBeanInfoSupport.java 7 Sep 2004 15:17:01 -0000 1.14
--- ModelMBeanInfoSupport.java 5 Oct 2004 14:46:47 -0000 1.15
***************
*** 67,71 ****
for (int i = 0; i < attributes.length; i++)
{
! modelMBeanAttributes[i] = new ModelMBeanAttributeInfo(attributes[i].getName(), attributes[i].getType(), attributes[i].getDescription(), attributes[i].isReadable(), attributes[i].isWritable(), attributes[i].isIs());
}
}
--- 67,75 ----
for (int i = 0; i < attributes.length; i++)
{
! MBeanAttributeInfo attribute = attributes[i];
! if (attribute instanceof ModelMBeanAttributeInfo)
! modelMBeanAttributes[i] = new ModelMBeanAttributeInfo((ModelMBeanAttributeInfo)attribute);
! else
! modelMBeanAttributes[i] = new ModelMBeanAttributeInfo(attribute.getName(), attribute.getType(), attribute.getDescription(), attribute.isReadable(), attribute.isWritable(), attribute.isIs());
}
}
***************
*** 77,81 ****
for (int i = 0; i < constructors.length; i++)
{
! modelMBeanConstructors[i] = new ModelMBeanConstructorInfo(constructors[i].getName(), constructors[i].getDescription(), constructors[i].getSignature());
}
}
--- 81,89 ----
for (int i = 0; i < constructors.length; i++)
{
! MBeanConstructorInfo constructor = constructors[i];
! if (constructor instanceof ModelMBeanConstructorInfo)
! modelMBeanConstructors[i] = new ModelMBeanConstructorInfo((ModelMBeanConstructorInfo)constructor);
! else
! modelMBeanConstructors[i] = new ModelMBeanConstructorInfo(constructor.getName(), constructor.getDescription(), constructor.getSignature());
}
}
***************
*** 87,91 ****
for (int i = 0; i < operations.length; i++)
{
! modelMBeanOperations[i] = new ModelMBeanOperationInfo(operations[i].getName(), operations[i].getDescription(), operations[i].getSignature(), operations[i].getReturnType(), operations[i].getImpact());
}
}
--- 95,103 ----
for (int i = 0; i < operations.length; i++)
{
! MBeanOperationInfo operation = operations[i];
! if (operation instanceof ModelMBeanOperationInfo)
! modelMBeanOperations[i] = new ModelMBeanOperationInfo((ModelMBeanOperationInfo)operation);
! else
! modelMBeanOperations[i] = new ModelMBeanOperationInfo(operation.getName(), operation.getDescription(), operation.getSignature(), operation.getReturnType(), operation.getImpact());
}
}
***************
*** 97,101 ****
for (int i = 0; i < notifications.length; i++)
{
! modelMBeanNotifications[i] = new ModelMBeanNotificationInfo(notifications[i].getNotifTypes(), notifications[i].getName(), notifications[i].getDescription());
}
}
--- 109,117 ----
for (int i = 0; i < notifications.length; i++)
{
! MBeanNotificationInfo notification = notifications[i];
! if (notification instanceof ModelMBeanNotificationInfo)
! modelMBeanNotifications[i] = new ModelMBeanNotificationInfo((ModelMBeanNotificationInfo)notification);
! else
! modelMBeanNotifications[i] = new ModelMBeanNotificationInfo(notification.getNotifTypes(), notification.getName(), notification.getDescription());
}
}
***************
*** 112,115 ****
--- 128,136 ----
}
+ public Object clone()
+ {
+ return new ModelMBeanInfoSupport(this);
+ }
+
public Descriptor[] getDescriptors(String type) throws MBeanException, RuntimeOperationsException
{
***************
*** 590,600 ****
}
- public Object clone()
- {
- ModelMBeanInfoSupport info = (ModelMBeanInfoSupport)super.clone();
- info.modelMBeanDescriptor = (Descriptor)modelMBeanDescriptor.clone();
- return info;
- }
-
private void checkAndSetDescriptor(Descriptor descriptor)
{
--- 611,614 ----
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl