Package org.jboss.managed.api

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


      result = mgdop.invoke(hajndiparams);
      assertNotNull(result);
     
      mgdop = operations.get("lookupDRMNodeNames");
      assertNotNull("HAPartition has lookupDRMNodeNames", mgdop);
      result = mgdop.invoke(hajndiparams);
      assertTrue(result instanceof CollectionValue);
      elements = ((CollectionValue) result).getElements();
      assertNotNull(elements);
      assertEquals(2, elements.length);
     
View Full Code Here


      assertNotNull(elements);
      assertEquals(2, elements.length);
     
      mgdop = operations.get("isDRMMasterForService");
      assertNotNull("HAPartition has isDRMMasterForService", mgdop);
      result = mgdop.invoke(hajndiparams);
      assertTrue(result instanceof SimpleValue);
      val = ((SimpleValue) result).getValue();
      assertTrue(val instanceof Boolean);
     
      mgdop = operations.get("create");
View Full Code Here

        ManagedOperation managedOperation = getManagedOperation(managedComponent, operationDefinition);
        // Convert parameters into MetaValue array.
        MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation,
            parameters, operationDefinition);
        // invoke() takes a varargs, so we need to pass an empty array, rather than null.
        MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues);
        OperationResult result = new OperationResult();
        // Convert result MetaValue to corresponding Property type.
        ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(),
            operationDefinition);
        // If this is a lifecycle operation ask for an avail check
View Full Code Here

      // Operations
      Set<ManagedOperation> ops = mc.getOperations();
      log.info("ServerInfo.ops: "+ ops);
      ManagedOperation listThreadCpuUtilization = ManagedOperationMatcher.findOperation(ops, "listThreadCpuUtilization");
      assertNotNull(listThreadCpuUtilization);
      MetaValue listThreadCpuUtilizationMV = listThreadCpuUtilization.invoke();
      // TODO
      assertNotNull(listThreadCpuUtilizationMV);
      assertEquals(SimpleMetaType.STRING, listThreadCpuUtilizationMV.getMetaType());
      SimpleValue listThreadCpuUtilizationSV = (SimpleValue) listThreadCpuUtilizationMV;
      String cpuUtilization = (String) listThreadCpuUtilizationSV.getValue();
View Full Code Here

      // Try invoking listThreadCpuUtilization and checking freeMemory until it changes
      long currentFreeMemoryValue = freeMemoryValue;
      for(int n = 0; n < 100; n ++)
      {
         listThreadCpuUtilization.invoke();
         currentFreeMemoryValue = getLong(freeMemory);
         if(currentFreeMemoryValue != freeMemoryValue)
            break;
      }
      assertTrue("currentFreeMemoryValue != original freeMemoryValue",
View Full Code Here

      }
      // 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

  
   public void testQueueOperations() throws Exception
   {
      ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);
      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);
   }

   public void testMultipleQueues() throws Exception
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.