Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedOperation.invoke()


      }
      // Validate the listFormattedSubPoolStatistics op
      listFormattedSubPoolStatistics = opsByName.get("listFormattedSubPoolStatistics");
      assertNotNull("listFormattedSubPoolStatistics", listFormattedSubPoolStatistics);
      MetaValue[] params = {};
      Object result = listFormattedSubPoolStatistics.invoke(params);
      assertNotNull("Expecting non null result", result);
      log.info("listFormattedSubPoolStatistics.invoke: "+result);
      // It needs to be a MetaValue as well
      assertTrue("result is a MetaValue", result instanceof MetaValue);
      // Validate the listStatistics op
View Full Code Here


      // It needs to be a MetaValue as well
      assertTrue("result is a MetaValue", result instanceof MetaValue);
      // Validate the listStatistics op
      ManagedOperation listStatistics = opsByName.get("listStatistics");
      assertNotNull("listStatistics", listStatistics);
      result = listStatistics.invoke(params);
      assertNotNull("Expecting non null result", result);
      log.info("listStatistics.invoke: "+result);
      // It needs to be a MetaValue as well
      assertTrue("result is a MetaValue", result instanceof MetaValue);
   }
View Full Code Here

      assertNotNull(ops);
      assertEquals("There is 1 op", 1, ops.size());
      ManagedOperation gc = ops.iterator().next();
      assertEquals("gc", gc.getName());
      assertEquals("Runs the garbage collector", gc.getDescription());
      gc.invoke();
   }

   public void testThreadMXBean()
      throws Exception
   {
View Full Code Here

      ManagedOperation getThreadInfo = ManagedOperationMatcher.findOperation(ops,
            "getThreadInfo", SimpleMetaType.LONG_PRIMITIVE, SimpleMetaType.INTEGER_PRIMITIVE);
      assertNotNull("getThreadInfo", getThreadInfo);
      log.debug(getThreadInfo);

      MetaValue tid0InfoMV = getThreadInfo.invoke(tid0SV);
      assertNotNull(tid0InfoMV);
      assertTrue(tid0InfoMV instanceof CompositeValue);
      log.debug(tid0InfoMV);
      CompositeValue tid0InfoCV = (CompositeValue) tid0InfoMV;
      ThreadInfo tid0Info = ManagementFactoryUtils.unwrapThreadInfo(tid0InfoCV);
View Full Code Here

      // Send a few messages so the message based ops have values
      sendQueueMsgs("testCreateQueue", component);

     
      ManagedOperation o = getOperation(component, "listMessageCounterAsHTML", new String[0]);
      MetaValue v = o.invoke(new MetaValue[0]);
      assertNotNull("null operation return value", v);
      log.debug("result: " + v);
     
     
      // JBAS-7024,
View Full Code Here

     
      // JBAS-7024,
      ManagedOperation listAllMessages = getOperation(component, "listAllMessages", new String[0]);
      MetaType listAllMessagesRT = listAllMessages.getReturnType();
      log.debug("listAllMessagesRT: " + listAllMessagesRT);
      MetaValue listAllMessagesMV = listAllMessages.invoke(new MetaValue[0]);
      assertNotNull("null operation return value", listAllMessagesMV);
      log.debug("result: " + listAllMessagesMV);
      MetaType resultType = listAllMessagesMV.getMetaType();
      log.debug("resultType: "+resultType);
      assertTrue("resultType instanceof CompositeMetaType", resultType instanceof CollectionMetaType);
View Full Code Here

   {
      ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);
      assertEquals(RunState.RUNNING, component.getRunState());
      // Stop
      ManagedOperation o = getOperation(component, "stop", new String[0]);
      o.invoke(new MetaValue[0]);
      // Check runState dispatching
      assertEquals(RunState.STOPPED, component.getRunState());
      // Start
      o = getOperation(component, "start", new String[0]);
      o.invoke(new MetaValue[0]);
View Full Code Here

      o.invoke(new MetaValue[0]);
      // Check runState dispatching
      assertEquals(RunState.STOPPED, component.getRunState());
      // Start
      o = getOperation(component, "start", new String[0]);
      o.invoke(new MetaValue[0]);
      //
      assertEquals(RunState.RUNNING, component.getRunState());
   }

   public void testMultipleQueues() throws Exception
View Full Code Here

      ManagementView mgtView = getManagementView();
      ManagedComponent queue = mgtView.getComponent("testCreateQueue", QueueType);
      assertNotNull(queue);
      assertEquals("running", RunState.RUNNING, queue.getRunState());
      ManagedOperation stop = getOperation(queue, "stop", new String[0]);
      stop.invoke(new MetaValue[0]);
     
      mgtView.reload();
      queue = mgtView.getComponent("testCreateQueue", QueueType);
      log.info("runtstate: " + queue.getRunState());
   }
View Full Code Here

      Map<String, ManagedOperation> opsByName = new HashMap<String, ManagedOperation>();
      for(ManagedOperation op : ops)
         opsByName.put(op.getName(), op);
      ManagedOperation listNonDurableSubscriptions = opsByName.get("listNonDurableSubscriptions");
      assertNotNull(listNonDurableSubscriptions);
      MetaValue subscriptions = listNonDurableSubscriptions.invoke();
      log.info(subscriptions);
      assertTrue(subscriptions instanceof CollectionValue);
      CollectionValue subscriptionsCV = (CollectionValue) subscriptions;
      assertTrue("subscriptions.size > 0", subscriptionsCV.getSize() > 0);
      MetaValue[] subscriptionsMVs = subscriptionsCV.getElements();
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.