Package javax.management

Examples of javax.management.Attribute


   }

   public static void setAttribute(MBeanServerConnection server, ObjectName objectName, String attName, Object attValue) throws Exception
   {
    
      server.setAttribute(objectName, new Attribute(attName, attValue));
     
   }
View Full Code Here


      public void setup(MBeanServerConnection server) throws Exception
      {
         ObjectName aspectManager = new ObjectName(AOPClassLoaderHookTestSetup.ASPECT_MANAGER_NAME);
        
         originalIgnore = (String)server.getAttribute(aspectManager, "Ignore");
         server.setAttribute(aspectManager, new Attribute("Ignore", "*$$Ignored$$*"));
        
         originalInclude = (String)server.getAttribute(aspectManager, "Include");
         server.setAttribute(aspectManager, new Attribute("Include", "org.jboss.test.aop.scoped.excluded.included."));
        
         originalExclude = (String)server.getAttribute(aspectManager, "Exclude");
         server.setAttribute(aspectManager, new Attribute("Exclude", "org.jboss.test.aop.scoped.excluded."));
      }
View Full Code Here

  
      public void teardown(MBeanServerConnection server) throws Exception
      {
         ObjectName aspectManager = new ObjectName(AOPClassLoaderHookTestSetup.ASPECT_MANAGER_NAME);
  
         server.setAttribute(aspectManager, new Attribute("Ignore", originalIgnore));
         server.setAttribute(aspectManager, new Attribute("Include", originalInclude));
         server.setAttribute(aspectManager, new Attribute("Exclude", originalExclude));
      }
View Full Code Here

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

   }

   private void isolateDeployments(Boolean value) throws Exception
   {
      //getServer().setAttribute(EARDeployerMBean.OBJECT_NAME, new Attribute("Isolated", value));
      getServer().setAttribute(EARDeployerMBean.OBJECT_NAME, new Attribute("CallByValue", value));
   }
View Full Code Here

         if (type.attributes != null)
         {
            AttributeList attrs = server.getAttributes(node, type.attributes);
            for (int i = 0; i < attrs.size(); i++)
            {
               Attribute attr = (Attribute)attrs.get(i);
               println(out, depth + 1, attr.getName() + "=" + attr.getValue());
            }
         }
        
         // print out associations, if any
         if (type.associations != null)
View Full Code Here

      PrintWriter out = context.getWriter();

      Iterator iter = attrList.iterator();
      while (iter.hasNext())
      {
         Attribute attr = (Attribute) iter.next();
         if (prefix)
         {
            out.print(attr.getName());
            out.print("=");
         }
         out.println(attr.getValue());
      }
      closeServer();
   }
View Full Code Here

      throw new CommandException("No matching attribute found");
    }
    else
    {
      Object oVal = convert(theVal,attr.getType());
      Attribute at = new Attribute(theAttr,oVal);
      server.setAttribute(objectName,at);
     
      // read the attribute back from the server
      if (!context.isQuiet())
      {
View Full Code Here

      MBeanInfo info = server.getMBeanInfo(objectName);
      MBeanAttributeInfo[] attribute_info = info.getAttributes();
      String type;
      AttributeList attrs = new AttributeList(attributeNames.size());
      Attribute attr;
      String attr_name;
      Object attr_value, real_value;
      MBeanAttributeInfo attr_info;


      for (Iterator it = attributeNames.iterator(); it.hasNext();)
      {
         attr_name = (String) it.next();
         attr_value = it.next();

         attr_info = findAttribute(attr_name, attribute_info);
         if (attr_info == null)
            throw new CommandException("attribute " + attr_name + " not found");
         type = attr_info.getType();

         PropertyEditor editor = PropertyEditors.getEditor(type);
         editor.setAsText((String) attr_value);
         real_value = editor.getValue();

         attr = new Attribute(attr_name, real_value);
         attrs.add(attr);
      }

      AttributeList ret = server.setAttributes(objectName, attrs);
      System.out.println("The following attributes were set successfuly:");
      if (ret.size() > 0)
      {
         for (Iterator it = ret.iterator(); it.hasNext();)
         {
            Attribute a = (Attribute) it.next();
            System.out.println(a.getName() + "=" + a.getValue());
         }
      }
      closeServer();
   }
View Full Code Here

      {
         String name = names[n];
         try
         {
            Object value = getAttribute(name);
            Attribute attr = new Attribute(name, value);
            list.add(attr);
         }
         catch(Exception e)
         {
         }
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.