Package org.jboss.managed.api

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


      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

   public void testTopicOperations() throws Exception
   {
      ManagedComponent component = getManagementView().getComponent("testCreateTopic", TopicType);
      ManagedOperation o = getOperation(component, "listAllSubscriptionsAsHTML", new String[0]);
      MetaValue v = o.invoke(new MetaValue[0]);
      assertNotNull("null operation return value", v);
      log.debug("result" + v);
   }
  
   public void testRemoveTopic() throws Exception
View Full Code Here

      // Clear any
      Set<ManagedOperation> ops = component.getOperations();
      ManagedOperation removeAllMessages = ManagedOperationMatcher.findOperation(ops, "removeAllMessages");
      assertNotNull("removeAllMessages", removeAllMessages);
      removeAllMessages.invoke();
      assertEquals(SimpleValueSupport.wrap(0), messageCount.getValue());

      // Send a message
      Queue queue = (Queue) getInitialContext().lookup(jndiName);
      assertNotNull(queue);
View Full Code Here

      assertEquals(messageCounterCV.get("messageCount"), messageCount2);
     
      //
      ManagedOperation listAllMessages = ManagedOperationMatcher.findOperation(ops, "listAllMessages");
      assertNotNull("listAllMessages", listAllMessages);
      MetaValue msgs = listAllMessages.invoke();
      assertNotNull(msgs);
      log.info("listAllMessages.MV: "+msgs);
      assertTrue("msgs is a CollectionValue", msgs instanceof CollectionValue);
      CollectionValue msgsCV = (CollectionValue) msgs;
      MetaValue[] msgsMVs = msgsCV.getElements();
View Full Code Here

      createRoles(configurationUpdateReport, name, sendRoles, consumeRoles, createNonDurableRoles, deleteNonDurableRoles, createDurableRoles, deleteDurableRoles);
      try
      {
         ManagedOperation operation = ManagementSupport.getOperation(view, JMSConstants.Topic.COMPONENT_NAME,
               "updateTopicConfiguration", JMSConstants.Topic.COMPONENT_TYPE);
         operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()),
             new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
             new SimpleValueSupport(SimpleMetaType.STRING, DLA),
             new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
View Full Code Here

      Set<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
      JMSComponent context = (JMSComponent) resourceDiscoveryContext.getParentResourceComponent();
      ManagementView managementView = context.getProfileService();
      ManagedOperation operation = ManagementSupport.getOperation(managementView, JMSConstants.Queue.COMPONENT_NAME, "getJMSQueues", JMSConstants.Queue.COMPONENT_TYPE);

      ArrayValueSupport value = (ArrayValueSupport) operation.invoke();

      for (int i = 0; i < value.getLength(); i++)
      {
         SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
         ResourceType resourceType = resourceDiscoveryContext.getResourceType();
View Full Code Here

   }
   private String getVersion(ResourceDiscoveryContext ctx) throws Exception
   {
      ManagementView managementView = getProfileService(ctx);
      ManagedOperation operation = ManagementSupport.getOperation(managementView, "JMSServerMO", "getVersion", new ComponentType("JMSManage", "ServerManage"));
      SimpleValueSupport support = (SimpleValueSupport) operation.invoke();
      return support.getValue().toString();
   }
}
View Full Code Here

   {
      try
      {
         ManagementView view = getProfileService();
         ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), "isPaused", getComponentType());
         SimpleValueSupport val = (SimpleValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
         boolean paused = ((Boolean)val.getValue()).booleanValue();
         return paused ? AvailabilityType.DOWN : AvailabilityType.UP;
      }
      catch (Exception e)
      {
View Full Code Here

      StringBuffer consumeRoles = new StringBuffer();
      createRoles(configurationUpdateReport, name, sendRoles, consumeRoles);
      try
      {
         ManagedOperation operation = ManagementSupport.getOperation(view, JMSConstants.Queue.COMPONENT_NAME, "updateQueueConfiguration", JMSConstants.Queue.COMPONENT_TYPE);
         operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()),
             new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
             new SimpleValueSupport(SimpleMetaType.STRING, DLA),
             new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
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.