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

GenericConfiguratorTest

public class GenericConfiguratorTest extends Object

Fields Summary
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

param
args the command line arguments


        	         
    
	     
    
        GenericConfiguratorTest testMain = new GenericConfiguratorTest();
        testMain.test();
    
private voidtest()

		try
		{
                MBeanServer		mbs				= SunoneInterceptor.getMBeanServerInstance();
  		GenericConfigurator genConf = new GenericConfigurator();
   		mbs.registerMBean(new GenConfigTestMBean("str1", 2), new ObjectName("ias:instance-name=ias1,component=orb")); //a server-instance
   		mbs.registerMBean(new GenConfigTestMBean("str3", 4), new ObjectName("ias:instance-name=ias1,component=test")); //a server-instance
//   		mbs.registerMBean(genConf, new ObjectName("ias:type=configurator")); //a server-instance
			
			AttributeList attrList = genConf.getGenericAttributes(new String[]{"server.ias1.orb.name","server.ias1.orb.port","server.ias1.orb.*"});
//      AttributeList attrList = genConf.getGenericAttributes(new String[]{"server.ias1.*.*"});
      Iterator it = attrList.iterator();
      while (it.hasNext())
        {
          Attribute attribute = (Attribute) it.next();
          String name = attribute.getName();
          Object value = attribute.getValue();
          System.out.println("Attribute name="+name+" value="+value);
        }
		}
		catch(Throwable e)
		{
			e.printStackTrace();
		}