Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedOperation


   }

   public void deleteResource() throws Exception
   {
      ManagementView view = getProfileService();
      ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), getDeleteOperationName(), getComponentType());
      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
   }
View Full Code Here


         valueSupports[i] = new SimpleValueSupport(SimpleMetaType.STRING, it.next().getName());
      }
      support.setValue(valueSupports);
      ManagementView view = getProfileService();

      ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), getMeasurementsOperationName(), getComponentType());
      ArrayValueSupport vals = (ArrayValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()), support);
      it = measurementScheduleRequests.iterator();
      for (int i = 0, valueSupportsLength = valueSupports.length; i < valueSupportsLength; i++)
      {
         MeasurementScheduleRequest request = it.next();
         SimpleValueSupport simpleValueSupport = (SimpleValueSupport) vals.getValue(i);
View Full Code Here

   public Configuration loadResourceConfiguration() throws Exception
   {
      Configuration config = new Configuration();
      ManagementView view = getProfileService();

      ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), getConfigurationOperationName(), getComponentType());

      CompositeValueSupport val = (CompositeValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));

      ConfigurationDefinition configDef = resourceContext.getResourceType().getResourceConfigurationDefinition();
      List<PropertyDefinition> propertyDefinitionList = configDef.getPropertiesInGroup("HornetQCustomProperties");
      for (PropertyDefinition definition : propertyDefinitionList)
      {
View Full Code Here

      }
      else if("SubscriptionInfo".equalsIgnoreCase(oper.getResultsType()))
      {
         methodOperation = getInvokeOperationSubscriptionMessage();
      }
      ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), methodOperation, getComponentType());
      Object result = null;
      result = operation.invoke(queueName, methodName, param, sig);
      if (result == null)
      {
         return null;
      }
      return formatResults(result, oper.getResultsType());
View Full Code Here

            measurementReport.addData(new MeasurementDataTrait(measurementScheduleRequest, "HornetQ"));
         }
         else if ("started".equalsIgnoreCase(measurementScheduleRequest.getName()))
         {
            ManagementView managementView = getProfileService();
            ManagedOperation operation = ManagementSupport.getOperation(managementView, "JMSServerMO", "isStarted", new ComponentType("JMSManage", "ServerManage"));
            SimpleValueSupport support = (SimpleValueSupport) operation.invoke();
            measurementReport.addData(new MeasurementDataTrait(measurementScheduleRequest, support.getValue().toString()));
         }
      }

   }
View Full Code Here

                                        boolean useGlobalPools,
                                        long retryInterval,
                                        String connectionLoadBalancingPolicyClassName)
         throws Exception
   {
      ManagedOperation operation = ManagementSupport.getOperation(managementView, JMSConstants.ConnectionFactory.COMPONENT_NAME, "createConnectionFactory", JMSConstants.ConnectionFactory.COMPONENT_TYPE);
      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, ha),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useDiscovery),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, cfType),
            new SimpleValueSupport(SimpleMetaType.STRING, connectorNames),
            new SimpleValueSupport(SimpleMetaType.STRING, bindings),
View Full Code Here

   }

   private void createQueue(CreateResourceReport createResourceReport, ManagementView managementView, String name, String jndiName, String DLA, String expiryAddress, int maxSize, int pageSize, int pageMaxCacheSize, int maxDeliveryAttempts, long redeliveryDelay, boolean lastValueQueue, long redistributionDelay, boolean sendToDLAOnNoRoute, String addressFullMessagePolicy)
         throws Exception
   {
      ManagedOperation operation = ManagementSupport.getOperation(managementView, JMSConstants.Queue.COMPONENT_NAME, "createQueue", JMSConstants.Queue.COMPONENT_TYPE);

      StringBuffer sendRoles = new StringBuffer();
      StringBuffer consumeRoles = new StringBuffer();
      createRoles(createResourceReport, name, sendRoles, consumeRoles);

      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            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

   }

   private void createTopic(CreateResourceReport createResourceReport, ManagementView managementView, String name, String jndiName, String DLA, String expiryAddress, int maxSize, int pageSize, int pageMaxCacheSize, int maxDeliveryAttempts, long redeliveryDelay, boolean lastValueQueue, long redistributionDelay, boolean sendToDLAOnNoRoute, String addressFullMessagePolicy)
         throws Exception
   {
      ManagedOperation operation = ManagementSupport.getOperation(managementView, JMSConstants.Topic.COMPONENT_NAME,
            "createTopic", JMSConstants.Topic.COMPONENT_TYPE);

      StringBuffer sendRoles = new StringBuffer();
      StringBuffer consumeRoles = new StringBuffer();
      StringBuffer createNonDurableRoles = new StringBuffer();
      StringBuffer deleteNonDurableRoles = new StringBuffer();
      StringBuffer createDurableRoles = new StringBuffer();
      StringBuffer deleteDurableRoles = new StringBuffer();
      createRoles(createResourceReport, name, sendRoles, consumeRoles, createNonDurableRoles, deleteNonDurableRoles, createDurableRoles, deleteDurableRoles);

      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            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

      // The gc op
      Set<ManagedOperation> ops = mo.getOperations();
      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();
   }
View Full Code Here

      if (javaSpecVersion.equals("1.5") || javaSpecVersion.equals("5.0"))
         assertEquals(mo + " has wrong number of ManagedOperations.", 8, ops.size());
      else if (javaSpecVersion.equals("1.6") || javaSpecVersion.equals("6.0"))
         assertEquals(mo + " has wrong number of ManagedOperations.", 11, ops.size());
     
      ManagedOperation getThreadInfo = ManagedOperationMatcher.findOperation(ops,
            "getThreadInfo", SimpleMetaType.LONG_PRIMITIVE, SimpleMetaType.INTEGER_PRIMITIVE);
      assertNotNull("getThreadInfo", getThreadInfo);
      log.debug(getThreadInfo);
      String[] getThreadInfoSig = getThreadInfo.getReflectionSignature();
      String[] getThreadInfoSigExpected = {"long", "int"};
      assertEquals(Arrays.asList(getThreadInfoSigExpected), Arrays.asList(getThreadInfoSig));
      ManagedOperation resetPeakThreadCount = ManagedOperationMatcher.findOperation(ops,
            "resetPeakThreadCount");
      assertNotNull("resetPeakThreadCount", resetPeakThreadCount);
      assertEquals(0, resetPeakThreadCount.getReflectionSignature().length);

      MBeanServer server = ManagementFactory.getPlatformMBeanServer();
      ObjectName tname = new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME);
      MBeanInfo tinfo = server.getMBeanInfo(tname);
      MBeanOperationInfo[] tops = tinfo.getOperations();
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.ManagedOperation

Copyright © 2018 www.massapicom. 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.