Examples of MBeanData


Examples of org.jboss.jmx.adaptor.model.MBeanData

         while( objectNamesIter.hasNext() )
         {
            ObjectName name = (ObjectName) objectNamesIter.next();
            MBeanInfo info = server.getMBeanInfo(name);
            String domainName = name.getDomain();
            MBeanData mbeanData = new MBeanData(name, info);
            DomainData data = (DomainData) domainData.get(domainName);
            if( data == null )
            {
               data = new DomainData(domainName);
               domainData.put(domainName, data);
View Full Code Here

Examples of org.jboss.jmx.adaptor.model.MBeanData

   public static MBeanData getMBeanData(String name) throws JMException
   {
      MBeanServer server = getMBeanServer();
      ObjectName objName = new ObjectName(name);
      MBeanInfo info = server.getMBeanInfo(objName);
      MBeanData mbeanData = new MBeanData(objName, info);
      return mbeanData;
   }
View Full Code Here

Examples of org.jboss.jmx.adaptor.model.MBeanData

   {
      String name = request.getParameter("name");
      log.trace("inspectMBean, name="+name);
      try
      {
         MBeanData data = getMBeanData(name);
         request.setAttribute("mbeanData", data);
         RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectMBean.jsp");
         rd.forward(request, response);
      }
      catch(Exception e)
View Full Code Here

Examples of org.jboss.jmx.adaptor.model.MBeanData

      }

      try
      {
         AttributeList newAttributes = setAttributes(name, attributes);
         MBeanData data = getMBeanData(name);
         request.setAttribute("mbeanData", data);
         RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectMBean.jsp");
         rd.forward(request, response);
      }
      catch(Exception e)
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Try with a null mbean name:
      try
      {
         data.setName(null);
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an empty mbean name:
      try
      {
         data.setName("");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name:
      try
      {
         data.setName("jboss.xxx:service=NoneSuch");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name with multiple attributes::
      try
      {
         data.setName("jboss.xxx:service=NoneSuch,type=Unknown,Alias=whatever");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setAttributes(attrs);

      // Try with a null template name:
      try
      {
         data.setTemplateName(null);
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template name: "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an empty template name:
      try
      {
         data.setTemplateName("");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with empty template name "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an unknown template name:
      try
      {
         data.setTemplateName("nonesuch");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

   public void testUpdateMBeanBadAttributes() throws Exception
   {
      log.info("+++ testUpdateMBeanBadAttributes");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setTemplateName("mbean-update");
      data.setAttributes(null);

      // Update the mbean
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (result)
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

      // For some reason, the following value is rounded up to 1000 if set to
      // 999, so we will use 1000 as the value:
      attrs.put("SoftenWaitMillis", "1000");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      String name = "jboss.mq:service=MessageCache";
      data.setName(name);
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (!result)
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

      // Establish the dependency values
      Properties depends = new Properties();
      depends.put("NextInterceptor", "jboss.mq:service=DestinationManager");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      String name = "jboss.mq:service=SecurityManager";
      data.setName(name);
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);
      data.setDepends(depends);

      // Update and verify the mbean:
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (!result)
View Full Code Here

Examples of org.jboss.services.deployment.MBeanData

      Properties depends = new Properties();
      depends.put("", "jboss:service=Naming");

      // Set up the MBean configuration bean, this time with the attributes
      // in the order in which they appear when asking the mbean for the name
      MBeanData data = new MBeanData();
      data
            .setName("jboss.mq:alias=UIL2XAConnectionFactory,service=InvocationLayer,type=UIL2XA");
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);
      data.setDepends(depends);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
         log.error(msg);
         fail(msg);
      }
      verifyMBean(data, null);

      // Try again, but with the name attributes in a different order. This
      // time in the order in which they appear in the xml file:
      attrs = new Properties();
      attrs.put("FromName", "RRRRRRRRRRR");
      attrs.put("ToName", "QQQQQQQQQQQQQ");
      data
            .setName("jboss.mq:service=InvocationLayer,type=UIL2XA,alias=UIL2XAConnectionFactory");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
         log.error(msg);
         fail(msg);
      }
      verifyMBean(data, null);

      // Try again, but with the name attributes in another order. This
      // time in the order is different that the mbean name or xml file:
      attrs = new Properties();
      attrs.put("FromName", "LLLLLLLLLLLL");
      attrs.put("ToName", "KKKKKKKKKKKK");
      data
            .setName("jboss.mq:type=UIL2XA,alias=UIL2XAConnectionFactory,service=InvocationLayer");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.