Package org.rhq.core.pluginapi.configuration

Examples of org.rhq.core.pluginapi.configuration.ConfigurationFacet.loadResourceConfiguration()


        System.out.println("=== Loading Resource config for " + resource + "...");
        ResourceContainer resourceContainer = this.pluginContainer.getInventoryManager().getResourceContainer(resource);
        long timeoutMillis = 5000;
        ConfigurationFacet configurationFacet = resourceContainer.createResourceComponentProxy(
            ConfigurationFacet.class, FacetLockType.READ, timeoutMillis, false, false, false);
        return configurationFacet.loadResourceConfiguration();
    }

    @NotNull
    protected ConfigurationUpdateReport updateResourceConfiguration(Resource resource, Configuration resourceConfig)
        throws Exception {
View Full Code Here


                        if (debugEnabled) {
                            log.debug("Checking for updated Resource configuration for " + resource + "...");
                        }

                        try {
                            Configuration liveConfiguration = resourceComponent.loadResourceConfiguration();

                            if (liveConfiguration != null) {
                                ConfigurationDefinition configurationDefinition = resourceType
                                    .getResourceConfigurationDefinition();
View Full Code Here

    private Configuration loadConfigFromFacet(int resourceId, FacetLockType lockType) throws PluginContainerException {
        ConfigurationFacet configFacet = loadConfigurationFacet(resourceId, lockType);

        try {
            return configFacet.loadResourceConfiguration();
        } catch (Exception e) {
            throw new PluginContainerException(e);
        }
    }
View Full Code Here

    public void testProcessInfoAccurateAfterProcessRestart() throws Exception {
        Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
       
        ConfigurationFacet component = components.iterator().next();
       
        Configuration config = component.loadResourceConfiguration();
       
        int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
        int beforePid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        stopTestProcess();  
View Full Code Here

        int beforePid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        stopTestProcess();  
        startTestProcess();
       
        config = component.loadResourceConfiguration();
       
        int afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
        int afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount + 1, "Only a single discovery call should have been made to refresh the process info");
View Full Code Here

    public void testProcessInfoAccurateWhenProcessStopped() throws Exception {
        Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
       
        ConfigurationFacet component = components.iterator().next();
       
        Configuration config = component.loadResourceConfiguration();
       
        int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
       
        stopTestProcess();  
       
View Full Code Here

       
        int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
       
        stopTestProcess();  
       
        config = component.loadResourceConfiguration();
       
        int afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
        int afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount, "No discovery call should have been made to refresh the process info if the process no longer exists");
View Full Code Here

    public void testProcessInfoAccurateAfterProcessStarted() throws Exception {
        Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
       
        ConfigurationFacet component = components.iterator().next();
       
        Configuration config = component.loadResourceConfiguration();
       
        int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
       
        stopTestProcess();  
       
View Full Code Here

       
        int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
       
        stopTestProcess();  
       
        config = component.loadResourceConfiguration();
       
        int afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
        int afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount, "No discovery call should have been made to refresh the process info if the process no longer exists");
View Full Code Here

        Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount, "No discovery call should have been made to refresh the process info if the process no longer exists");
        Assert.assertEquals(afterPid, 0, "The process info should have been nulled out")
       
        startTestProcess();

        config = component.loadResourceConfiguration();
       
        afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
        afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
       
        Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount + 1, "Exactly 1 discovery call should have been made to refresh the process info after the process started again.");
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.