Package javax.management

Examples of javax.management.Attribute


      AttributeList alist = new AttributeList();
      String storeId = "bananarama";
     
      Integer anInteger = new Integer(666);
      String aString = new String("Evil Test");
      alist.add(new Attribute("Attr1", anInteger));
      alist.add(new Attribute("Attr2", aString));
      apm.store(storeId, alist);
     
      // Read them back
      AttributeList alist2 = apm.load(storeId);     
   }
View Full Code Here


   public void testSetCustom()
      throws Exception
   {
      log.info("+++ testSetCustom");
      MBeanServerConnection server = getServer();
      server.setAttribute(getObjectName(), new Attribute("Custom", new CustomClass("changed")));
      CustomClass custom = (CustomClass) server.getAttribute(getObjectName(), "Custom");
      assertEquals("changed", custom.getValue());
   }
View Full Code Here

   public void testSetCustom()
      throws Exception
   {
      log.info("+++ testSetCustom");
      MBeanServerConnection server = getJMXServer();
      server.setAttribute(getObjectName(), new Attribute("Custom", new CustomClass("changed")));
      CustomClass custom = (CustomClass) server.getAttribute(getObjectName(), "Custom");
      assertEquals("changed", custom.getValue());
   }
View Full Code Here

      return server.getAttribute(objectName, name);
   }

   public void set(String name, Object value) throws Throwable
   {
      Attribute attribute = new Attribute(name, value);
      server.setAttribute(objectName, attribute);
   }
View Full Code Here

  
   protected void setUp() throws Exception
   {
      super.setUp();
      ObjectName aspectManager = new ObjectName(ASPECT_MANAGER_NAME);
      Attribute enableTransformer = new Attribute("EnableLoadtimeWeaving", Boolean.TRUE);
      getServer().setAttribute(aspectManager, enableTransformer);
      if (useBaseXml)
      {
         Attribute useBaseXmlAttribute = new Attribute("UseBaseXml", useBaseXml);
         getServer().setAttribute(new ObjectName("jboss.aop:service=AspectManager"), useBaseXmlAttribute);
      }
      if (hook != null)
      {
         hook.setup(getServer());
      }
      try
      {
         if (jars != null)
         {
            for (int i = 0 ; i < jars.length ; i++)
            {
               String jar = jars[i].trim();
               redeploy(jar);
            }
         }
      }
      catch(Exception e)
      {
         // Reset the EnableTransformer to false
         try
         {
            enableTransformer = new Attribute("EnableLoadtimeWeaving", Boolean.FALSE);
            getServer().setAttribute(aspectManager, enableTransformer);
            if (hook != null)
            {
               hook.teardown(getServer());
            }
View Full Code Here

               undeployException = e;
            }
         }
      }
      ObjectName aspectManager = new ObjectName(ASPECT_MANAGER_NAME);
      Attribute enableTransformer = new Attribute("EnableLoadtimeWeaving", Boolean.FALSE);
      getServer().setAttribute(aspectManager, enableTransformer);
      if (useBaseXml)
      {
         Attribute useBaseXmlAttribute = new Attribute("UseBaseXml", false);
         getServer().setAttribute(new ObjectName("jboss.aop:service=AspectManager"), useBaseXmlAttribute);
      }
      if (hook != null)
      {
         hook.teardown(getServer());
View Full Code Here

         }
  
         deploy("aop-scopeddependency-global.jar");
         try
         {
            server.setAttribute(testerName, new Attribute("Property", 42));
            assertEquals(42, server.getAttribute(testerName, "Property"));
            String ret = (String)server.invoke(testerName, "someAction", new Object[0], new String[0]);
            assertNotNull(ret);
            assertEquals("true", ret);
         }
View Full Code Here

   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=BeanWithCtorMethodCall");
      MBeanInfo info = server.getMBeanInfo(testerName);
      assertNotNull(info);
      server.setAttribute(testerName, new Attribute("Property", 42));
      assertEquals(42, server.getAttribute(testerName, "Property"));
   }
View Full Code Here

         }

         deploy("aop-mc-jmxtest-dependency.jar");
         try
         {
            server.setAttribute(testerName, new Attribute("Property", 42));
            assertEquals(42, server.getAttribute(testerName, "Property"));
            String ret = (String)server.invoke(testerName, "someAction", new Object[0], new String[0]);
            assertNotNull(ret);
            assertEquals("true", ret);
         }
View Full Code Here

   }

   private void testBean(ObjectName on) throws Exception
   {
      MBeanServerConnection server = getServer();
      server.setAttribute(on, new Attribute("Property", 42));
      assertEquals(42, server.getAttribute(on, "Property"));

      Object ret = server.invoke(on, "someAction", new Object[0], new String[0]);
      assertEquals("JMX42", ret);
   }
View Full Code Here

TOP

Related Classes of javax.management.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.