Package org.rhq.core.clientapi.agent

Examples of org.rhq.core.clientapi.agent.PluginContainerException


        Configuration configuration;

        try {
            configuration = loadConfig.executeLoad(resourceId);
        } catch (Throwable t) {
            throw new PluginContainerException(createErrorMsg(resourceId, "An exception was thrown."), t);
        }

        if (configuration == null) {
            throw new PluginContainerException(createErrorMsg(resourceId, "returned a null Configuration."));
        }

        return configuration;
    }
View Full Code Here


            try {
                facet.validateStructuredConfiguration(configuration);
            } catch (IllegalArgumentException e) {
                success = false;
            } catch (Throwable t) {
                throw new PluginContainerException(t.getMessage(), t);
            }
        } else {
            for (RawConfiguration rawConfiguration : configuration.getRawConfigurations()) {
                try {
                    facet.validateRawConfiguration(rawConfiguration);
View Full Code Here

    public ContentDiscoveryReport executeResourcePackageDiscoveryImmediately(int resourceId, String packageTypeName)
        throws PluginContainerException {
        // Load the package type object
        PackageType packageType = findPackageType(resourceId, packageTypeName);
        if (packageType == null) {
            throw new PluginContainerException("Could not load package type [" + packageTypeName + "] for resource: "
                + resourceId);
        }

        // Create a new runner that is scoped to the resource/package type specified
        ScheduledContentDiscoveryInfo discoveryInfo = new ScheduledContentDiscoveryInfo(resourceId, packageType);

        ContentDiscoveryRunner oneTimeRunner = new ContentDiscoveryRunner(this, discoveryInfo);

        ContentDiscoveryReport results;
        try {
            results = discoveryThreadPoolExecutor.submit((Callable<ContentDiscoveryReport>) oneTimeRunner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Exception occurred during execution of discovery", e);
        }

        return results;
    }
View Full Code Here

        throws PluginContainerException {
        Callable<DeployPackagesResponse> runner = new CreateContentRunner(this, request);
        try {
            return crudExecutor.submit(runner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Error during deployment of packages. request: " + request, e);
        }
    }
View Full Code Here

        List<DeployPackageStep> steps;
        try {
            ContentFacet contentFacet = findContentFacet(resourceId);
            steps = contentFacet.generateInstallationSteps(packageDetails);
        } catch (Exception e) {
            throw new PluginContainerException("Error translating the package installation steps", e);
        }

        return steps;
    }
View Full Code Here

            // note that we only ever unpacked the plugin jar itself
            if (!processedPluginJar && unpackNestedJars) {
                try {
                    unpackedDirectory = unpackEmbeddedJars(pluginJarName, pluginUrl, classpathUrlList, tmpDirectory);
                } catch (Exception e) {
                    throw new PluginContainerException("Failed to unpack embedded JARs within: " + pluginUrl, e);
                }
            }

            processedPluginJar = true;
        }
View Full Code Here

    public CreateResourceResponse executeCreateResourceImmediately(CreateResourceRequest request)
        throws PluginContainerException {
        // Load the actual resource type instance to be passed to the facet
        ResourceType resourceType = metadataManager.getType(request.getResourceTypeName(), request.getPluginName());
        if (resourceType == null) {
            throw new PluginContainerException("Could not retrieve resource type for request: " + request);
        }

        String creationType = (request.getResourceConfiguration() != null) ? "configuration" : "package";
        {
            log.debug("Creating " + creationType + "-based resource of type '" + request.getResourceTypeName()
                + "' and with parent with id " + request.getParentResourceId() + "...");
        }

        // Create the report to send the plugin
        CreateResourceReport report = new CreateResourceReport(request.getResourceName(), resourceType, request
            .getPluginConfiguration(), request.getResourceConfiguration(), request.getPackageDetails());

        // Execute the create against the plugin
        CreateChildResourceFacet facet = getCreateChildResourceFacet(request.getParentResourceId(), request
            .getTimeout());

        CreateResourceRunner runner = new CreateResourceRunner(this, request.getParentResourceId(), facet, request
            .getRequestId(), report, configuration.isInsideAgent());

        CreateResourceResponse response;
        try {
            response = (CreateResourceResponse) executor.submit((Callable) runner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Error during create resource callable", e);
        }

        return response;
    }
View Full Code Here

    public void createResource(CreateResourceRequest request) throws PluginContainerException {
        // Load the actual resource type instance to be passed to the facet
        ResourceType resourceType = metadataManager.getType(request.getResourceTypeName(), request.getPluginName());
        if (resourceType == null) {
            throw new PluginContainerException("Could not retrieve resource type for request: " + request);
        }

        String creationType = (request.getResourceConfiguration() != null) ? "configuration" : "package";
        {
            log.debug("Creating " + creationType + "-based resource of type '" + request.getResourceTypeName()
View Full Code Here

        DeleteResourceResponse response;

        try {
            response = (DeleteResourceResponse) executor.submit((Callable) runner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Error occurred in delete resource thread", e);
        }

        return response;
    }
View Full Code Here

            };
        }
        String className = pluginManager.getMetadataManager().getComponentClass(resourceType);
        ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resource);
        if (resourceContainer == null) {
            throw new PluginContainerException("Resource container not found for " + resource + " - cannot create ResourceComponent.");
        }
        ClassLoader resourceClassloader = resourceContainer.getResourceClassLoader();
        if (resourceClassloader == null) {
            throw new PluginContainerException("Resource classLoader not found for " + resource + " - cannot create ResourceComponent.");
        }
        ResourceComponent component = (ResourceComponent) instantiateClass(resourceClassloader, className);

        if (log.isDebugEnabled()) {
            log.debug("Created resource component [" + className + "] of resource type [" + resourceType + ']');
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.agent.PluginContainerException

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.