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

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


    public static BundleServerPluginContainer getPluginContainer() {
        BundleServerPluginContainer pc;

        try {
            ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
            if (!mbean.isMasterPluginContainerStarted()) {
                throw new IllegalStateException("The master plugin container is not started!");
            }

            MasterServerPluginContainer master = mbean.getMasterPluginContainer();
            pc = master.getPluginContainerByClass(BundleServerPluginContainer.class);
        } catch (IllegalStateException ise) {
            throw ise;
        } catch (Exception e) {
            throw new IllegalStateException("Cannot obtain the Bundle plugin container!", e);
View Full Code Here


            }
        }
    }

    private boolean enableServerPluginInMasterContainer(PluginKey pluginKey) {
        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        boolean success = true; // assume everything will be ok

        if (master != null) {
            AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(pluginKey);
            if (pc != null) {
View Full Code Here

        return pluginKeys;
    }

    private boolean disableServerPluginInMasterContainer(PluginKey pluginKey) {
        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        boolean success = true; // assume everything will be ok

        if (master != null) {
            AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(pluginKey);
            if (pc != null) {
View Full Code Here

        return pluginKeys;
    }

    private boolean undeployServerPluginInMasterContainer(PluginKey pluginKey) {
        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        boolean success = true; // assume everything will be ok

        if (master != null) {
            AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(pluginKey);
            if (pc != null) {
View Full Code Here

        return plugin;
    }

    private void loadServerPluginInMasterContainer(URL pluginUrl) throws Exception {
        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        if (master != null) {
            master.loadPlugin(pluginUrl, false); // don't enable it - let the caller do that later
        }
        return;
    }
View Full Code Here

    }

    @Override
    public List<ControlDefinition> getServerPluginControlDefinitions(PluginKey pluginKey) throws Exception {

        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;
View Full Code Here

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    public ControlResults invokeServerPluginControl(Subject subject, PluginKey pluginKey, String controlName,
        Configuration params) throws Exception {

        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        MasterServerPluginContainer master = serverPluginService.getMasterPluginContainer();
        if (master != null) {
            AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(pluginKey);
            if (pc != null) {
                ControlResults results = pc.invokePluginControl(pluginKey, controlName, params);
                return results;
View Full Code Here

            log.error("Cannot schedule data calc job.", e);
        }

        // Server Plugin Jobs
        try {
            ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
            MasterServerPluginContainer masterPC = mbean.getMasterPluginContainer();
            masterPC.scheduleAllPluginJobs();
        } catch (Exception e) {
            log.error("Cannot schedule server plugin jobs.", e);
        }
View Full Code Here

     */
    private void startServerPluginContainer() throws RuntimeException {
        log.info("Starting the master server plugin container...");

        try {
            ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
            mbean.startMasterPluginContainerWithoutSchedulingJobs();
        } catch (Exception e) {
            error += (error.isEmpty() ? "" : ", ") + "server plugin container";
            throw new RuntimeException("Cannot start the master server plugin container!", e);
        }
    }
View Full Code Here

        return scanner;
    }

    public static ServerPluginServiceMBean getServerPluginService() {
        MBeanServer jBossMBeanServer = getJBossMBeanServer();
        ServerPluginServiceMBean service = (ServerPluginServiceMBean) MBeanProxyExt.create(
            ServerPluginServiceMBean.class, ServerPluginServiceMBean.OBJECT_NAME, jBossMBeanServer);
        return service;
    }
View Full Code Here

TOP

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

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.