Package org.rhq.core.pluginapi.inventory

Examples of org.rhq.core.pluginapi.inventory.ResourceComponent


        }
    }

    @SuppressWarnings("rawtypes")
    private void loadResourceMetrics(Resource resource) throws Exception {
        ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
            .getResourceComponent(resource);

        if (resourceComponent instanceof MeasurementFacet) {
            for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
                Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
View Full Code Here


        }
    }

    @SuppressWarnings("rawtypes")
    private void executeOperation(Resource resource, String operationName, Configuration config) throws Exception {
        ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
            .getResourceComponent(resource);

        OperationResult result = ((OperationFacet) resourceComponent).invokeOperation(operationName, config);

        if (result != null) {
View Full Code Here

        Resource resource = new Resource();
        resource.setResourceType(resourceType);
        resource.setUuid(UUID.randomUUID().toString());

        resource.setPluginConfiguration(configuration);
        ResourceComponent parentResourceComponent = null;
        ResourceContext<?> parentResourceContext = null;
        ResourceDiscoveryComponent resourceDiscoveryComponent = new NothingDiscoveringDiscoveryComponent();
        SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
        File temporaryDirectory = temp;
        File dataDirectory = temp;
View Full Code Here

            assert e instanceof SQLException;
            assert e.getCause().getClass().getName().equals("com.mysql.jdbc.exceptions.jdbc4.CommunicationsException");
            return; // can't proceed with test in this non-mysql env
        }

        ResourceComponent resourceComponent = getComponent("MySql Server");
        //        assertUp(resource); // TODO this requires a running mysql server
        assert resourceComponent != null;
    }
View Full Code Here

        cresource.setParentResource(resource);
        cresource.setName(drd.getResourceName());
        cresource.setVersion(drd.getResourceVersion());

        String rclassname = pmm.getComponentClass(type);
        ResourceComponent component = (ResourceComponent) Class.forName(rclassname).newInstance();

        availabilityContext = new AvailabilityContextImpl(cresource, pluginContainer.getInventoryManager());
        inventoryContext = new InventoryContextImpl(cresource, pluginContainer.getInventoryManager());

        EventContext eventContext = new EventContextImpl(resource, eventManager);
        ResourceContext context = new ResourceContext(cresource, parentComponent,
                null, rdc, systemInfo, temporaryDirectory, dataDirectory,
                pluginContainerName, eventContext, operationContext, contentContext,
                availabilityContext, inventoryContext, pluginContainerDeployment);

        component.start(context);
        components.put(component, cresource);
        resources(type.getChildResourceTypes(), cresource, component, context);
        return component;
    }
View Full Code Here

        cresource.setParentResource(resource);
        cresource.setName(drd.getResourceName());
        cresource.setVersion(drd.getResourceVersion());

        String rclassname = pmm.getComponentClass(type);
        ResourceComponent component = (ResourceComponent) Class.forName(rclassname).newInstance();

        AvailabilityContext availContext = new AvailabilityContextImpl(cresource, pluginContainer.getInventoryManager());
        InventoryContext inventoryContext = new InventoryContextImpl(cresource, pluginContainer.getInventoryManager());

        EventContext eventContext = new EventContextImpl(resource, eventManager);
        ResourceContext context = new ResourceContext(cresource, parentComponent,
                null, rdc, systemInfo, temporaryDirectory, dataDirectory,
                pluginContainerName, eventContext, operationContext, contentContext,
                availContext, inventoryContext,pluginContainerDeployment);

        component.start(context);
        components.put(component, cresource);
        resources(type.getChildResourceTypes(), cresource, component, context);
        return component;
    }
View Full Code Here

        configuration.setSimpleValue(VALIDATE_RESPONSE_PATTERN, "success");
        MergeResourceResponse response = getInventoryManager().manuallyAddResource(
            getPluginManager().getMetadataManager().getType(SERVICE_NAME, PLUGIN_NAME), getPlatform().getId(),
            configuration, -1);
        assertNotNull(response, "Manual add response is null");
        @SuppressWarnings("rawtypes")
        ResourceComponent resourceComponent = getInventoryManager().getResourceContainer(response.getResourceId())
            .getResourceComponent();
        assertEquals(resourceComponent.getClass(), HTTPNetServiceComponent.class);
        httpNetServiceComponent = (HTTPNetServiceComponent) resourceComponent;
    }
View Full Code Here

        configuration.setSimpleValue(ConfigKeys.PORT, String.valueOf(serverSocketLocalPort));
        MergeResourceResponse response = getInventoryManager().manuallyAddResource(
            getPluginManager().getMetadataManager().getType(SERVICE_NAME, PLUGIN_NAME), getPlatform().getId(),
            configuration, -1);
        assertNotNull(response, "Manual add response is null");
        @SuppressWarnings("rawtypes")
        ResourceComponent resourceComponent = getInventoryManager().getResourceContainer(response.getResourceId())
            .getResourceComponent();
        assertEquals(resourceComponent.getClass(), PortNetServiceComponent.class);
        portNetServiceComponent = (PortNetServiceComponent) resourceComponent;
    }
View Full Code Here

        configuration.setSimpleValue(ConfigKeys.ADDRESS, LOOPBACK);
        MergeResourceResponse response = getInventoryManager().manuallyAddResource(
            getPluginManager().getMetadataManager().getType(SERVICE_NAME, PLUGIN_NAME), getPlatform().getId(),
            configuration, -1);
        assertNotNull(response, "Manual add response is null");
        @SuppressWarnings("rawtypes")
        ResourceComponent resourceComponent = getInventoryManager().getResourceContainer(response.getResourceId())
            .getResourceComponent();
        assertEquals(resourceComponent.getClass(), PingNetServiceComponent.class);
        pingNetServiceComponent = (PingNetServiceComponent) resourceComponent;
    }
View Full Code Here

         * A discovered resource must have a unique key, that must
         * stay the same when the resource is discovered the next
         * time
         */

        ResourceComponent parent = discoveryContext.getParentResourceComponent();
        StandaloneASComponent parentComponent = (StandaloneASComponent) parent;
        File homeDir = parentComponent.getServerPluginConfiguration().getHomeDir();
        if (homeDir==null || !homeDir.exists()) {
            return Collections.EMPTY_SET;
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.inventory.ResourceComponent

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.