Package org.jboss.managed.api

Examples of org.jboss.managed.api.ComponentType


    * @throws Exception if an error occurs while running the test.
    */
   public void testJNDIBasedSecurityRegistration() throws Exception
   {
      ManagementView mgtMview = getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent mc = mgtMview.getComponent("JNDIBasedSecurityRegistration", type);
      assertNotNull(mc);
   }
View Full Code Here


   }
  
   public void testFarmHotDeployment() throws Exception
   {
      ManagementView mgtView = getManagementView(getNamingContext(0));
      ComponentType type = new ComponentType("MCBean", "ServerConfig");
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
      assertNotNull(mc);
      String homeDir = (String) ((SimpleValue) mc.getProperty("serverHomeDir").getValue()).getValue();
      assertNotNull(homeDir);
     
View Full Code Here

    */
   public void testHAPartition()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "HAPartition");
      ManagedComponent mc = mgtView.getComponent(this.partitionName, type);
      validateHAPartitionManagedComponent(mc);
   }
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
     
      ManagementView mgtView = getManagementView(getNamingContext(0));
      ComponentType type = new ComponentType("MCBean", "ServerConfig");
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
      if (mc == null)
      {
         throw new IllegalStateException("No ServerConfig for node0 available");
      }
View Full Code Here

   }

   private ManagedComponent getChannelFactoryManagedComponent() throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "JGroupsChannelFactory");
      ManagedComponent mc = mgtView.getComponent("JChannelFactory", type);
      return mc;
   }
View Full Code Here

      // Map any existing ManagedComponent types
      for(ManagedComponent comp : md.getComponents().values())
      {
         log.debug("Updating ManagementComponent: "+comp);
         ComponentType type = comp.getType();
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
      }

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new TempManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
View Full Code Here

   {
      this.compSubtype = compSubtype;
   }
   public ComponentType getType()
   {
      return new ComponentType(compType, compSubtype);
   }
View Full Code Here

      // Map any existing ManagedComponent types
      for(ManagedComponent comp : md.getComponents().values())
      {
         log.debug("Updating ManagementComponent: "+comp);
         ComponentType type = comp.getType();
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
      }

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
View Full Code Here

            DeploymentTemplateInfo noTXinfo = mgtView.getTemplate("NoTxDataSourceTemplate");
            DeploymentTemplateInfo xaInfo = mgtView.getTemplate("XADataSourceTemplate");
            //Set<String> templateNames = mgtView.getTemplateNames();
            //Set<String> deploymentNames = mgtView.getDeploymentNames();

            ComponentType localType = new ComponentType("DataSource", "Local Transaction");
            Set<ManagedComponent> localDS = mgtView.getComponentsForType(localType);
            if (localDS != null)
            {
                for (ManagedComponent component : localDS)
                {
                    LOG.info("***********************************************");
                    LOG.info("******Dumping a LocalTX component values******");
                    LOG.info("***********************************************");
                    Map<String, ManagedProperty> properties = component.getProperties();
                    LOG.info("\t******Properties******");
                    for (ManagedProperty managedProperty : properties.values())
                    {
                        String name = managedProperty.getName();
                        MetaType propType = managedProperty.getMetaType();
                        LOG.info("\t\tProperty Name: " + name);
                        LOG.info("\t\tProperty Type: " + propType.getTypeName());
                        if (!propType.isGeneric() && !propType.isSimple())
                        {
                            if (propType.isCollection())
                            {
                                CollectionMetaType collMetaType = (CollectionMetaType) propType;
                                LOG.info("\t\t\tCollection Sub Type: " + collMetaType.getTypeName());
                            }
                            if (propType.isComposite())
                            {
                                CompositeMetaType compositeType = (CompositeMetaType) propType;
                                Set<String> items = compositeType.itemSet();
                                for (String itemName : items)
                                {
                                    LOG.info("\t\t\tComposite Sub Type: " + compositeType.getType(itemName).getTypeName());
                                }
                            }
                        }
                    }
                    LOG.info("***********************************************");
                    LOG.info("\t******Operations******");
                    Set<ManagedOperation> operations = component.getOperations();
                    for (ManagedOperation operation : operations)
                    {
                        String name = operation.getName();
                        MetaType returnType = operation.getReturnType();
                        LOG.info("\t\tOperation Name: " + name);
                        LOG.info("\t\tReturn Type: " + returnType.getTypeName());
                        ManagedParameter[] parameters = operation.getParameters();
                        LOG.info("\t\tParameters:");
                        for (ManagedParameter parameter : parameters)
                        {
                            String paramName = parameter.getName();
                            MetaType paramType = parameter.getMetaType();
                            LOG.info("\t\t\tParameter Name: " + paramName + " Type: " + paramType);
                        }
                    }
                }
            }
            LOG.info("queues: " + localDS);
            //assertNotNull("Null Local DS", localDS);
            //assertTrue("queues.size", localDS.size() > 0);

            ComponentType noType = new ComponentType("DataSource", "No Transaction");
            Set<ManagedComponent> noDS = mgtView.getComponentsForType(noType);
            if (noDS != null)
            {
                for (ManagedComponent component : noDS)
                {
                    Set<ManagedOperation> operations = component.getOperations();
                    for (ManagedOperation operation : operations)
                    {
                        String name = operation.getName();
                        ManagedParameter[] parameters = operation.getParameters();
                        for (ManagedParameter parameter : parameters)
                        {
                            String paramName = parameter.getName();
                        }
                    }
                }
            }
            LOG.info("queues: " + noDS);
            //assertNotNull("Null NO TX DS", noDS);
            //assertTrue("queues.size", noDS.size() == 0);

            ComponentType xaType = new ComponentType("DataSource", "XA Transaction");
            Set<ManagedComponent> xaDS = mgtView.getComponentsForType(xaType);
            if (xaDS != null)
            {
                for (ManagedComponent component : xaDS)
                {
                    Set<ManagedOperation> operations = component.getOperations();
                    for (ManagedOperation operation : operations)
                    {
                        String name = operation.getName();
                        ManagedParameter[] parameters = operation.getParameters();
                        for (ManagedParameter parameter : parameters)
                        {
                            String paramName = parameter.getName();
                        }
                    }
                }
            }
            LOG.info("queues: " + xaDS);
            //assertNotNull("Null XA DS", xaDS);
            //assertTrue("queues.size", xaDS.size() == 0);

            ComponentType queueType = new ComponentType("JMSDestination", "Queue");
            Set<ManagedComponent> queues = mgtView.getComponentsForType(queueType);
            LOG.info("queues: " + queues);
            //assertNotNull("Null JMS queues", queues);
            //assertTrue("queues.size", queues.size() > 0);

            ComponentType topicType = new ComponentType("JMSDestination", "Topic");
            Set<ManagedComponent> topics = mgtView.getComponentsForType(topicType);
            LOG.info("topics: " + topics);
            //assertNotNull(topics);
            //assertTrue("topics.size", topics.size() > 0);

View Full Code Here

                + ManagedComponentComponent.Config.COMPONENT_TYPE + "' is not defined in default template.");
        String subtype = defaultPluginConfig.getSimpleValue(ManagedComponentComponent.Config.COMPONENT_SUBTYPE, null);
        if (subtype == null || subtype.equals(""))
            throw new IllegalStateException("Required plugin configuration property '"
                + ManagedComponentComponent.Config.COMPONENT_SUBTYPE + "' is not defined in default template.");
        ComponentType componentType = new ComponentType(type, subtype);
        COMPONENT_TYPE_CACHE.put(resourceTypeName, componentType);
        return componentType;
    }
View Full Code Here

TOP

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

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.