Package org.jboss.deployers.spi.management

Examples of org.jboss.deployers.spi.management.ManagementView


   @Override
   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");
      }
      String homeDir = (String) ((SimpleValue) mc.getProperty("serverHomeDir").getValue()).getValue();
      if (homeDir == null)
      {
         throw new IllegalStateException("No serverHomeDir for node0 available");
      }
     
      this.farm0Dir = new File(homeDir, "farm");   
     
      mgtView = getManagementView(getNamingContext(1));
      mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
      if (mc == null)
      {
         throw new IllegalStateException("No ServerConfig for node1 available");
      }
      homeDir = (String) ((SimpleValue) mc.getProperty("serverHomeDir").getValue()).getValue();
View Full Code Here


            status = progress.getDeploymentStatus();
            assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
            assertFalse("DeploymentStatus.isRunning: " + status, status.isRunning());
            assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());
            // Check for a
            ManagementView mgtView = getManagementView(getNamingContext(0));
            ManagedDeployment deployment = mgtView.getDeployment(uploadedNames[0]);
            assertNotNull(deployment);
            getLog().info("Found " + type + " deployment: " + deployment);
            Set<String> types = deployment.getTypes();
            if (types != null && types.isEmpty() == false)
               assertTrue("Missing type: " + type + ", available: " + types, types.contains(type));
View Full Code Here

      super(name);
   }
  
   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);
     
      this.farmDir = new File(homeDir, "farm");     
View Full Code Here

      assertFalse(((CompositeValue) mapValue).containsKey("tcp-async"));
   }

   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

            } else {
              throw new RuntimeException("Did not find Deployment " + fullFileName);         
            }
        }

        ManagementView mView = profileServiceConnection.getManagementView();
        mView.load();
       
        jbossASComponent.disconnectFromProfileService();
   }
View Full Code Here

    }

    public void testManagedPropertiesByType()
    {

        ManagementView mgtView = getCurrentProfileView();
        try
        {
            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

    }

    public void testReadDatasourceFromManagementView()
            throws Exception
    {
        ManagementView mgtView = getCurrentProfileView();
        Set<ManagedComponent> components = mgtView.getComponentsForType(KnownComponentTypes.DataSourceTypes.LocalTx.getType());
        assert components != null : "Components was returned as null";
        assert components.size() > 0;

        for (ManagedComponent comp : components)
        {
View Full Code Here

    }

    public void testReadJMSFromManagementView()
            throws Exception
    {
        ManagementView mgtView = getCurrentProfileView();
        Set<ManagedComponent> components = mgtView.getComponentsForType(KnownComponentTypes.JMSDestination.Queue.getType());
        assert components != null : "Components was returned as null";
        assert components.size() > 0;

        for (ManagedComponent comp : components)
        {
View Full Code Here

    }

    public void testReadDLQJMSFromManagementView()
            throws Exception
    {
        ManagementView mgtView = getCurrentProfileView();
        ManagedComponent comp = mgtView.getComponent("/queue/DLQ", KnownComponentTypes.JMSDestination.Queue.getType());
        assert comp != null : "Comp was returned as null";
        assert comp.getName().equals("/queue/DLQ") : "Did not find DLQ Destintion";

    }
View Full Code Here

    }

    private static ManagementView getCurrentProfileView()
    {
        ProfileService profileService = getProfileService();
        ManagementView currentProfileView = profileService.getViewManager();
        String[] domains = profileService.getDomains();

        ProfileKey defaultKey = new ProfileKey(domains[0]);

        try
        {
            currentProfileView.loadProfile(defaultKey);
        }
        catch (Exception e)
        {
            LOG.error("Could not find default Profile in Current Profile View", e);
        }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.management.ManagementView

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.