Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedComponent


      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "JTA");
      Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
      int count = comps.size();
      assertEquals("There is 1 MCBean:JTA ManagedComponent", 1, 1);
      ManagedComponent comp = comps.iterator().next();
      Map<String, ManagedProperty> props = comp.getProperties();
      for(ManagedProperty prop : props.values())
      {
         log.info(prop+", : "+prop.getValue());
      }
   }
View Full Code Here


      mgtView.applyTemplate(deploymentName, dsInfo);

      // reload the view
      activeView = null;
      mgtView = getManagementView();
      ManagedComponent dsMC = getManagedComponent(mgtView, componentType, componentName);
      assertNotNull(dsMC);

      Set<String> mcPropNames = new HashSet<String>(dsMC.getPropertyNames());
      for(String propName : propValues.keySet())
      {
         ManagedProperty prop = dsMC.getProperty(propName);
         log.debug("Checking: "+propName);
         assertNotNull(propName, prop);
         Object propValue = prop.getValue();
         Object expectedValue = propValues.get(propName);
         if(propValue instanceof MetaValue)
         {
            if (prop.getMetaType().isComposite())
            {
               // TODO / FIXME - compare composites
               log.warn("Not checking composite: "+propValue);
            }
            else
            {
               // Compare the MetaValues
               assertEquals(prop.getName(), expectedValue, propValue);
            }
         }
         else if(propValue != null)
         {
            fail(prop.getName()+" is not a MetaValue: "+propValue);
         }

         mcPropNames.remove(propName);
      }

      if(!mcPropNames.isEmpty())
      {
         log.warn(getName() + "> untested properties: " + mcPropNames);
         for(String propName : mcPropNames)
         {
            ManagedProperty prop = dsMC.getProperty(propName);
            log.info(prop);
         }
      }
   }
View Full Code Here

      this.deployTestJar();

      // Ensure component exists.
      final String ejbName = TestStatelessBean.EJB_NAME;
      final String componentName = NAME_TEST_JAR + '/' + ejbName;
      final ManagedComponent component = this.getAndTestManagedComponent(COMPONENT_SUBTYPE_STATELESS_SESSION,
            componentName);

      // Check component has expected props and ops.
      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SLSB);
      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_SLSB);
View Full Code Here

      this.deployTestJar();

      // Ensure component exists.
      final String ejbName = TestStatefulBean.EJB_NAME;
      final String componentName = NAME_TEST_JAR + '/' + ejbName;
      final ManagedComponent component = this.getAndTestManagedComponent(COMPONENT_SUBTYPE_STATEFUL_SESSION,
            componentName);

      // Check component has expected props and ops.
      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SFSB);
      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_SFSB);
View Full Code Here

      this.deployTestJar();

      // Ensure component exists.
      final String ejbName = TestLoggingMDB.class.getSimpleName();
      final String componentName = NAME_TEST_JAR + '/' + ejbName;
      final ManagedComponent component = this.getAndTestManagedComponent(COMPONENT_SUBTYPE_MESSAGE_DRIVEN,
            componentName);

      // Check component has expected props and ops.
      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_MDB);
      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_MDB);
View Full Code Here

      final ComponentType componentType = new ComponentType(COMPONENT_TYPE_EJB3, componentSubType);
      final Set<ManagedComponent> components = managementView.getComponentsForType(componentType);

      // Get SLSB
      final Iterator<ManagedComponent> componentsIt = components.iterator();
      ManagedComponent component = null;
      while (componentsIt.hasNext())
      {
         // Obtain the next component
         final ManagedComponent currentComponent = componentsIt.next();
         final String name = currentComponent.getName();

         // Ensure it's the component we're looking for
         if (name.equals(componentName))
         {
            component = currentComponent;
View Full Code Here

         throws IllegalArgumentException, Exception
   {
      // Ensure component exists
      final String ejbName = TestStatelessBean.EJB_NAME;
      final String slsbComponentName = NAME_TEST_JAR + '/' + ejbName;
      final ManagedComponent slsbComponent = this.getAndTestManagedComponent(COMPONENT_SUBTYPE_STATELESS_SESSION,
            slsbComponentName);

      // Obtain invocation stats
      InvocationStats invocationStats = getInvocationStats(slsbComponent);
View Full Code Here

         KnownComponentTypes.DataSourceTypes.XA.getType(), jndiName);
      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = KnownComponentTypes.DataSourceTypes.XA.getType();
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
      assertEquals("interleaving.value is true", SimpleValueSupport.wrap(Boolean.TRUE), interleavingMV);
   }
View Full Code Here

      createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxCf",
         new ComponentType("ConnectionFactory", "Tx"), jndiName);
      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
     
   }
View Full Code Here

      createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxXACf",
         new ComponentType("ConnectionFactory", "Tx"), jndiName);
      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
      assertEquals(SimpleValueSupport.wrap(Boolean.TRUE), interleavingMV);
   }
View Full Code Here

TOP

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

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.