Examples of PluginComponentFactory


Examples of org.rhq.core.pc.plugin.PluginComponentFactory

        this.configuration = configuration;
        if (pluginManager == null) {
            throw new NullPointerException("pluginManager is null");
        }
        this.pluginManager = pluginManager;
        pluginFactory = new PluginComponentFactory(this, pluginManager);
        eventManager = new EventManager(configuration);
        operationManager = new OperationManager(configuration, getStreamRemoter());
        measurementManager = new MeasurementManager(configuration, getStreamRemoter(), this);
        contentManager = new ContentManager(configuration, getStreamRemoter(), this);
        availabilityExecutor = new AvailabilityExecutor(this);
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginComponentFactory

        }

        // funnel the results through the discovery callbacks that are defined on the discovered resource type
        // we do them one discovered resource details as a time, giving each callback the opportunity to handle each
        ResourceDiscoveryCallback.DiscoveryCallbackResults callbackResults;
        PluginComponentFactory pluginComponentFactory = PluginContainer.getInstance().getPluginComponentFactory();
        ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();

        for (Iterator<DiscoveredResourceDetails> detailsIterator = results.iterator(); detailsIterator.hasNext();) {
            DiscoveredResourceDetails details = detailsIterator.next();
            int callbackCount = 0;
            boolean stopProcessing = false; // if true, a callback told us he found a details that he modified and we should stop
            boolean abortDiscovery = false; // if true, multiple callbacks claimed ownership which isn't allowed - its discovery will be aborted
            boolean vetoDiscovery = false; // if true, a callback veto'ed the resource - it should not be discovered at all
            for (Map.Entry<String, List<String>> entry : callbacks.entrySet()) {
                String pluginName = entry.getKey();
                List<String> callbackClassNames = entry.getValue();
                for (String className : callbackClassNames) {
                    ResourceDiscoveryCallback callback = pluginComponentFactory.getDiscoveryCallback(pluginName,
                        className);
                    try {
                        Thread.currentThread().setContextClassLoader(callback.getClass().getClassLoader());
                        callbackResults = callback.discoveredResources(details);// inline in our calling thread - no time outs or anything; hopefully the plugin plays nice
                        callbackCount++;
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginComponentFactory

        try {
            ResourceContainer parentResourceContainer = getResourceContainer(parentResourceId);
            ResourceComponent parentResourceComponent = parentResourceContainer.getResourceComponent();

            // Get the discovery component responsible for discovering resources of the specified resource type.
            PluginComponentFactory pluginComponentFactory = PluginContainer.getInstance().getPluginComponentFactory();
            ResourceDiscoveryComponent discoveryComponent = pluginComponentFactory.getDiscoveryComponent(resourceType,
                parentResourceContainer);

            DiscoveredResourceDetails discoveredResourceDetails;
            if (discoveryComponent instanceof ManualAddFacet) {
                // The plugin is using the new manual add API.
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginComponentFactory

                } catch (UnsupportedOperationException uoe) {
                    // don't worry if we do not have a native library to support process scans
                }
            }

            PluginComponentFactory componentFactory = PluginContainer.getInstance().getPluginComponentFactory();
            InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
            ResourceContainer platformContainer = inventoryManager.getResourceContainer(inventoryManager.getPlatform());
            ResourceComponent platformComponent = inventoryManager.getResourceComponent(inventoryManager.getPlatform());
            ResourceDiscoveryComponent discoveryComponent = componentFactory.getDiscoveryComponent(resourceType,
                platformContainer);

            ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, platformComponent,
                platformContainer.getResourceContext(), systemInfo, scanResults, Collections.EMPTY_LIST, pcName,
                PluginContainerDeployment.AGENT);
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginComponentFactory

                log.debug("Availability of [" + parent + "] is not UP, cannot perform service scan on it.");
            }
            return;
        }

        PluginComponentFactory factory = inventoryManager.getPluginComponentFactory();

        try {

            for (ResourceType childResourceType : childResourceTypes) {
                // Make sure we have a discovery component for that type, otherwise there is nothing to do
                ResourceDiscoveryComponent discoveryComponent = null;
                try {
                    discoveryComponent = factory.getDiscoveryComponent(childResourceType, parentContainer);
                } catch (ResourceTypeNotEnabledException rtne) {
                    if (log.isDebugEnabled()) {
                        log.debug("Resource not discoverable, type is disabled: " + childResourceType);
                    }
                    continue; // do not discovery anything for this component
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginComponentFactory

    @SuppressWarnings("unchecked")
    private void pluginDiscovery(InventoryReport report, List<ProcessInfo> processInfos) {
        inventoryManager.executePlatformScan();

        PluginManager pluginManager = inventoryManager.getPluginManager();
        PluginComponentFactory factory = inventoryManager.getPluginComponentFactory();

        Set<ResourceType> serverTypes = pluginManager.getMetadataManager().getTypesForCategory(ResourceCategory.SERVER);
        ResourceContainer platformContainer = inventoryManager.getResourceContainer(inventoryManager.getPlatform());
        Resource platformResource = platformContainer.getResource();

        for (ResourceType serverType : serverTypes) {
            if (!serverType.getParentResourceTypes().isEmpty()) {
                continue; // TODO GH: Need to stop discovering embedded tomcats here and other non-top level servers
            }

            try {
                ResourceDiscoveryComponent component = factory.getDiscoveryComponent(serverType, platformContainer);
                // TODO GH: Manage plugin component call

                /* TODO GH: Fixme
                 * if (!verifyComponentCompatibility(component,platformComponent)) { log.warn("Resource has parent
                 * resource with incompatible component " + serverType); continue; }
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.