Examples of GBeanMBean


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

            throw AxisFault.makeFault(e);
        }
    }

    public static void setUpTimer(Kernel kernel) throws Exception {
        GBeanMBean threadPoolGBean = new GBeanMBean(ThreadPool.GBEAN_INFO);
        threadPoolGBean.setAttribute("keepAliveTime", new Integer(5000));
        threadPoolGBean.setAttribute("poolSize", new Integer(5));
        threadPoolGBean.setAttribute("poolName", "DefaultThreadPool");
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.THREADPOOL_NAME, threadPoolGBean, kernel);
        GBeanMBean transactionalTimerGBean = new GBeanMBean(VMStoreThreadPooledTransactionalTimer.GBEAN_INFO);
        transactionalTimerGBean.setAttribute("repeatCount", new Integer(5));
        transactionalTimerGBean.setReferencePattern("TransactionContextManager", AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME);
        transactionalTimerGBean.setReferencePattern("ThreadPool", AxisGeronimoConstants.THREADPOOL_NAME);
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTIONAL_TIMER_NAME, transactionalTimerGBean, kernel);
        GBeanMBean nonTransactionalTimerGBean = new GBeanMBean(VMStoreThreadPooledNonTransactionalTimer.GBEAN_INFO);
        nonTransactionalTimerGBean.setReferencePattern("ThreadPool", AxisGeronimoConstants.THREADPOOL_NAME);
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.NONTRANSACTIONAL_TIMER_NAME, nonTransactionalTimerGBean, kernel);
    }
View Full Code Here

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

        }
    }

    public void startWebContainer(Kernel kernel) throws Exception {
        Set containerPatterns = Collections.singleton(AxisGeronimoConstants.WEB_CONTAINER_NAME);
        GBeanMBean container = new GBeanMBean("org.apache.geronimo.jetty.JettyContainerImpl");
        GBeanMBean connector = new GBeanMBean("org.apache.geronimo.jetty.connector.HTTPConnector");
        connector.setAttribute("port", new Integer(AxisGeronimoUtils.AXIS_SERVICE_PORT));
        connector.setReferencePatterns("JettyContainer", containerPatterns);
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.WEB_CONTAINER_NAME, container, kernel);
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.WEB_CONNECTOR_NAME, connector, kernel);
    }
View Full Code Here

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

            throw AxisFault.makeFault(e);
        }
    }

    public void startEJBContainer(Kernel kernel) throws Exception {
        GBeanMBean containerIndexGBean = new GBeanMBean("org.openejb.ContainerIndex");
        Set ejbContainerNames = new HashSet();
        ejbContainerNames.add(ObjectName.getInstance(AxisGeronimoConstants.J2EE_DOMAIN_NAME
                + ":j2eeType=StatelessSessionBean,*"));
        ejbContainerNames.add(ObjectName.getInstance(AxisGeronimoConstants.J2EE_DOMAIN_NAME
                + ":j2eeType=StatefulSessionBean,*"));
        ejbContainerNames.add(ObjectName.getInstance(AxisGeronimoConstants.J2EE_DOMAIN_NAME
                + ":j2eeType=EntityBean,*"));
        containerIndexGBean.setReferencePatterns("EJBContainers",
                ejbContainerNames);
        AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.EJB_CONTAINER_NAME,
                containerIndexGBean, kernel);
    }
View Full Code Here

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

        UserTransaction userTransaction = new OnlineUserTransaction();
        ReadOnlyContext compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp, userTransaction, webClassLoader);

        Security security = SecurityBuilder.buildSecurityConfig(jettyWebApp.getSecurity());

        GBeanMBean gbean;
        try {
            if (security == null) {
                gbean = new GBeanMBean(JettyWebAppContext.GBEAN_INFO, webClassLoader);
            } else {
                gbean = new GBeanMBean(JettyWebAppJACCContext.GBEAN_INFO, webClassLoader);
                gbean.setAttribute("securityConfig", security);

                String policyContextID;
                if (earContext.getApplicationObjectName() == null) {
                    policyContextID = module.getName();
                } else {
                    policyContextID = earContext.getApplicationObjectName().toString();
                }
                gbean.setAttribute("policyContextID", policyContextID);
            }

            gbean.setAttribute("uri", URI.create(module.getTargetPath() + "/"));
            gbean.setAttribute("componentContext", compContext);
            gbean.setAttribute("userTransaction", userTransaction);
            gbean.setAttribute("webClassPath", webClassPath);
            // unsharableResources, applicationManagedSecurityResources
            GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(gbean);
            ENCConfigBuilder.setResourceEnvironment(earContext, webModule.getModuleURI(), rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());

            gbean.setAttribute("contextPath", webModule.getContextRoot());
            gbean.setAttribute("contextPriorityClassLoader", Boolean.valueOf(contextPriorityClassLoader));

            gbean.setReferencePattern("TransactionContextManager", earContext.getTransactionContextManagerObjectName());
            gbean.setReferencePattern("TrackedConnectionAssociator", earContext.getConnectionTrackerObjectName());
            gbean.setReferencePattern("JettyContainer", new ObjectName("*:type=WebContainer,container=Jetty")); // @todo configurable
        } catch (Exception e) {
            throw new DeploymentException("Unable to initialize webapp GBean", e);
        }
        earContext.addGBean(webModuleName, gbean);
        return null;
