Examples of PluginMetadataManager


Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

        // This is an exception for PC unit tests which use a fake platform type.
        if (resourceType.equals(PluginMetadataManager.TEST_PLATFORM_TYPE)) {
            return null;
        }

        PluginMetadataManager metadataManager = pluginManager.getMetadataManager();
        String className = metadataManager.getDiscoveryClass(resourceType);
        String typeName = resourceType.getName();
        String pluginName = resourceType.getPlugin();

        if (log.isDebugEnabled()) {
            log.debug("Creating discovery component [" + className + "] for resource type [" + typeName + ']');
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

                    + "] plugin descriptors are valid.");
            } else {
                LOG.info("All [" + finder.findPlugins().size() + "] plugin descriptors are valid.");
            }

            PluginMetadataManager metadataManager = manager.getMetadataManager();

            // examine all the resource types defined in all plugins and validate some things about them
            for (ResourceType resourceType : metadataManager.getAllTypes()) {
                PluginEnvironment pluginEnvironment = manager.getPlugin(resourceType.getPlugin());

                LOG.info("Validating resource type [" + resourceType.getName() + "] from plugin ["
                    + resourceType.getPlugin() + "]...");
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

                "Could not enrich the test class with the discovered resources on field " + f, e);
        }
    }

    private ResourceType getResourceType(String pluginName, String resourceTypeName) {
        PluginMetadataManager pmm = getPluginContainer().getPluginManager().getMetadataManager();
        ResourceType resourceType = pmm.getType(resourceTypeName, pluginName);
       
        if (resourceType == null) {
            throw new IllegalArgumentException("No resource type called '" + resourceTypeName + "' found in plugin '" + pluginName + "'.");
        }
       
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

       
        return resourceType;
    }
   
    private Class<?> getResourceComponentClass(ResourceType resourceType) {
        PluginMetadataManager pmm = getPluginContainer().getPluginManager().getMetadataManager();
               
        String componentClassName;
        try {
            componentClassName = pmm.getComponentClass(resourceType);
        } catch (ResourceTypeNotEnabledException rtne) {
            throw new RuntimeException(rtne);
        }

        try {
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    @BeforeTest
    protected void before() throws Exception {

        InputStream is = getClass().getResourceAsStream("/META-INF/rhq-plugin.xml");
        PluginDescriptor pd = AgentPluginDescriptorUtil.parsePluginDescriptor(is);
        PluginMetadataManager pmm = new PluginMetadataManager();
        pmm.addTestPlatformType();
        Set<ResourceType> rts = pmm.loadPlugin(pd);
        ResourceType resourceType = rts.iterator().next();
        configuration = resourceType.getPluginConfigurationDefinition().getDefaultTemplate().createConfiguration();

        setConfiguration();
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    public void testConfigurationDefinition()
            throws Exception
    {
        LOG.info("########################  Running testConfigurationDefinition()");
        PluginContainer pluginContainer = PluginContainer.getInstance();
        PluginMetadataManager metadataManager = pluginContainer.getPluginManager().getMetadataManager();
        ResourceType noTxDatasourceResourceType =
                metadataManager.getType("No Transaction", ResourceCategory.SERVICE);


        ConfigurationDefinition noTxConfigurationDefinition = noTxDatasourceResourceType.getResourceConfigurationDefinition();

        assert noTxConfigurationDefinition != null : "Configuration definition could not be read for no-tx-datasource";
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

         System.out.println("Loading plugin descriptor at: " + descriptorUrl);

         pluginDescriptor = AgentPluginDescriptorUtil.parsePluginDescriptor(descriptorUrl
             .openStream());

         PluginMetadataManager metadataManager = new PluginMetadataManager();
         Set<ResourceType> typeSet = metadataManager.loadPlugin(pluginDescriptor);
         assert typeSet != null : "Got no types!!";
         assert typeSet.size()==5 : "Expected 5 types, but got " + typeSet.size();

         ResourceType testService = findType(typeSet,"testService");
         assert testService.getSubCategory().equals("applications");
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    @BeforeClass
    public void beforeClass() {
        try {
            System.out.println("~~~~~ START " + SelfReferencingPluginTest.class.getName() + " ~~~~~");
            this.metadataManager = new PluginMetadataManager();
        } catch (Throwable t) {
            // Catch RuntimeExceptions and Errors and dump their stack trace, because Surefire will completely swallow them
            // and throw a cryptic NPE (see http://jira.codehaus.org/browse/SUREFIRE-157)!
            t.printStackTrace();
            throw new RuntimeException(t);
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    @BeforeClass
    public void beforeClass() {
        try {
            System.out.println("~~~~~ START " + OptionalPluginTest.class.getName() + " ~~~~~");
            this.metadataManager = new PluginMetadataManager();
        } catch (Throwable t) {
            // Catch RuntimeExceptions and Errors and dump their stack trace, because Surefire will completely swallow them
            // and throw a cryptic NPE (see http://jira.codehaus.org/browse/SUREFIRE-157)!
            t.printStackTrace();
            throw new RuntimeException(t);
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    private PluginMetadataManager metadataManager;

    @BeforeClass
    public void beforeClass() {
        try {
            this.metadataManager = new PluginMetadataManager();

            List<String> disabledTypes = new ArrayList<String>();
            disabledTypes.add("Test1>Server A>Service B"); // from DESCRIPTOR_FILENAME_TEST1
            disabledTypes.add("Test1>Server A>Service D>Dependent Service E"); // from DESCRIPTOR_FILENAME_TEST1
            disabledTypes.add("Test2>Extension Service C"); // from DESCRIPTOR_FILENAME_TEST2
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.