Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.SingletonBean


        public void startTheContainer() throws Exception {
            final Map<String, Object> map = new HashMap<String, Object>();


            final EjbJar ejbJar = new EjbJar();
            ejbJar.addEnterpriseBean(new SingletonBean(Widget.class));
            map.put(EJBContainer.MODULES, ejbJar);

            final OpenEjbContainer openEjbContainer = (OpenEjbContainer) EJBContainer.createEJBContainer(map);

            try {
View Full Code Here


        }
    }

    @Module
    public SessionBean getEjbs() {
        return new SingletonBean(OrangeStateful.class);
    }
View Full Code Here

        assertTrue("onPreDestroy was not called", isDestroyed.get());
    }

    @org.apache.openejb.testing.Module
    public SessionBean getEjbs() {
        return new SingletonBean(TestMe.class);
    }
View Full Code Here

    @EJB
    private BuildMeAsync buildMeAsync;

    @Module
    public EnterpriseBean asyncConstructBean() {
        final SingletonBean singletonBean = new SingletonBean(BuildMeAsync.class);
        singletonBean.setInitOnStartup(true);
        return singletonBean.localBean();
    }
View Full Code Here

        assembler.createContainer(config.configureService(SingletonSessionContainerInfo.class));

        // Setup the descriptor information

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new SingletonBean(MySingleton.class));

        assembler.createApplication(config.configureApplication(ejbJar));
    }
View Full Code Here

    final StatefulBean yellowBean = new StatefulBean();
    yellowBean.setEjbClass("com.foo.Yellow");
    yellowBean.setEjbName("Yellow");
    yellowBean.setRemote("com.foo.Color");

    final SingletonBean greenBean = new SingletonBean();
    greenBean.setEjbClass("com.foo.Green");
    greenBean.setEjbName("Green");
    greenBean.setRemote("com.foo.Color");
   
    ejbJar.addEnterpriseBean(redBean);
    ejbJar.addEnterpriseBean(orangeBean);
    ejbJar.addEnterpriseBean(yellowBean);
    ejbJar.addEnterpriseBean(greenBean);
View Full Code Here

    public Blue blue;

    @Module
    public SingletonBean foo() {

        final SingletonBean singletonBean = new SingletonBean(Blue.class);

        singletonBean.getEnvEntry().add(new EnvEntry().name("one").type(String.class).value("hello"));
        singletonBean.getEnvEntry().add(new EnvEntry().name("two").type(String.class).value("false"));
        singletonBean.getEnvEntry().add(new EnvEntry().name(Blue.class.getName() + "/two").type(String.class).value("true"));

        return singletonBean;
    }
View Full Code Here

        return p;
    }

    @Module
    public SingletonBean app() throws Exception {
        final SingletonBean bean = new SingletonBean(Persister.class);
        bean.setLocalBean(new Empty());
        return bean;
    }
View Full Code Here

        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        final AppModule app = new AppModule(OpenEJBXmlByModuleTest.class.getClassLoader(), OpenEJBXmlByModuleTest.class.getSimpleName());

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new SingletonBean(UselessBean.class));
        app.getEjbModules().add(new EjbModule(ejbJar));
        app.getEjbModules().iterator().next().getAltDDs().put("resources.xml", getClass().getClassLoader().getResource("META-INF/resource/appresource.openejb.xml"));

        assembler.createApplication(config.configureApplication(app));
View Full Code Here

    }

    @Module
    public EjbJar app() throws Exception {
        return new EjbJar()
            .enterpriseBean(new SingletonBean(JdbcOne.class).localBean())
            .enterpriseBean(new SingletonBean(JdbcTwo.class).localBean());
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.SingletonBean

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.