Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel


    private final Kernel kernel;

    public static ManagementHelper getManagementHelper(PortletRequest request) {
        ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(PLUGIN_HELPER_KEY, PortletSession.APPLICATION_SCOPE);
        if (helper == null) {
            Kernel kernel = PortletManager.getKernel();
            helper = new ManagementHelper(kernel);
            request.getPortletSession().setAttribute(PLUGIN_HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE);
        }
        return helper;
    }
View Full Code Here


    private final static String SYSTEM_LOG_KEY = "org.apache.geronimo.console.SystemLog";
    // The following may change based on the user's selections
    // nothing yet

    private static ManagementHelper createHelper() {
        Kernel kernel = getKernel();
        return new KernelManagementHelper(kernel);
    }
View Full Code Here

        return new KernelManagementHelper(kernel);
    }

    public static Kernel getKernel() {
        //todo: consider making this configurable; we could easily connect to a remote kernel if we wanted to
        Kernel kernel = null;
        try {
            kernel = (Kernel) new InitialContext().lookup("java:comp/GeronimoKernel");
        } catch (NamingException e) {
//            log.error("Unable to look up kernel in JNDI", e);
        }
View Full Code Here

    private final Kernel kernel;

    public static ManagementHelper getManagementHelper(PortletRequest request) {
        ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(PLUGIN_HELPER_KEY, PortletSession.APPLICATION_SCOPE);
        if (helper == null) {
            Kernel kernel = PortletManager.getKernel();
            helper = new ManagementHelper(kernel);
            request.getPortletSession().setAttribute(PLUGIN_HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE);
        }
        return helper;
    }
View Full Code Here

    private List<PluginRepositoryList> pluginRepositoryLists;

    public static ManagementHelper getManagementHelper(PortletRequest request) {
        ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(PLUGIN_HELPER_KEY, PortletSession.APPLICATION_SCOPE);
        if (helper == null) {
            Kernel kernel = PortletManager.getKernel();
            helper = new ManagementHelper(kernel);
            request.getPortletSession().setAttribute(PLUGIN_HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE);
        }
        return helper;
    }
View Full Code Here

    protected void handleRequest(HttpServletRequest request, HttpServletResponse response, boolean reply) throws ServletException, IOException {
        String path = request.getPathInfo();
        if(path == null) {
            throw new ServletException("No configId specified for CAR download");
        }
        Kernel kernel = KernelRegistry.getSingleKernel();
        if(path.equals("/geronimo-plugins.xml")) {
            response.setContentType("text/xml");
            if(reply) {
                try {
                    generateConfigFile(request, kernel, response.getWriter());
View Full Code Here

* @version $Rev: 541105 $ $Date: 2007-05-23 18:27:56 -0400 (Wed, 23 May 2007) $
*/
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.GBEAN_INFO);
        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

    public void setExtensionDirs(String extensionDirs) {
        this.extensionDirs = extensionDirs;
    }

    public void execute() throws Exception {
        Kernel kernel = createKernel(repository);

        // start the Configuration we're going to use for this deployment
        ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
        try {
            if (!configurationManager.isLoaded(deploymentConfig)) {
                List configs = configurationManager.loadRecursive(deploymentConfig);
                for (int i = 0; i < configs.size(); i++) {
                    ObjectName configName = (ObjectName) configs.get(i);
                    kernel.startRecursiveGBean(configName);
                }
            }
        } finally {
            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
        }
View Full Code Here

        URI configurationId = (URI) configuration.getAttribute("id");
        ObjectName configName = Configuration.getConfigurationObjectName(configurationId);
        configuration.setName(configName);

        // build a basic kernel without a configuration-store, our configuration store is
        Kernel kernel = KernelFactory.newInstance().createKernel(getKernelName());
        kernel.boot();

        kernel.loadGBean(configuration, this.getClass().getClassLoader());
        kernel.setAttribute(configName, "baseURL", systemURL);
        kernel.startRecursiveGBean(configName);

        // load the rest of the configuration listed on the command line
        ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
        try {
            for (Iterator i = configList.iterator(); i.hasNext();) {
                URI configID = (URI) i.next();
                List list = configurationManager.loadRecursive(configID);
                for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                    ObjectName name = (ObjectName) iterator.next();
                    kernel.startRecursiveGBean(name);
                    System.out.println("started gbean: " + name);
                }
            }
        } finally {
            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
View Full Code Here

    public String getKernelName() {
        return kernelName;
    }

    public void execute() throws Exception {
        Kernel kernel = KernelRegistry.getKernel(getKernelName());
        kernel.shutdown();
    }
View Full Code Here

TOP

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

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.