Examples of GBeanMBean


Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        //start the J2EE server which would be started by the server plan
        //in the real case
        j2eeManager.startJ2EEContainer(kernel);
        //start the Axis Serverlet which would be started by the service plan
        org.apache.geronimo.jetty.JettyWebAppContext c = null;
        GBeanMBean app = new GBeanMBean("org.apache.geronimo.jetty.JettyWebAppContext");
        URL url =
                Thread.currentThread().getContextClassLoader().getResource("deployables/axis/");
        System.out.print(url);
        app.setAttribute("uri", URI.create(url.toString()));
        app.setAttribute("contextPath", "/axis");
        app.setAttribute("componentContext", null);
        OnlineUserTransaction userTransaction = new OnlineUserTransaction();
        app.setAttribute("userTransaction", userTransaction);
        app.setAttribute("webClassPath", new URI[0]);
        app.setAttribute("contextPriorityClassLoader", Boolean.FALSE);
        app.setReferencePatterns("JettyContainer", Collections.singleton(AxisGeronimoConstants.WEB_CONTAINER_NAME));
        app.setAttribute("configurationBaseUrl", Thread.currentThread().getContextClassLoader().getResource("deployables/"));
        app.setReferencePattern("TransactionContextManager", AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME);
        app.setReferencePattern("TrackedConnectionAssociator", AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME);
        AxisGeronimoUtils.startGBean(AxisGeronimoConstants.APPLICATION_NAME, app, kernel);

    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

                }
            }

            // Create the J2EEApplication managed object
            if (ConfigurationModuleType.EAR == applicationType) {
                GBeanMBean gbean = new GBeanMBean(J2EEApplicationImpl.GBEAN_INFO, cl);
                try {
                    gbean.setAttribute("deploymentDescriptor", applicationInfo.getOriginalSpecDD());
                } catch (Exception e) {
                    throw new DeploymentException("Error initializing J2EEApplication managed object");
                }
                gbean.setReferencePatterns("j2eeServer", Collections.singleton(j2eeServer));
                ObjectName applicationName = earContext.getApplicationObjectName();
                earContext.addGBean(applicationName, gbean);
            }

            // each module can now add it's GBeans
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

    private void verifyDeployment(File unpackedDir, J2eeContext j2eeContext, ClassLoader cl) throws Exception {
        DataSource ds = null;
        Kernel kernel = null;
        try {
            GBeanMBean config = loadConfig(unpackedDir, cl);

            kernel = new Kernel("blah");
            kernel.boot();

            GBeanMBean serverInfoGBean = new GBeanMBean(ServerInfo.GBEAN_INFO);
            serverInfoGBean.setAttribute("baseDirectory", ".");
            ObjectName serverInfoObjectName = ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":type=ServerInfo");
            kernel.loadGBean(serverInfoObjectName, serverInfoGBean);
            kernel.startGBean(serverInfoObjectName);
            assertRunning(kernel, serverInfoObjectName);

            GBeanMBean j2eeServerGBean = new GBeanMBean(J2EEServerImpl.GBEAN_INFO);
            j2eeServerGBean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfoObjectName));
            ObjectName j2eeServerObjectName = NameFactory.getServerName(null, null, j2eeContext);
            kernel.loadGBean(j2eeServerObjectName, j2eeServerGBean);
            kernel.startGBean(j2eeServerObjectName);
            assertRunning(kernel, j2eeServerObjectName);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        InputStream in = new FileInputStream(new File(unpackedCar, "META-INF/config.ser"));
        try {
            ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(in));
            GBeanData config = new GBeanData();
            config.readExternal(ois);
            return new GBeanMBean(config, classLoader);
        } finally {
            in.close();
        }
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        name = new ObjectName("test:name=AxisGBean");
        kernel = new Kernel("test.kernel", "test");
        kernel.boot();
        ClassLoader cl = getClass().getClassLoader();
        ClassLoader myCl = new URLClassLoader(new URL[]{}, cl);
        GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
        gbean.setAttribute("Name", "Test");
        kernel.loadGBean(name, gbean);
        kernel.startGBean(name);
        Service service = new Service();
        service.getEngine().setOption(AxisEngine.PROP_XML_ENCODING, "UTF-8");
        call = (Call) service.createCall();
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        Map gbeans = new HashMap();
        gbeans.put(gbeanName1, confBeans[0]);
        if (confBeans.length > 1)
            gbeans.put(gbeanName2, confBeans[1]);
        byte[] state = Configuration.storeGBeans(gbeans);
        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
        config.setAttribute("ID", new URI("test"));
        config.setReferencePatterns("Parent", null);
        config.setAttribute("classPath", Collections.EMPTY_LIST);
        config.setAttribute("gBeanState", state);
        config.setAttribute("dependencies", Collections.EMPTY_LIST);
        File sourceFile = null;
        try {
            sourceFile = File.createTempFile("test", ".car");
            URL source = sourceFile.toURL();
            JarOutputStream jos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(sourceFile)));
            jos.putNextEntry(new ZipEntry("META-INF/config.ser"));
            ObjectOutputStream oos = new ObjectOutputStream(jos);
            config.getGBeanData().writeExternal(oos);
            oos.flush();
            jos.closeEntry();
            jos.close();
            ArrayList list = new ArrayList(1);
            list.add(store.install(source));
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        earConfigBuilder.buildConfiguration(plan, jarFile, unpackedDir);
        return unpackedDir;
    }

    private GBeanMBean[] loadPOJOWebService(File module) throws Exception {
        GBeanMBean gbean = new GBeanMBean(POJOWSGBean.getGBeanInfo());
        //TODO fill up the POJOWSGBean info
        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
        gbean.setAttribute("classList", classList);
        gbean.setAttribute("moduleURL", module.toURL());
        return new GBeanMBean[]{gbean};
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        gbean.setAttribute("moduleURL", module.toURL());
        return new GBeanMBean[]{gbean};
    }

    private GBeanMBean[] loadEJBWebService(File installLocation, File module) throws Exception {
        GBeanMBean config = loadConfig(installLocation);
        config.setAttribute("baseURL", installLocation.toURL());
        GBeanMBean gbean = new GBeanMBean(EJBWSGBean.getGBeanInfo());
        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
        gbean.setAttribute("classList", classList);
        gbean.setAttribute("ejbConfig", config.getTarget());
        return new GBeanMBean[]{gbean, config};
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

    protected ObjectName kerberosCE;

    public void setUp() throws Exception {
        super.setUp();

        GBeanMBean gbean = new GBeanMBean("org.apache.geronimo.security.realm.providers.KerberosSecurityRealm");
        kerberosRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=TOOLAZYDOGS.COM");
        gbean.setAttribute("realmName", "TOOLAZYDOGS.COM");
        gbean.setAttribute("maxLoginModuleAge", new Long(1 * 1000));
        gbean.setAttribute("debug", new Boolean(true));
        gbean.setAttribute("useTicketCache", new Boolean(true));
        gbean.setAttribute("doNotPrompt", new Boolean(true));
        kernel.loadGBean(kerberosRealm, gbean);
        kernel.startGBean(kerberosRealm);
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        printResults("FastClass", end, start, iterations);

        // start a kernel
        Kernel kernel = new Kernel();
        kernel.boot();
        GBeanMBean mockGBean = new GBeanMBean(MockGBean.getGBeanInfo(), Speed.class.getClassLoader());
        mockGBean.setAttribute("Name", "bar");
        mockGBean.setAttribute("FinalInt", new Integer(57));
        ObjectName objectName = new ObjectName("speed:type=MockGBean");
        kernel.loadGBean(objectName, mockGBean);
        kernel.startGBean(objectName);

        // reflect proxy
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.