Package org.rhq.core.clientapi.descriptor.plugin

Examples of org.rhq.core.clientapi.descriptor.plugin.ResourceDescriptor


        } else {
            // Using Embedded extension model - the defined type is actually a copy of another plugin's service or server type.
            LOG.debug("Parsing embedded service type {" + pluginDescriptor.getName() + "}"
                    + serviceDescriptor.getName() + ", which extends type {" + sourcePlugin + "}" + sourceType + "...");

            ResourceDescriptor sourceTypeDescriptor;
            if (sourceType.isEmpty()) {
                sourceTypeDescriptor = serviceDescriptor;
            } else {
                Map<String, ServiceDescriptor> pluginServiceDescriptors = getPluginServiceDescriptors(sourcePlugin);
                sourceTypeDescriptor = pluginServiceDescriptors.get(sourceType);
                if (sourceTypeDescriptor == null) {
                    Map<String, ServerDescriptor> pluginServerDescriptors = getPluginServerDescriptors(sourcePlugin);
                    sourceTypeDescriptor = pluginServerDescriptors.get(sourceType);
                }
            }

            if (sourceTypeDescriptor == null) {
                LOG.warn("There is no service or server type named [" + sourceType + "] from a plugin named ["
                        + sourcePlugin + "]. This is probably because that plugin is missing. Resource Type [{"
                        + pluginDescriptor.getName() + "}" + serviceDescriptor.getName() + "] will be ignored.");
                return null;
            }

            serviceResourceType = new ResourceType(serviceDescriptor.getName(), pluginDescriptor.getName(),
                ResourceCategory.SERVICE, parentType);

            // Let the plugin writer override these, or if not, parseResourceDescriptor() will pick up the source type's
            // values.
            serviceResourceType.setDescription(serviceDescriptor.getDescription());
            serviceResourceType.setSubCategory(serviceDescriptor.getSubCategory());

            serviceResourceType.setCreationDataType(convertCreationDataType(serviceDescriptor.getCreationDataType()));
            serviceResourceType.setCreateDeletePolicy(convertCreateDeletePolicy(serviceDescriptor
                .getCreateDeletePolicy()));
            serviceResourceType.setSingleton(serviceDescriptor.isSingleton());
            serviceResourceType.setSupportsMissingAvailabilityType(serviceDescriptor
                .isSupportsMissingAvailabilityType());

            String discoveryClass;
            if (serviceDescriptor.getDiscovery() != null) {
                discoveryClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin), serviceDescriptor
                    .getDiscovery());
            } else {
                discoveryClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
                        sourceTypeDescriptor.getDiscovery());
            }

            String componentClass;
            if (serviceDescriptor.getClazz() != null) {
                componentClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin), serviceDescriptor
                    .getClazz());
            } else {
                componentClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
                        sourceTypeDescriptor.getClazz());
            }

            parseResourceDescriptor(sourceTypeDescriptor, serviceResourceType, discoveryClass, componentClass,
                sourcePlugin);
        }
View Full Code Here


        } else if (sourcePlugin.length() > 0) {
            // Using Embedded extension model - the defined type is actually a copy of another plugin's service or server type.
            log.debug("Parsing embedded service type {" + pluginDescriptor.getName() + "}"
                    + serviceDescriptor.getName() + ", which extends type {" + sourcePlugin + "}" + sourceType + "...");

            ResourceDescriptor sourceTypeDescriptor;
            if (sourceType.isEmpty()) {
                sourceTypeDescriptor = serviceDescriptor;
            } else {
                Map<String, ServiceDescriptor> pluginServiceDescriptors = getPluginServiceDescriptors(sourcePlugin);
                sourceTypeDescriptor = pluginServiceDescriptors.get(sourceType);
View Full Code Here

     * @return The parsed {@link ConfigurationDefinition}
     */
    public static ConfigurationDefinition loadPluginConfigDefFor(PluginDescriptor descriptor, String path,
        String configName) {
        try {
            ResourceDescriptor resourceDescriptor = (ResourceDescriptor) find(descriptor, path);
            return ConfigurationMetadataParser.parse(configName, resourceDescriptor.getPluginConfiguration());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

     * @return The parsed {@link ConfigurationDefinition}
     */
    public static ConfigurationDefinition loadResourceConfigDefFor(PluginDescriptor descriptor, String path,
        String configName) {
        try {
            ResourceDescriptor resourceDescriptor = (ResourceDescriptor) find(descriptor, path);
            return ConfigurationMetadataParser.parse(configName, resourceDescriptor.getResourceConfiguration());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    /**
     * Returns the plugin descriptor.
     */
    public ResourceDescriptor getResourceDescriptor(String name) {
        ResourceDescriptor rd = descriptors.get(name);
        if (rd == null)
            throw new IllegalStateException("no descriptor " + name + " in " + descriptors.keySet());
        return rd;
    }
View Full Code Here

    /**
     * Returns the plugin descriptor.
     */
    public ResourceDescriptor getResourceDescriptor(String name) {
        ResourceDescriptor rd = descriptors.get(name);
        if (rd == null)
            throw new IllegalStateException("no descriptor " + name + " in " + descriptors.keySet());
        return rd;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.descriptor.plugin.ResourceDescriptor

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.