Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel


    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

               
                // set the keystore properties if its a secure connector
                setKeystoreProperties(actionRequest, connectorName);
               
                try {
                    Kernel kernel=PortletManager.getKernel();
                    ClassLoader oldCL=connector.getClass().getClassLoader();
                    kernel.stopGBean(connectorName);
                    kernel.unloadGBean(connectorName);
                   
                   
                    kernel.loadGBean(connectorGBeanData, oldCL);
                    kernel.startGBean(connectorName);
                 
                } catch (Exception e) {
                    log.error("Unable to reload updated connector:"+connectorName.toURI(), e);
                }
               
View Full Code Here

            }
        } catch (Exception e) {
          log.error("Problem getting datasource " + dbName, e);
        }
       
        Kernel kernel = KernelRegistry.getSingleKernel();
        ManagementHelper helper = new KernelManagementHelper(kernel);
        ResourceAdapterModule[] modules = helper.getOutboundRAModules(helper.getDomains()[0].getServerInstances()[0], "javax.sql.DataSource");
        for (ResourceAdapterModule module : modules) {
            org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory[] databases = helper.getOutboundFactories(module, "javax.sql.DataSource");
            for (org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory db : databases) {
View Full Code Here

            }
        } catch (Exception e) {
          log.error("Problem getting datasource " + dsName, e);
        }
       
        Kernel kernel = KernelRegistry.getSingleKernel();
        ManagementHelper helper = new KernelManagementHelper(kernel);
        ResourceAdapterModule[] modules = helper.getOutboundRAModules(helper.getDomains()[0].getServerInstances()[0], "javax.sql.DataSource");
        for (ResourceAdapterModule module : modules) {
            org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory[] databases = helper.getOutboundFactories(module, "javax.sql.DataSource");
            for (org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory db : databases) {
                try {
                    AbstractName dbName = kernel.getAbstractNameFor(db);
                    String datasourceName = (String)dbName.getName().get(NameFactory.J2EE_NAME);
                    if(dsName.equalsIgnoreCase(datasourceName)) {
                        AbstractName tempDbName = helper.getNameFor(db);
                        return (DataSource) KernelRegistry.getSingleKernel().invoke(
                                tempDbName, "$getResource");
View Full Code Here

        return connectionFactory;
    }

    private ActiveMQConnectionFactory createActiveMQConnectionFactory(PortletRequest portletRequest, JMSDestinationInfo destinationInfo) throws JMSException {
        try {
            Kernel kernel = PortletManager.getKernel();
            ResourceAdapterModule resourceAdapterModule = (ResourceAdapterModule) PortletManager.getManagementHelper(portletRequest).getObject(destinationInfo.getResourceAdapterModuleAbName());
            AbstractName resourceAdapterAbstractName = PortletManager.getNameFor(portletRequest, resourceAdapterModule.getResourceAdapterInstances()[0].getJCAResourceImplementations()[0]
                    .getResourceAdapterInstances()[0]);
            if (kernel.isRunning(resourceAdapterAbstractName)) {
                String serverUrl = (String) kernel.getAttribute(resourceAdapterAbstractName, "ServerUrl");
                String userName = (String) kernel.getAttribute(resourceAdapterAbstractName, "UserName");
                String password = (String) kernel.getAttribute(resourceAdapterAbstractName, "Password");
                return new ActiveMQConnectionFactory(userName, password, serverUrl);
            }
            throw new JMSException("Fail to create ActiveMQConnectionFactory for the resource adapter module is not in running status");
        } catch (JMSException e) {
            throw e;
View Full Code Here

            PortletException {
        String sBrokerURI = renderRequest.getParameter("brokerURI");
        String sBrokerName = renderRequest.getParameter("brokerName");
        String sBrokerConfigurationXML = null;
        try {
            Kernel kernel = PortletManager.getKernel();
            GBeanData brokerGBeanData = kernel.getGBeanData(new AbstractName(URI.create(sBrokerURI)));
            String sBrokerConfigurationXMLPath = brokerGBeanData.getAttribute("amqBaseDir").toString()
                    + brokerGBeanData.getAttribute("amqConfigFile").toString();
            sBrokerConfigurationXML = loadConfiguratonFileAsString(resolveConfigurationFile(renderRequest,
                    sBrokerConfigurationXMLPath));
        } catch (GBeanNotFoundException e) {
View Full Code Here

    protected void processCreateAction(ActionRequest actionRequest, ActionResponse actionResponse)
            throws PortletException, IOException {
        String sConfigurationXML = actionRequest.getParameter("configXML");
        validateConfigXML(sConfigurationXML, actionRequest);
        String sBrokerName = actionRequest.getParameter("brokerName");
        Kernel kernel = PortletManager.getKernel();
        AbstractName brokerAbstractName = kernel.getNaming().createSiblingName(
                PortletManager.getNameFor(actionRequest, getActiveMQManager(actionRequest)), sBrokerName, "JMSServer");
        validateBrokerName(brokerAbstractName, actionRequest);
        saveConfigurationFile(resolveConfigurationFile(actionRequest, "var/activemq/conf/" + sBrokerName + ".xml"),
                sConfigurationXML);
        GBeanData brokerGBeanData = new GBeanData(brokerAbstractName, BrokerServiceGBeanImpl.class);
View Full Code Here

    protected void processDeleteAction(ActionRequest actionRequest, ActionResponse actionResponse)
            throws PortletException, IOException {
        String sBrokerName = actionRequest.getParameter("brokerName");
        String sBrokerURI = actionRequest.getParameter("brokerURI");
        try {
            Kernel kernel = PortletManager.getKernel();
            AbstractName brokerAbstractName = new AbstractName(URI.create(sBrokerURI));
            GBeanData brokerGBeanData = kernel.getGBeanData(brokerAbstractName);
            String sBrokerConfigurationXMLPath = brokerGBeanData.getAttribute("amqBaseDir").toString()
                    + brokerGBeanData.getAttribute("amqConfigFile").toString();
            getActiveMQManager(actionRequest).removeBroker(brokerAbstractName);
            File brokerConfigFile = resolveConfigurationFile(actionRequest, sBrokerConfigurationXMLPath);
            if (!brokerConfigFile.delete()) {
View Full Code Here

            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.startRecursiveGBean(abstractName);
            //TODO While the broker gbean does not start correctly, sometimes no exception is threw ?
            if (!kernel.isRunning(abstractName)) {
                throw new PortletException(getLocalizedString(actionRequest,
                        "jmsmanager.broker.failStartBrokerNoReason", sBrokerName));
            }
            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "jmsmanager.broker.successStartBroker",
                    sBrokerName));
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.