Examples of ResourceComponent


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

    }

    @Test(enabled = false)
    // TODO GH: Disable until we fix the natives integration for sigar
    private void testResourceMeasurement(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>();
                metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType()));
View Full Code Here

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

        Resource platform = PluginContainer.getInstance().getInventoryManager().getPlatform();
        for (Resource server : platform.getChildResources()) {
            List<Resource> services = new ArrayList<Resource>(server.getChildResources());
            Collections.sort(services);
            for (Resource service : services) {
                ResourceComponent serviceComponent = PluginContainer.getInstance().getInventoryManager()
                    .getResourceComponent(service);
                if (serviceComponent instanceof MeasurementFacet) {
                    Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
                    metricList.add(new MeasurementScheduleRequest(1, "numbackends", 1000, true, DataType.MEASUREMENT));
                    MeasurementReport report = new MeasurementReport();
View Full Code Here

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

        setupData(db);

        // Pooling < Non Pooling < Pooling hierarchy

        ResourceComponent level1 = add("Generic Query", db);
        assertUp(level1);
        checkAllMetrics("Generic Query", level1);

        ResourceComponent level2 = add("Generic Query Non Pooling", level1);
        assertUp(level2);
        checkAllMetrics("Generic Query Non Pooling", level2);

        ResourceComponent level3 = add("Nested Generic Query", level2);
        assertUp(level3);
        checkAllMetrics("Generic Query Non Pooling", level3);

        checkData(db);
    }
View Full Code Here

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

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

        }
    }

    @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

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

        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

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

            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

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

        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

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

        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

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

        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
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.