Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel$KernelReference


            throws PortletException, IOException {
        String sBrokerURI = actionRequest.getParameter("brokerURI");
        String sBrokerName = actionRequest.getParameter("brokerName");
        try {
            AbstractName abstractName = new AbstractName(URI.create(sBrokerURI));
            Kernel kernel = PortletManager.getKernel();
            if (!kernel.isRunning(abstractName))
                return;
            kernel.stopGBean(abstractName);
            if (kernel.isRunning(abstractName)) {
                throw new PortletException(getLocalizedString(actionRequest,
                        "jmsmanager.broker.failStopBrokerNoReason", sBrokerName));
            }
            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "jmsmanager.broker.successStopBroker",
                    sBrokerName));
View Full Code Here


            throws PortletException, IOException {
        String sConfigurationXML = actionRequest.getParameter("configXML");
        String sBrokerName = actionRequest.getParameter("brokerName");
        String sBrokerURI = actionRequest.getParameter("brokerURI");
        validateConfigXML(sConfigurationXML, actionRequest);
        Kernel kernel = PortletManager.getKernel();
        try {
            AbstractName brokerAbstractName = new AbstractName(URI.create(sBrokerURI));
            GBeanData brokerGBeanData = kernel.getGBeanData(new AbstractName(URI.create(sBrokerURI)));
            String sBrokerConfigurationXMLPath = brokerGBeanData.getAttribute("amqBaseDir").toString()
                    + brokerGBeanData.getAttribute("amqConfigFile").toString();
            saveConfigurationFile(resolveConfigurationFile(actionRequest, sBrokerConfigurationXMLPath),
                    sConfigurationXML);
            GeronimoManagedBean jmsBroker = PortletManager.getManagedBean(actionRequest, brokerAbstractName);
            if (kernel.isRunning(brokerAbstractName)) {
                jmsBroker.stop();
            }
            jmsBroker.startRecursive();
            if (!kernel.isRunning(brokerAbstractName)) {
                throw new PortletException(getLocalizedString(actionRequest,
                        "jmsmanager.broker.failUpdateBrokerNoReason", sBrokerName));
            }
            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "jmsmanager.broker.successUpdateBroker",
                    sBrokerName));
View Full Code Here

        //But we still could not load those GBeans which are marked with load="false"
        Artifact activeMQBrokersConfig = PortletManager.getNameFor(renderRequest, manager).getArtifact();
        Configuration configuration = PortletManager.getConfigurationManager().getConfiguration(activeMQBrokersConfig);
        AbstractNameQuery query = new AbstractNameQuery(ActiveMQBroker.class.getName());
        LinkedHashSet<GBeanData> brokerNameSet = configuration.findGBeanDatas(Collections.singleton(query));
        Kernel kernel = PortletManager.getKernel();
        try {
            for (GBeanData gBeanData : brokerNameSet) {
                AbstractName abstractName = gBeanData.getAbstractName();
                String brokerName = abstractName.getNameProperty("name");
                if (kernel.isRunning(abstractName)) {
                    beans.add(new BrokerWrapper(brokerName, abstractName.toString(), (JMSBroker) kernel.getGBean(abstractName), State.RUNNING));
                } else {
                    beans.add(new BrokerWrapper(brokerName, abstractName.toString(), null, State.STOPPED));
                }
            }
        } catch (Exception e) {
View Full Code Here

    protected BrokerWrapper getBrokerWrapper(PortletRequest portletRequest, AbstractName brokerAbstractName) throws PortletException {
        JMSBroker jmsBroker = PortletManager.getJMSBroker(portletRequest, brokerAbstractName);
        if (jmsBroker == null)
            return null;
        String displayName = brokerAbstractName.getName().get("name").toString();
        Kernel kernel = PortletManager.getKernel();
        try {
            return new BrokerWrapper(displayName, brokerAbstractName.toString(), jmsBroker, State.fromInt(kernel.getGBeanState(brokerAbstractName)));
        } catch (GBeanNotFoundException e) {
            throw new PortletException(e);
        }
    }
View Full Code Here

                    PluginType plugin = getPlugin(installed);
                    pluginList.getPlugin().add(plugin);
                }
            }

            Kernel kernel = new BasicKernel("assembly");

            try {
                PluginInstallerGBean pluginInstallerGBean = oldPluginInstallerGBean.pluginInstallerCopy(serverName, kernel);
                GeronimoSourceRepository localSourceRepository = new GeronimoSourceRepository(configManager.getRepositories(), configManager.getArtifactResolver());

                DownloadResults downloadPoller = new DownloadResults();
                pluginInstallerGBean.install(pluginList, localSourceRepository, true, null, null, downloadPoller);
            } finally {
                kernel.shutdown();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
View Full Code Here

            addDependencies(pluginList);
        }
        DownloadResults downloadPoller = new DownloadResults();
        String targetServerPath = targetServerDirectory.getAbsolutePath();

        Kernel kernel = new BasicKernel("Assembly");
        PluginRepositoryList pluginRepoList = new PluginRepositoryDownloader(Collections.singletonMap(localRepo, (String[]) null), true);
        try {
            PluginInstallerGBean installer = new PluginInstallerGBean(targetRepositoryPath, targetServerPath, installedPluginsList, servers, pluginRepoList, kernel, getClass().getClassLoader());
            installer.install(pluginList, sourceRepo, true, null, null, downloadPoller);
            if (overrides != null) {
                for (Override override: this.overrides) {
                    AttributesType attributes = override.getOverrides(overridesDir);
                    installer.mergeOverrides(override.getServer(), attributes);
                }
            }
        } catch (Exception e) {
            throw new MojoExecutionException("Could not use plugin installer bean", e);
        } finally {
            kernel.shutdown();
        }
        getLog().info("Installed plugins: ");
        for (Artifact artifact: downloadPoller.getInstalledConfigIDs()) {
            getLog().info("    " + artifact);
        }
