Package org.rhq.core.pluginapi.inventory

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


        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;
        String pluginContainerName = "rhq";
        EventContext eventContext = new EventContextImpl(resource, eventManager);
View Full Code Here


     * Manually create a component by resource type, configuration, parent.
     */
    public ResourceComponent manuallyAdd(ResourceType type, Configuration configuration, ResourceComponent parent) throws Exception {
        DiscoveredResourceDetails drd = new DiscoveredResourceDetails(type,
                "key", "name", "ver", "desc", configuration, (ProcessInfo) null);
        ResourceDiscoveryComponent c = null;
        return createChild(drd, platform, configuration, parent, c);
    }
View Full Code Here

        for (ResourceType type : types) {
            String s = pmm.getDiscoveryClass(type);
            if (s == null) {
                throw new NullPointerException("no discovery " + type);
            }
            ResourceDiscoveryComponent rdc = (ResourceDiscoveryComponent) Class.forName(s).newInstance();
            log.debug("rdc=" + rdc);
            ResourceDiscoveryContext resourceDiscoveryContext = new ResourceDiscoveryContext(type, component,
                    context, systemInfo,
                    performProcessScans(type), new ArrayList<Configuration>(),
                    pluginContainerName, pluginContainerDeployment);
            Set<DiscoveredResourceDetails> drds = rdc.discoverResources(resourceDiscoveryContext);
            for (DiscoveredResourceDetails drd : drds) {
                log.debug("discovered " + drd);
                ResourceType resourceType = drd.getResourceType();
                setConfiguration(drd.getPluginConfiguration(), resourceType);
                createChild(drd, parent, drd.getPluginConfiguration(), component, rdc);
View Full Code Here

     * Manually create a component by resource type, configuration, parent.
     */
    public ResourceComponent manuallyAdd(ResourceType type, Configuration configuration, ResourceComponent parent) throws Exception {
        DiscoveredResourceDetails drd = new DiscoveredResourceDetails(type,
                "key", "name", "ver", "desc", configuration, (ProcessInfo) null);
        ResourceDiscoveryComponent c = null;
        return createChild(drd, platform, configuration, parent, c);
    }
View Full Code Here

        for (ResourceType type : types) {
            String s = pmm.getDiscoveryClass(type);
            if (s == null) {
                throw new NullPointerException("no discovery " + type);
            }
            ResourceDiscoveryComponent rdc = (ResourceDiscoveryComponent) Class.forName(s).newInstance();
            log.debug("rdc=" + rdc);
            List<Configuration> configList = new ArrayList<Configuration>();
            ResourceDiscoveryContext resourceDiscoveryContext = new ResourceDiscoveryContext(type, component,
                    context, systemInfo,
                    performProcessScans(type), configList,
                    pluginContainerName, pluginContainerDeployment);
            Set<DiscoveredResourceDetails> drds = rdc.discoverResources(resourceDiscoveryContext);
            for (DiscoveredResourceDetails drd : drds) {
                log.debug("discovered " + drd);
                ResourceType resourceType = drd.getResourceType();
                setConfiguration(drd.getPluginConfiguration(), resourceType);
                createChild(drd, parent, drd.getPluginConfiguration(), component, rdc);
View Full Code Here

            ResourceContext<?> parentResourceContext = null;

            components.put(component, resource);
            resource.setParentResource(pluginContainer.getInventoryManager().getPlatform());

            ResourceDiscoveryComponent resourceDiscoveryComponent = new NothingDiscoveringDiscoveryComponent();
            EventContext eventContext = new EventContextImpl(resource, eventManager);
            AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
            InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
            ResourceContext context = new ResourceContext(resource, parentResourceComponent, parentResourceContext,
                resourceDiscoveryComponent, systemInfo, temporaryDirectory, dataDirectory, pluginContainerName,
View Full Code Here

            .createConfiguration();
        setConfiguration(configuration, resourceType);
        log.info("childResource " + resourceType + " properties " + configuration.getProperties());

        String s = pmm.getDiscoveryClass(resourceType);
        ResourceDiscoveryComponent rdc = (ResourceDiscoveryComponent) Class.forName(s).newInstance();
        log.debug("rdc=" + rdc);

        EventContext eventContext = new EventContextImpl(resource, eventManager);
        AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
        InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
        ResourceContext context = new ResourceContext(resource, component, parentContext, resourceDiscoveryComponent,
            systemInfo, temporaryDirectory, dataDirectory, pluginContainerName, eventContext, operationContext,
            contentContext, availContext, inventoryContext, pluginContainerDeployment);
        ResourceDiscoveryContext resourceDiscoveryContext = new ResourceDiscoveryContext(resourceType, component,
            context, systemInfo, Collections.emptyList(), Collections.emptyList(), pluginContainerName,
            pluginContainerDeployment);
        Assert.assertNotNull(context.getEventContext());
        Set<DiscoveredResourceDetails> d = rdc.discoverResources(resourceDiscoveryContext);
        for (DiscoveredResourceDetails drd : d) {
            log.debug("discovered " + drd);
            createChild(drd, resource, configuration, component, context);
        }
View Full Code Here

TOP

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

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.