View Full Code Here

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

//    }

    protected void setUp() throws Exception {
        kernel = new Kernel(KERNEL_NAME, "test.domain");
        kernel.boot();
        GBeanMBean ctc = new GBeanMBean(MockConnectionTrackingCoordinator.getGBeanInfo());
        ctcName = ObjectName.getInstance("test:role=ConnectionTrackingCoordinator");
        kernel.loadGBean(ctcName, ctc);
        GBeanMBean cmf = new GBeanMBean(GenericConnectionManager.getGBeanInfo());
        cmf.setAttribute("transactionSupport", NoTransactions.INSTANCE);
        cmf.setAttribute("pooling", new NoPool());
        cmf.setAttribute("name", "TestCF");
        cmf.setReferencePatterns("ConnectionTracker", Collections.singleton(ctcName));
        cmfName = ObjectName.getInstance("test:role=ConnectionManagerFactory");
        kernel.loadGBean(cmfName, cmf);

        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo", "testapplication", "testmodule", TARGET_NAME, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
        managedConnectionFactoryName = NameFactory.getResourceComponentName(null, null, null, null, null, null, j2eeContext);

        GBeanMBean mcfw = new GBeanMBean(ManagedConnectionFactoryWrapper.getGBeanInfo());
        mcfw.setAttribute("managedConnectionFactoryClass", MockManagedConnectionFactory.class);
        mcfw.setAttribute("connectionFactoryInterface", ConnectionFactory.class);
        mcfw.setAttribute("implementedInterfaces", new Class[] {Serializable.class, ConnectionFactoryExtension.class});
        mcfw.setAttribute("connectionFactoryImplClass", MockConnectionFactory.class);
        mcfw.setAttribute("connectionInterface", Connection.class);
        mcfw.setAttribute("connectionImplClass", MockConnection.class);
        mcfw.setAttribute("globalJNDIName", GLOBAL_NAME);
        //"ResourceAdapterWrapper",
        mcfw.setReferencePatterns("ConnectionManagerFactory", Collections.singleton(cmfName));
        //"ManagedConnectionFactoryListener",
        kernel.loadGBean(managedConnectionFactoryName, mcfw);

        kernel.startGBean(ctcName);
        kernel.startGBean(cmfName);
View Full Code Here

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

    protected void setUp() throws Exception {
        super.setUp();
        kernel = new Kernel(DOMAIN);
        kernel.boot();
        GBeanMBean gbean;
        gbean = new GBeanMBean(ServerInfo.getGBeanInfo());
        gbean.setAttribute("baseDirectory", System.getProperty("java.io.tmpdir"));
        kernel.loadGBean(SERVER_INFO_NAME, gbean);

        gbean = new GBeanMBean(J2EEDomainImpl.GBEAN_INFO);
        kernel.loadGBean(DOMAIN_NAME, gbean);

        gbean = new GBeanMBean(J2EEServerImpl.GBEAN_INFO);
        gbean.setReferencePatterns("ServerInfo", Collections.singleton(SERVER_INFO_NAME));
        kernel.loadGBean(SERVER_NAME, gbean);


        kernel.loadGBean(JVM_NAME, new GBeanMBean(JVMImpl.GBEAN_INFO));
        kernel.startGBean(SERVER_INFO_NAME);
        kernel.startGBean(DOMAIN_NAME);
        kernel.startGBean(SERVER_NAME);
        kernel.startGBean(JVM_NAME);
        mbServer = kernel.getMBeanServer();
View Full Code Here

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

    public void setUp() throws Exception {
        kernel = new Kernel("test.kernel", "simple.geronimo.test");
        kernel.boot();

        GBeanMBean gbean;

        // Create all the parts

        gbean = new GBeanMBean(ServerInfo.GBEAN_INFO);
        serverInfo = new ObjectName("geronimo.system:role=ServerInfo");
        gbean.setAttribute("baseDirectory", ".");
        kernel.loadGBean(serverInfo, gbean);
        kernel.startGBean(serverInfo);

        gbean = new GBeanMBean("org.apache.geronimo.security.jaas.LoginService");
        loginService = new ObjectName("geronimo.security:type=LoginService");
        gbean.setReferencePatterns("Realms", Collections.singleton(new ObjectName("geronimo.security:type=SecurityRealm,*")));
        gbean.setAttribute("reclaimPeriod", new Long(100));
        gbean.setAttribute("algorithm", "HmacSHA1");
        gbean.setAttribute("password", "secret");
        kernel.loadGBean(loginService, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.security.realm.providers.PropertiesFileSecurityRealm");
        kerberosRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=properties-realm");
        gbean.setAttribute("realmName", "properties-realm");
        gbean.setAttribute("maxLoginModuleAge", new Long(1 * 1000));
        gbean.setAttribute("usersURI", (new File(new File("."), "src/test-data/data/users.properties")).toURI());
        gbean.setAttribute("groupsURI", (new File(new File("."), "src/test-data/data/groups.properties")).toURI());
        gbean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfo));
        kernel.loadGBean(kerberosRealm, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
        kernel.loadGBean(subsystemRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:0"));
        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
        kernel.loadGBean(asyncTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
        kernel.loadGBean(jmxRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
        secureSubsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter,type=secure");
        kernel.loadGBean(secureSubsystemRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
        gbean.setReferencePatterns("Router", Collections.singleton(secureSubsystemRouter));
        saslTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=sasl");
        kernel.loadGBean(saslTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4243"));
        gbean.setReferencePatterns("Router", Collections.singleton(secureSubsystemRouter));
        gssapiTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=gssapi");
        kernel.loadGBean(gssapiTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(secureSubsystemRouter));
        secureJmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter,type=secure");
        kernel.loadGBean(secureJmxRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.LoginServiceStub");
        gbean.setReferencePatterns("Router", Collections.singleton(secureJmxRouter));
        serverStub = new ObjectName("geronimo.remoting:target=LoginServiceStub");
        kernel.loadGBean(serverStub, gbean);

        kernel.startGBean(loginService);
        kernel.startGBean(kerberosRealm);
View Full Code Here

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

            // create and initialize GBeans
            gbeans = loadGBeans(gbeanState, classLoader);

            // set configurationBaseUrl attribute on each gbean
            for (Iterator i = gbeans.values().iterator(); i.hasNext();) {
                GBeanMBean gbean = (GBeanMBean) i.next();
                setGBeanBaseUrl(gbean, baseURL);
            }

            // register all the GBeans
            for (Iterator i = gbeans.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry) i.next();
                ObjectName name = (ObjectName) entry.getKey();
                GBeanMBean gbean = (GBeanMBean) entry.getValue();
                log.trace("Registering GBean " + name);
                try {
                    kernel.loadGBean(name, gbean);
                } catch (JMRuntimeException e) {
                    Throwable cause = e.getCause();
View Full Code Here

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

            ObjectInputStream ois = new ConfigInputStream(new ByteArrayInputStream(gbeanState), cl);
            try {
                while (true) {
                    GBeanData gbeanData = new GBeanData();
                    gbeanData.readExternal(ois);
                    GBeanMBean gbean = new GBeanMBean(gbeanData, cl);

                    gbeans.put(gbeanData.getName(), gbean);
                }
            } catch (EOFException e) {
                // ok
View Full Code Here

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

            throw (AssertionError) new AssertionError("Unable to initialize ObjectOutputStream").initCause(e);
        }
        for (Iterator i = gbeans.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            ObjectName objectName = (ObjectName) entry.getKey();
            GBeanMBean gbean = (GBeanMBean) entry.getValue();
            try {
                GBeanData gbeanData = gbean.getGBeanData();
                // todo we must explicitly set the bean name here from the gbean key because the gbean mbean may
                // not have been brought online, so the object namve in the gbean mbean will be null
                gbeanData.setName(objectName);
                gbeanData.writeExternal(oos);
            } catch (Exception e) {
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.