Package org.rhq.core.pc.inventory

Examples of org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation


        assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
        for (Resource res : resources) {
            assertTrue(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
                + " doesn't seem to be upgraded even though it should.");

            ResourceContainer rc = PluginContainer.getInstance().getInventoryManager().getResourceContainer(res);

            assertEquals(rc.getResourceComponentState(), ResourceContainer.ResourceComponentState.STARTED,
                "A resource that successfully upgraded should be started.");
        }
    }
View Full Code Here


        for(Resource res : resources) {
            assertFalse(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
                + " seems to be upgraded even though it shouldn't.");

            InventoryManager im = PluginContainer.getInstance().getInventoryManager();
            ResourceContainer rc = im.getResourceContainer(res);

            assertEquals(rc.getResourceComponentState(), ResourceContainer.ResourceComponentState.STOPPED,
                "A resource that has not been upgraded due to upgrade error in parent should be stopped.");

            //recurse, since the whole subtree under the failed resource should be not upgraded and stopped.
            Set<Resource> children = im.getContainerChildren(res, rc);
            checkResourcesNotUpgraded(children, children.size());
View Full Code Here

        assertFalse(resource.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + resource
            + " seems to be upgraded even though it shouldn't.");
        assertTrue(resource.getResourceErrors(ResourceErrorType.UPGRADE).size() == 1,
            "The failed resource should have an error associated with it.");

        ResourceContainer rc = PluginContainer.getInstance().getInventoryManager().getResourceContainer(resource);

        assertEquals(rc.getResourceComponentState(), ResourceContainer.ResourceComponentState.STOPPED,
            "A resource that failed to upgrade should be stopped.");
    }
View Full Code Here

        assertEquals(discoveredResource.getResourceKey(), "resource-key-v2");
        assertEquals(discoveredResource.getName(), "resource-name-v2");
        assertEquals(discoveredResource.getDescription(), "resource-description-v2");
        assertEquals(discoveredResource.getPluginConfiguration().getSimpleValue("test-property"), "test-property-v2");

        ResourceContainer container = PluginContainer.getInstance().getInventoryManager()
            .getResourceContainer(discoveredResource);
        File dataDir = container.getResourceContext().getDataDirectory();

        File marker = new File(dataDir, "upgrade-succeeded");

        assertFalse(marker.exists(),
            "The upgrade seems to have occured even though there shouldn't have been a resource to upgrade.");
View Full Code Here

        pluginContainer.initialize();
        eventManager = pluginContainer.getEventManager();
        platform = pluginContainer.getInventoryManager().getPlatform();
        platformContainer = pluginContainer.getInventoryManager().getResourceContainer(platform);
        if (platformContainer == null) {
            platformContainer = new ResourceContainer(platform, getClass().getClassLoader());
        }
    }
View Full Code Here

        pluginContainer.initialize();
        eventManager = pluginContainer.getEventManager();
        platform = pluginContainer.getInventoryManager().getPlatform();
        platformContainer = pluginContainer.getInventoryManager().getResourceContainer(platform);
        if (platformContainer == null) {
            platformContainer = new ResourceContainer(platform, getClass().getClassLoader());
        }
    }
View Full Code Here

        assertNotNull(operationDefinition);
        return operationDefinition;
    }

    private OperationFacet getOperationFacet(Resource resource) {
        ResourceContainer resourceContainer = pluginContainer.getInventoryManager().getResourceContainer(resource);
        try {
            return resourceContainer.createResourceComponentProxy(OperationFacet.class, FacetLockType.WRITE,
                SECONDS.toMillis(5), false, false, false);
        } catch (PluginContainerException e) {
            return null;
        }
    }
View Full Code Here

                        report.getTraitData()));
        }
    }

    private MeasurementFacet getMeasurementFacet(Resource resource) {
        ResourceContainer resourceContainer = pluginContainer.getInventoryManager().getResourceContainer(resource);
        try {
            return resourceContainer.createResourceComponentProxy(MeasurementFacet.class, FacetLockType.READ,
                SECONDS.toMillis(5), false, false, false);
        } catch (PluginContainerException e) {
            return null;
        }
    }
View Full Code Here

    private Resource getDeploymentResource() {
        return deployment;
    }

    private OperationFacet getOperationFacet(Resource resource) {
        ResourceContainer resourceContainer = pluginContainer.getInventoryManager().getResourceContainer(resource);
        try {
            return resourceContainer.createResourceComponentProxy(OperationFacet.class, FacetLockType.WRITE,
                SECONDS.toMillis(5), false, false, false);
        } catch (PluginContainerException e) {
            return null;
        }
    }
View Full Code Here

        assertNotNull(response, "Manual add response is null");

        jmxServerResourceId = response.getResourceId();

        ResourceContainer resourceContainer = getInventoryManager().getResourceContainer(jmxServerResourceId);
        @SuppressWarnings("rawtypes")
        ResourceComponent resourceComponent = resourceContainer.getResourceComponent();

        assertEquals(resourceComponent.getClass(), JMXServerComponent.class);

        jmxServerComponent = (JMXServerComponent) resourceComponent;
        jmxServerResource = resourceContainer.getResource();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation

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.