FileDocCategorySizeDatePackage
MBeanEasyConfigTester.javaAPI DocGlassfish v2 API6263Fri May 04 22:34:08 BST 2007com.sun.enterprise.admin.server.core.mbean.test

MBeanEasyConfigTester

public class MBeanEasyConfigTester extends Object

Fields Summary
Constructors Summary
public MBeanEasyConfigTester()
Creates new MBeanInfoTester

  
Methods Summary
public static voidmain(java.lang.String[] args)

param
args the command line arguments

		new MBeanEasyConfigTester().test();
  
private voidprint(java.lang.String str)

    System.out.println(str);
  
private voidprintInfo(java.lang.Object[] infos)

	  for(int i=0; i<infos.length; i++)
	    if(infos[i] instanceof MBeanAttributeInfo)
        printInfo((MBeanAttributeInfo)infos[i]);   
	    else 
	      if(infos[i] instanceof MBeanConstructorInfo)
	        printInfo((MBeanConstructorInfo)infos[i]);   
	      else 
	        if(infos[i] instanceof MBeanNotificationInfo)
	          printInfo((MBeanNotificationInfo)infos[i]);   
	        else 
	          if(infos[i] instanceof MBeanOperationInfo)
	            printInfo((MBeanOperationInfo)infos[i]);   
	          else 
              if(infos[i] instanceof MBeanParameterInfo)
                printInfo((MBeanParameterInfo)infos[i]);
              else
                print("      "+infos[i]); //notif types?
	
private voidprintInfo(javax.management.MBeanInfo info)

	   print("************** MBeanInfo ******************");
	   print("ClassName="+info.getClassName());
	   print("Description="+info.getDescription());
	   printInfo(info.getAttributes());
	   printInfo(info.getConstructors());
	   printInfo(info.getNotifications());
	   printInfo(info.getOperations());
	
private voidprintInfo(javax.management.MBeanAttributeInfo info)

	  print("   ************** MBeanAttributeInfo ******************");
	  print("   name="+info.getName());
	  print("   description="+info.getDescription());
	  print("   type="+info.getType());
	  print("   isReadable="+info.isReadable());
	  print("   isWritable="+info.isWritable());
	  print("   isIs="+info.isIs());
	
private voidprintInfo(javax.management.MBeanConstructorInfo info)

	  print("   ************** MBeanConstructorInfo ******************");
	  print("   name="+info.getName());
	  print("   description="+info.getDescription());
	  printInfo(info.getSignature());
	
private voidprintInfo(javax.management.MBeanNotificationInfo info)

	  print("   ************** MBeanNotificationInfo ******************");
	  print("   name="+info.getName());
	  print("   description="+info.getDescription());
	  printInfo(info.getNotifTypes());
	
private voidprintInfo(javax.management.MBeanOperationInfo info)

	  print("   ************** MBeanOperationInfo ******************");
	  print("   name="+info.getName());
	  print("   description="+info.getDescription());
	  String str = "???";
	  switch(info.getImpact())
	    {
	      case MBeanOperationInfo.UNKNOWN:
	         str = "UNKNOWN";
	         break;
	      case MBeanOperationInfo.ACTION:
	         str = "ACTION";
	         break;
	      case MBeanOperationInfo.INFO:
	         str = "INFO";
	         break;
	      case MBeanOperationInfo.ACTION_INFO:
	         str = "ACTION_INFO";
	         break;
	    }
	  print("   returnType="+info.getReturnType());
    print("   impact="+str);
	  printInfo(info.getSignature());
	
private voidprintInfo(javax.management.MBeanParameterInfo info)

	  print("      ************** MBeanParameterInfo ******************");
	  print("      name="+info.getName());
	  print("      description="+info.getDescription());
	  print("      type="+info.getType());
	
public voidtest()

		try
		{
			printInfo((new EasyConfigTestMBean()).getMBeanInfo());
		}
		catch(Exception e)
		{
			
			e.printStackTrace();
		}