Examples of MBeanData


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

Examples of org.jboss.test.xml.mbeanserver.MBeanData

      InputStream is2 = getResource("xml/mbeanserver/testObjFactory.xml");
      Services services = (Services)unmarshaller.unmarshal(is2, schemaBinding);
      List mbeans = services.getMBeans();
      assertEquals("There is 1 mbean", 1, mbeans.size());

      MBeanData mbean = (MBeanData) mbeans.get(0);
      assertTrue("ClassName == org.jboss.security.auth.login.DynamicLoginConfig",
         mbean.getCode().equals("org.jboss.security.auth.login.DynamicLoginConfig"));
      assertTrue("Name == jboss.security.tests:service=DynamicLoginConfig",
         mbean.getName().equals("jboss.security.tests:service=DynamicLoginConfig"));
      Map attributes = mbean.getAttributeMap();
      assertTrue("There are 2 attributes",
         attributes.size() == 2);
      MBeanAttribute attr = (MBeanAttribute) attributes.get("PolicyConfig");
      Object value = attr.getValue();
      assertTrue("Value isA PolicyConfig",
View Full Code Here

Examples of org.jmanage.core.data.MBeanData

        Set mbeans =
                serverConnection.queryNames(filterObjectName);
        ArrayList<MBeanData> mbeanDataList = new ArrayList<MBeanData>(mbeans.size());
        for(Iterator it=mbeans.iterator();it.hasNext(); ){
            ObjectName objName = (ObjectName)it.next();
            mbeanDataList.add(new MBeanData(objName.getDisplayName()));
        }
        return mbeanDataList;
    }
View Full Code Here

Examples of org.jmanage.core.data.MBeanData

        }

        Map domainToObjectNameListMap = new TreeMap();
        ObjectNameTuple tuple = new ObjectNameTuple();
        for(Iterator it=mbeanDataList.iterator(); it.hasNext();){
            MBeanData mbeanData = (MBeanData)it.next();
            tuple.setObjectName(mbeanData.getName());
            String domain = tuple.getDomain();
            String name = tuple.getName();
            Set objectNameList = (Set)domainToObjectNameListMap.get(domain);
            if(objectNameList == null){
                objectNameList = new TreeSet();
View Full Code Here

Examples of org.jmanage.core.data.MBeanData

            throws ServiceException{
        ServerConnection serverConnection = context.getServerConnection();
        List mbeans = queryMBeans(context, filter);
        List mbeanToAttributesList = new ArrayList();
        for(Iterator itr=mbeans.iterator(); itr.hasNext();){
            MBeanData mbeanData = (MBeanData)itr.next();
            ObjectName objName = new ObjectName(mbeanData.getName());
            try {
                ObjectInfo objInfo = serverConnection.getObjectInfo(objName);
                ObjectAttributeInfo[] objAttrInfo = objInfo.getAttributes();
                if(objAttrInfo!=null && objAttrInfo.length > 0){
                    if(dataTypes!=null && dataTypes.length > 0){
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.