mx4j/src/core/javax/management/modelmbean ModelMBeanInfo.java,1.2,1.3 RequiredModelMBean.java,1.15,1.16

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/modelmbean
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/src/core/javax/management/modelmbean

Modified Files:
	ModelMBeanInfo.java RequiredModelMBean.java 
Log Message:
Fixed signature of methods, to be compliant with the reference implementation and the specification

Index: RequiredModelMBean.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/RequiredModelMBean.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** RequiredModelMBean.java	15 Jun 2004 01:56:10 -0000	1.15
--- RequiredModelMBean.java	28 Aug 2004 14:20:02 -0000	1.16
***************
*** 217,230 ****
     }
  
!    public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName) throws RuntimeOperationsException, ListenerNotFoundException
     {
!       try
!       {
!          removeAttributeChangeNotificationListener(listener, attributeName, null);
!       }
!       catch (MBeanException e)
!       {
!          throw new RuntimeOperationsException(new RuntimeException(e.getMessage()));
!       }
     }
  
--- 217,223 ----
     }
  
!    public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName) throws MBeanException, RuntimeOperationsException, ListenerNotFoundException
     {
!       removeAttributeChangeNotificationListener(listener, attributeName, null);
     }
  
***************
*** 600,621 ****
        if (operInfo == null)
        {
!         // Bug #940161 Required ModelMBean methods are not invoked
!       	try 
! 		{
!           	// Look in RMMB public methods
!           	Class[] clzArgs = new Class[params.length];
!           	for (int i=0; i<clzArgs.length; i++)
!           	{
!           		clzArgs[i] = getClass().getClassLoader().loadClass(params[i]);
!           	}
  
!           	// Class.getMethod only returns public methods
! 			Method invocationMethod = getClass().getMethod(method,clzArgs);
! 			operInfo = new ModelMBeanOperationInfo("",invocationMethod);		
! 		} 
!       	catch (Exception e) 
! 		{
!           	throw new MBeanException(new ServiceNotFoundException("Cannot find ModelMBeanOperationInfo for operation " + method));
! 		}
        }
        if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Operation info is: " + operInfo);
--- 593,614 ----
        if (operInfo == null)
        {
!          // Bug #940161 Required ModelMBean methods are not invoked
!          try
!          {
!             // Look in RMMB public methods
!             Class[] clzArgs = new Class[params.length];
!             for (int i = 0; i < clzArgs.length; i++)
!             {
!                clzArgs[i] = getClass().getClassLoader().loadClass(params[i]);
!             }
  
!             // Class.getMethod only returns public methods
!             Method invocationMethod = getClass().getMethod(method, clzArgs);
!             operInfo = new ModelMBeanOperationInfo("", invocationMethod);
!          }
!          catch (Exception e)
!          {
!             throw new MBeanException(new ServiceNotFoundException("Cannot find ModelMBeanOperationInfo for operation " + method));
!          }
        }
        if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Operation info is: " + operInfo);

Index: ModelMBeanInfo.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanInfo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ModelMBeanInfo.java	28 Feb 2002 11:47:35 -0000	1.2
--- ModelMBeanInfo.java	28 Aug 2004 14:20:02 -0000	1.3
***************
*** 9,22 ****
  package javax.management.modelmbean;
  
! import javax.management.RuntimeOperationsException;
! import javax.management.MBeanException;
  import javax.management.MBeanAttributeInfo;
  import javax.management.MBeanConstructorInfo;
  import javax.management.MBeanNotificationInfo;
  import javax.management.MBeanOperationInfo;
! import javax.management.Descriptor;
  
  /**
-  *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
--- 9,21 ----
  package javax.management.modelmbean;
  
! import javax.management.Descriptor;
  import javax.management.MBeanAttributeInfo;
  import javax.management.MBeanConstructorInfo;
+ import javax.management.MBeanException;
  import javax.management.MBeanNotificationInfo;
  import javax.management.MBeanOperationInfo;
! import javax.management.RuntimeOperationsException;
  
  /**
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
***************
*** 24,44 ****
  public interface ModelMBeanInfo extends Cloneable
  {
! 	public Descriptor[] getDescriptors(String descriptorType) throws MBeanException, RuntimeOperationsException;
! 	public void setDescriptors(Descriptor[] descriptors) throws MBeanException, RuntimeOperationsException;
! 	public Descriptor getDescriptor(String descriptorName, String descriptorType) throws MBeanException, RuntimeOperationsException;
! 	public void setDescriptor(Descriptor descriptor, String descriptorType) throws MBeanException, RuntimeOperationsException;
! 	public Descriptor getMBeanDescriptor() throws MBeanException, RuntimeOperationsException;
! 	public void setMBeanDescriptor(Descriptor descriptor) throws MBeanException, RuntimeOperationsException;
! 	public ModelMBeanAttributeInfo getAttribute(String name) throws MBeanException, RuntimeOperationsException;
! 	public ModelMBeanOperationInfo getOperation(String name) throws MBeanException, RuntimeOperationsException;
! 	// The following should be there for symmetry at least
! 	public ModelMBeanConstructorInfo getConstructor(String name) throws MBeanException, RuntimeOperationsException;
! 	public ModelMBeanNotificationInfo getNotification(String name) throws MBeanException, RuntimeOperationsException;
! 	public Object clone();
! 	public String getClassName();
! 	public String getDescription();
! 	public MBeanConstructorInfo[] getConstructors();
! 	public MBeanAttributeInfo[] getAttributes();
! 	public MBeanOperationInfo[] getOperations();
! 	public MBeanNotificationInfo[] getNotifications();
  }
--- 23,59 ----
  public interface ModelMBeanInfo extends Cloneable
  {
!    public Descriptor[] getDescriptors(String descriptorType) throws MBeanException, RuntimeOperationsException;
! 
!    public void setDescriptors(Descriptor[] descriptors) throws MBeanException, RuntimeOperationsException;
! 
!    public Descriptor getDescriptor(String descriptorName, String descriptorType) throws MBeanException, RuntimeOperationsException;
! 
!    public void setDescriptor(Descriptor descriptor, String descriptorType) throws MBeanException, RuntimeOperationsException;
! 
!    public Descriptor getMBeanDescriptor() throws MBeanException, RuntimeOperationsException;
! 
!    public void setMBeanDescriptor(Descriptor descriptor) throws MBeanException, RuntimeOperationsException;
! 
!    public ModelMBeanAttributeInfo getAttribute(String name) throws MBeanException, RuntimeOperationsException;
! 
!    public ModelMBeanOperationInfo getOperation(String name) throws MBeanException, RuntimeOperationsException;
! 
!    // The following method should be there for symmetry at least, but it's not present in the specification
! // public ModelMBeanConstructorInfo getConstructor(String name) throws MBeanException, RuntimeOperationsException;
! 
!    public ModelMBeanNotificationInfo getNotification(String name) throws MBeanException, RuntimeOperationsException;
! 
!    public Object clone();
! 
!    public String getClassName();
! 
!    public String getDescription();
! 
!    public MBeanConstructorInfo[] getConstructors();
! 
!    public MBeanAttributeInfo[] getAttributes();
! 
!    public MBeanOperationInfo[] getOperations();
! 
!    public MBeanNotificationInfo[] getNotifications();
  }



-------------------------------------------------------
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