Package org.apache.openejb.config

Examples of org.apache.openejb.config.ConfigurationFactory.configureApplication()


            // are re-declared in a compatible way
            ejbJar.addEnterpriseBean(new SingletonBean("Other", Bean.class));

            EjbModule ejbModule = new EjbModule(ejbJar);
            AppModule module = new AppModule(ejbModule);
            app = assembler.createApplication(config.configureApplication(module));
        }

        BeanContext bean = app.getBeanContexts().get(0);

        ModuleContext module = bean.getModuleContext();
View Full Code Here


        ejbJar.addEnterpriseBean(new SingletonBean(One.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Four.class));
        ejbJar.addEnterpriseBean(new StatelessBean(Three.class));

        // startup and trigger @PostConstruct
        assembler.createApplication(config.configureApplication(ejbJar));

        assertEquals(expected(four, three, two, one), actual);

        actual.clear();
View Full Code Here

        ejbJar.addEnterpriseBean(new SingletonBean(One.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Four.class)).setInitOnStartup(false);
        ejbJar.addEnterpriseBean(new SingletonBean(Three.class)).setInitOnStartup(false);

        // startup and trigger @PostConstruct
        assembler.createApplication(config.configureApplication(ejbJar));

        assertEquals(expected(four, three, two, one), actual);

        actual.clear();
View Full Code Here

        ejbJar.addEnterpriseBean(new SingletonBean(Two.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Three.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Four.class)).setDependsOn("Five");

        try {
            config.configureApplication(ejbJar);
            fail("Validation should have found a circular reference");
        } catch (ValidationFailedException e) {
            ValidationFailure[] failures = e.getFailures();
            assertEquals(1, failures.length);
            assertEquals("dependsOn.noSuchEjb", failures[0].getMessageKey());
View Full Code Here

        ejbJar.addEnterpriseBean(new SingletonBean(Two.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Three.class));
        ejbJar.addEnterpriseBean(new SingletonBean(Four.class)).setDependsOn("One");

        try {
            config.configureApplication(ejbJar);
            fail("Validation should have found a circular reference");
        } catch (ValidationFailedException e) {
            ValidationFailure[] failures = e.getFailures();
            assertEquals(1, failures.length);
            assertEquals("dependsOn.circuit", failures[0].getMessageKey());
View Full Code Here

        ejbJar.addEnterpriseBean(new SingletonBean(Two.class));
        ejbJar.addEnterpriseBean(new SingletonBean(One.class));

        // startup and trigger @PostConstruct
        assembler.createApplication(config.configureApplication(ejbJar));

        assertTrue(one, actual.contains(one));
        assertTrue(two, actual.contains(two));
    }
View Full Code Here

        StatelessBean statelessBean = ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
        EjbDeployment deployment = openejbJar.addEjbDeployment(statelessBean);
        deployment.getProperties().put("openejb.client.connection.strategy", "test");

        assembler.createApplication(config.configureApplication(ejbModule));

        Properties props = new Properties();
        props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
        props.put("java.naming.provider.url", "failover:sticky:ejbd://agwdt:9999,ejbd://127.0.0.1:" + port);
        Context context = new InitialContext(props);
View Full Code Here

        StatelessBean statelessBean = ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
        EjbDeployment deployment = openejbJar.addEjbDeployment(statelessBean);
        deployment.getProperties().put("openejb.client.connection.strategy", "test");

        assembler.createApplication(config.configureApplication(ejbModule));

        Properties props = new Properties();
        props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
        props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
        Context context = new InitialContext(props);
View Full Code Here

        final AppModule appModule = new AppModule(loader, "testapp");

        appModule.getClientModules().add(clientModule);
        appModule.getEjbModules().add(ejbModule);

        assembler.createApplication(config.configureApplication(appModule));

        final Properties props = new Properties();
        props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
        props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
        props.put("openejb.client.moduleId", "orange-client");
View Full Code Here

        // Setup the descriptor information

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(WidgetBean.class));

        assembler.createApplication(config.configureApplication(ejbJar));

        WidgetBean.lifecycle.clear();

        expectedLifecycle = Arrays.asList(Lifecycle.values());
        inTxExpectedLifecycle = new ArrayList<Lifecycle>();
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.