Package org.rhq.enterprise.server.plugin.pc

Examples of org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment


        if (adapter == null) {
            throw new RuntimeException("There is no adapter for content source [" + contentSource + "]");
        }

        ServerPluginEnvironment env = this.pluginManager.getPluginEnvironment(contentSource.getContentSourceType());
        if (env == null) {
            throw new RuntimeException("There is no plugin env. for content source [" + contentSource + "]");
        }

        ClassLoader classLoader = env.getPluginClassLoader();
        IsolatedInvocationHandler handler = new IsolatedInvocationHandler(adapter, classLoader);

        List<Class<?>> ifacesList = new ArrayList<Class<?>>(1);
        ifacesList.add(ContentProvider.class);
View Full Code Here


        try {
            ContentSourceType type = contentSource.getContentSourceType();
            apiClassName = type.getContentSourceApiClass();
            pluginName = this.pluginManager.getMetadataManager().getPluginNameFromContentSourceType(type);

            ServerPluginEnvironment pluginEnv = this.pluginManager.getPluginEnvironment(pluginName);
            ClassLoader pluginClassloader = pluginEnv.getPluginClassLoader();

            ClassLoader startingClassLoader = Thread.currentThread().getContextClassLoader();
            try {
                Thread.currentThread().setContextClassLoader(pluginClassloader);
View Full Code Here

        String className = pluginClassByName.get(senderName);
        if (className == null) {
            log.error("getAlertSenderForNotification: No pluginClass found for sender: " + senderName);
            return null;
        }
        ServerPluginEnvironment env = pluginEnvByName.get(senderName);
        AlertSender sender;
        try {
            sender = (AlertSender) instantiatePluginClass(env, className);
        } catch (Exception e) {
            log.error(e); // TODO
View Full Code Here

        if (className == null) {
            return null;
        }

        ServerPluginEnvironment env = pluginEnvByName.get(shortName);
        CustomAlertSenderBackingBean bean = null;

        try {
            bean = (CustomAlertSenderBackingBean) instantiatePluginClass(env, className);
            bean.alertParameters = new Configuration(); // Just to be sure
View Full Code Here

        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        if (master != null) {
            AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(pluginKey);
            if (pc != null) {
                ServerPluginEnvironment env = pc.getPluginManager().getPluginEnvironment(pluginKey.getPluginName());
                List<ControlDefinition> defs;
                defs = ServerPluginDescriptorMetadataParser.getControlDefinitions(env.getPluginDescriptor());
                return defs;
            } else {
                throw new Exception("There is no known plugin named [" + pluginKey + "]");
            }
        } else {
View Full Code Here

        if (recipe == null) {
            throw new IllegalArgumentException("recipe == null");
        }

        // find the plugin environment for the bundle plugin of the given type
        ServerPluginEnvironment pluginEnv = null;
        for (ServerPluginEnvironment env : getPluginEnvironments()) {
            BundlePluginDescriptorType descriptor = (BundlePluginDescriptorType) env.getPluginDescriptor();
            if (bundleTypeName.equals(descriptor.getBundle().getType())) {
                pluginEnv = env;
                break;
            }
        }

        if (pluginEnv == null) {
            throw new IllegalArgumentException("Bundle type [" + bundleTypeName + "] is not known to the system");
        }

        // get the facet and call the parse method in the appropriate classloader
        String pluginName = pluginEnv.getPluginKey().getPluginName();
        ServerPluginComponent component = getServerPluginComponent(pluginName);
        BundleServerPluginFacet facet = (BundleServerPluginFacet) component; // we know this cast will work because our loadPlugin ensured so
        getLog().debug("Bundle server plugin [" + pluginName + "] is parsing a bundle recipe");
        ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(pluginEnv.getPluginClassLoader());
            RecipeParseResults results = facet.parseRecipe(recipe);
            ensureDisplayNameIsSet(results);
            return results;
        } finally {
            Thread.currentThread().setContextClassLoader(originalContextClassLoader);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment

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.