View Full Code Here

        File targetServerPath = serverInfo.resolveServer(relativeTargetServerPath);
        if (targetServerPath.exists()) {
            FileUtils.forceDelete(targetServerPath);
        }
        String targetServerPathName = targetServerPath.getAbsolutePath();
        Kernel kernel = new BasicKernel("assembly");

        try {
            PluginInstallerGBean installer = new PluginInstallerGBean(
                    targetRepositoryPath,
                    targetServerPathName,
                    installedPluginsList,
                    serverInstanceDatas,
                    pluginRepositoryList,
                    kernel,
                    classLoader);

            installer.install(pluginList, localSourceRepository, true, null, null, downloadPoller);
        } finally {
            kernel.shutdown();
        }
        return downloadPoller;
    }
View Full Code Here

        File targetServerPath = serverInfo.resolveServer(relativeTargetServerPath);
        if (targetServerPath.exists()) {
          FileUtils.forceDelete(targetServerPath);
        }
        String targetServerPathName = targetServerPath.getAbsolutePath();
        Kernel kernel = new BasicKernel("assembly");

        try {
//            kernel.boot();
            PluginInstallerGBean installer = new PluginInstallerGBean(
                    targetRepositoryPath,
                    targetServerPathName,
                    serverInstanceDatas,
                    kernel,
                    classLoader);

            installer.install(pluginList, localSourceRepository, true, null, null, downloadPoller);
        } finally {
            kernel.shutdown();
        }
        return downloadPoller;
    }
View Full Code Here

                dataSourceAppName = "null";
            } else {
                dataSourceAppName = dataSourceAppName.trim();
            }
            String kernelName = (String) options.get(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION);
            Kernel kernel = KernelRegistry.getKernel(kernelName);
            Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(JCAManagedConnectionFactory.class.getName()));
            JCAManagedConnectionFactory factory;
            for (AbstractName name : set) {
                if (name.getName().get("J2EEApplication").equals(dataSourceAppName) &&
                        name.getName().get("name").equals(dataSourceName)) {
                    try {
                        factory = (JCAManagedConnectionFactory) kernel.getGBean(name);
                        String type = factory.getConnectionFactoryInterface();
                        if (type.equals(DataSource.class.getName())) {
                            this.factory = factory;
                            break;
                        }
View Full Code Here

* @version $Rev: 928119 $ $Date: 2010-03-27 09:35:02 +0800 (Sat, 27 Mar 2010) $
*/
public class GenericConnectionManagerGBeanSerializationTest extends TestCase {

    public void testSerialization() throws Exception {
        Kernel kernel = new BasicKernel("test");
        kernel.boot();
        AbstractName abstractName = new AbstractName(URI.create("foo/bar/1/car?name=ConnectionManager"));
        GBeanData data = new GBeanData(abstractName, GenericConnectionManagerGBean.class);
        data.setAttribute("transactionSupport", NoTransactions.INSTANCE);
        data.setAttribute("pooling", new SinglePool(10, 0, 5000, 5, false, false, true));
        kernel.loadGBean(data, this.getClass().getClassLoader());
        kernel.startGBean(abstractName);
        Object cm = kernel.getGBean(abstractName);
        assertTrue(cm instanceof GenericConnectionManagerGBean);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(baos);
        out.writeObject(cm);
        out.flush();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.Kernel$KernelReference

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.