Examples of InventoryManager


Examples of org.rhq.core.pc.inventory.InventoryManager

    public void run() {
        call();
    }

    public Object call() {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        Resource platform = inventoryManager.getPlatform();
        List<Resource> eligibleRoots = getEligibleRoots(platform);

        if (eligibleRoots.isEmpty()) {
            log.debug("Skipping configuration update check, no eligible roots.");
            return null;
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        // this package deployment
        if (response.getOverallRequestResult() == ContentResponseResult.SUCCESS) {

            try {
                ResourceType resourceType = ComponentUtil.getResourceType(request.getResourceId());
                InventoryManager inventoryManager = contentManager.getInventoryManager();

                if (executeServerScan(resourceType)) {
                    inventoryManager.executeServerScanImmediately();
                }

                // Always execute a service scan
                inventoryManager.executeServiceScanImmediately();
            } catch (Throwable throwable) {
                log.warn("Error occurred on resource discovery request" + throwable);
            }
        }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

            if (!updatedSchedule.getDriftDefinition().isPinned()) {
                unpinDefinition(updatedSchedule);
            }
        }

        InventoryManager inventoryMgr = PluginContainer.getInstance().getInventoryManager();
        ResourceContainer container = inventoryMgr.getResourceContainer(resourceId);
        if (container != null) {
            container.addDriftDefinition(driftDefinition);
        }

        if(driftDefinition.getInterval() < pluginContainerConfiguration.getDriftDetectionPeriod()) {
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        ResourceType resourceType = getResourceType(pluginName, resourceTypeName);
        Class<?> componentClass = getResourceComponentClass(resourceType);
       
        if (hasType(f, Set.class, componentClass)) {               
            InventoryManager im = getPluginContainer().getInventoryManager();
            Set<Resource> resources = im.getResourcesWithType(resourceType);
           
            Set<ResourceComponent<?>> components = new HashSet<ResourceComponent<?>>(resources.size());
            for(Resource r : resources) {
                components.add(im.getResourceComponent(r));
            }
           
            f.setAccessible(true);
            try {
                f.set(testCase, components);
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

     *
     * @throws PluginContainerException if the Resource is not known
     */
    @SuppressWarnings("unchecked")
    public static ResourceType getResourceType(int resourceId) throws PluginContainerException {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();

        // get the resource container that wraps the given resource
        ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId);
        if (resourceContainer == null) {
            throw new PluginContainerException("Resource component container could not be retrieved for resource: "
                + resourceId);
        }

View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

     * @see    ResourceContainer#createResourceComponentProxy(Class, FacetLockType, long, boolean, boolean, boolean)
     */
    @SuppressWarnings("unchecked")
    public static <T> T getComponent(int resourceId, Class<T> facetInterface, FacetLockType lockType, long timeout,
        boolean daemonThread, boolean onlyIfStarted, boolean transferInterrupt) throws PluginContainerException {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId);
        if (resourceContainer == null) {
            throw new PluginContainerException("Resource component container could not be retrieved for resource: "
                + resourceId);
        }
        return resourceContainer.createResourceComponentProxy(facetInterface, lockType, timeout, daemonThread,
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

            ResourceContainer.initialize(configuration);

            PluginLifecycleListenerManager pluginLifecycle = new PluginLifecycleListenerManagerImpl();
            pluginManager = new PluginManager(configuration, pluginLifecycle);
            inventoryManager = new InventoryManager(configuration, agentServiceStreamRemoter, pluginManager);
            inventoryManager.initialize();
            eventManager = inventoryManager.getEventManager();
            eventManager.initialize();
            operationManager = inventoryManager.getOperationManager();
            measurementManager = inventoryManager.getMeasurementManager();
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        ClassLoader originalCL = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
            ClassLoaderManager clm = this.pluginContainer.getPluginManager().getClassLoaderManager();
            InventoryManager im = this.pluginContainer.getInventoryManager();
            classloaders = clm.getResourceClassLoaders();
            for (CanonicalResourceKey canonicalId : classloaders.keySet()) {
                ResourceContainer container = im.getResourceContainer(canonicalId);
                String[] nameId = new String[3];
                if (container != null) {
                    nameId[0] = container.getResource().getName();
                    nameId[1] = Integer.toString(container.getResource().getId());
                    nameId[2] = container.getResource().getUuid();
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

     */
    public static void startConfiguredPluginContainer() {
        PluginContainer.getInstance().setConfiguration(getCurrentPluginContainerConfiguration());
        PluginContainer.getInstance().initialize();

        InventoryManager im = PluginContainer.getInstance().getInventoryManager();
        for (int i = 0; i < CURRENT_SETUP.get().numberOfInitialDiscoveries(); ++i) {
            im.executeServerScanImmediately();
            im.executeServiceScanImmediately();
        }
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

    }

    private void configureApacheServerToUseAugeas() throws Exception {
        ResourceTypes resourceTypes = new ResourceTypes(PluginLocation.APACHE_PLUGIN);

        InventoryManager im = PluginContainer.getInstance().getInventoryManager();

        ResourceContainer apacheServer = findApacheServerResource();

        Configuration config = apacheServer.getResourceContext().getPluginConfiguration();

        config.getSimple("augeasEnabled").setValue("yes");

        im.updatePluginConfiguration(apacheServer.getResource().getId(), config);

        //and run discovery so that the new resources can go into inventory

        im.executeServiceScanImmediately();
    }
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.