Examples of PluginKey


Examples of org.rhq.core.domain.plugin.PluginKey

        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();

        AlertSenderInfo senderInfo = pluginmanager.getAlertSenderInfo(shortName);
        String pluginName = senderInfo.getPluginName();
        PluginKey key = senderInfo.getPluginKey();

        try {
            AlertPluginDescriptorType descriptor = (AlertPluginDescriptorType) serverPluginsBean
                .getServerPluginDescriptor(key);
            //ConfigurationDefinition pluginConfigurationDefinition = ConfigurationMetadataParser.parse("pc:" + pluginName, descriptor.getPluginConfiguration());
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

     * @param pluginUrl location of the plugin jar file
     * @param descriptor the plugin descriptor
     */
    public synchronized void loadPlugin(URL pluginUrl, ServerPluginDescriptorType descriptor) {
        ServerPluginType pluginType = new ServerPluginType(descriptor);
        PluginKey pluginKey = PluginKey.createServerPluginKey(pluginType.stringify(), descriptor.getName());
        this.pluginKeysUrls.put(pluginKey, pluginUrl);
    }
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

                } else {
                    LOG.info("Validating plugin [" + pluginName + "] from [" + pluginUrl + "]");
                }

                ServerPluginType pluginType = new ServerPluginType(descriptor);
                PluginKey pluginKey = PluginKey.createServerPluginKey(pluginType.stringify(), pluginName);
                ClassLoader classloader = classloaderManager.obtainServerPluginClassLoader(pluginKey);
                ServerPluginEnvironment env = new ServerPluginEnvironment(pluginUrl, classloader, descriptor);

                success = success && validatePluginComponentClass(env);
                success = success && validatePluginVersion(env);
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

        try {
            unloadPlugin(pluginName);
        } finally {
            if (!keepClassLoader) {
                String pluginType = getParentPluginContainer().getSupportedServerPluginType().stringify();
                PluginKey pluginKey = PluginKey.createServerPluginKey(pluginType, pluginName);
                MasterServerPluginContainer master = this.parentPluginContainer.getMasterServerPluginContainer();
                master.getClassLoaderManager().unloadPlugin(pluginKey);
            }
        }
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

        sender.alertParameters = getNewOrCleansed(notification.getConfiguration());
        sender.extraParameters = getNewOrCleansed(notification.getExtraConfiguration());

        ServerPluginContext ctx = getServerPluginContext(env);
        PluginKey key = ctx.getPluginEnvironment().getPluginKey();

        ServerPluginManagerLocal pluginsMgr = LookupUtil.getServerPluginManager();
        ServerPlugin plugin = pluginsMgr.getServerPlugin(key);
        plugin = pluginsMgr.getServerPluginRelationships(plugin);

        sender.preferences = getNewOrCleansed(plugin.getPluginConfiguration());
        sender.pluginComponent = getServerPluginComponent(key.getPluginName());
        sender.serverPluginEnvironment = pluginEnvByName.get(senderName);

        return sender;
    }
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

                ServerPluginDescriptorType descriptor = entry.getValue();
                AbstractTypeServerPluginContainer pc = getPluginContainerByDescriptor(descriptor);
                if (pc != null) {
                    String pluginName = descriptor.getName();
                    ServerPluginType pluginType = new ServerPluginType(descriptor);
                    PluginKey pluginKey = PluginKey.createServerPluginKey(pluginType.stringify(), pluginName);
                    try {
                        ClassLoader classLoader = this.classLoaderManager.obtainServerPluginClassLoader(pluginKey);
                        log.debug("Pre-loading server plugin [" + pluginKey + "] from [" + pluginUrl
                            + "] into its plugin container");
                        try {
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

     * @throws Exception if the plugin's descriptor could not be parsed or could not be loaded into the plugin container
     */
    public synchronized void loadPlugin(URL pluginUrl, boolean enabled) throws Exception {
        ServerPluginDescriptorType descriptor = ServerPluginDescriptorUtil.loadPluginDescriptorFromUrl(pluginUrl);
        ServerPluginType pluginType = new ServerPluginType(descriptor);
        PluginKey pluginKey = PluginKey.createServerPluginKey(pluginType.stringify(), descriptor.getName());
        this.classLoaderManager.loadPlugin(pluginUrl, descriptor);
        ClassLoader classLoader = this.classLoaderManager.obtainServerPluginClassLoader(pluginKey);
        log.debug("Loading server plugin [" + pluginKey + "] from [" + pluginUrl + "] into its plugin container");
        try {
            ServerPluginEnvironment env = new ServerPluginEnvironment(pluginUrl, classLoader, descriptor);
            AbstractTypeServerPluginContainer pc = getPluginContainerByDescriptor(descriptor);
            if (pc != null) {
                pc.loadPlugin(env, enabled);
                log.info("Loaded server plugin [" + pluginKey.getPluginName() + "]");
            } else {
                throw new Exception("No plugin container can load server plugin [" + pluginKey + "]");
            }
        } catch (Exception e) {
            log.warn("Failed to load server plugin file [" + pluginUrl + "]", e);
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

                toEnable.add(plugin);
            }
        }
        for (ServerPlugin serverPlugin : toEnable) {
            serverPluginsBean.setServerPluginEnabledFlag(subject, serverPlugin.getId(), true);
            PluginKey pluginKey = new PluginKey(serverPlugin);
            boolean success = enableServerPluginInMasterContainer(pluginKey);
            if (success) {
                pluginKeys.add(pluginKey);
            } else {
                // we can't enable the plugin in the container, there must be a problem with it - disable it
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

     * @param plugin
     * @throws PluginConfigurationRequiredException if plugin is missing required configuration
     * @throws Exception in case of any other error
     */
    private void checkForRequiredConfiguration(ServerPlugin plugin) throws Exception {
        ConfigurationDefinition configDef = getServerPluginConfigurationDefinition(new PluginKey(plugin));
        Configuration configuration = plugin.getPluginConfiguration();
        for (PropertyDefinition propDef : configDef.getPropertyDefinitions().values()) {
            if (propDef.isRequired() && propDef instanceof PropertyDefinitionSimple) {
                Property prop = configuration.get(propDef.getName());
                PropertySimple simple = (PropertySimple) prop;
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

                plugin = entityManager.getReference(ServerPlugin.class, pluginId);
            } catch (Exception e) {
                log.debug("Cannot disable plugin [" + pluginId + "]. Cause: " + ThrowableUtil.getAllMessages(e));
            }
            if (plugin != null) {
                PluginKey pluginKey = new PluginKey(plugin);
                boolean success = disableServerPluginInMasterContainer(pluginKey);
                if (success) {
                    pluginKeys.add(pluginKey);
                }
            }
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.