Package org.apache.openejb.assembler.classic

Examples of org.apache.openejb.assembler.classic.Assembler.createApplication()


        assertEquals(1, ejbJar.interceptors.get(0).aroundInvoke.size());
        assertEquals(1, ejbJar.interceptors.get(0).postConstruct.size());

        assertEquals(3, ejbJar.interceptorBindings.size());

        assembler.createApplication(ejbJar);

        InitialContext ctx = new InitialContext();
        Target target = (Target) ctx.lookup("TargetBeanLocal");
        target.echo(new ArrayList());
View Full Code Here


        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(bean);

        CounterBean.instances.set(0);
        assembler.createApplication(config.configureApplication(ejbJar));

        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

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(bean);

        CounterBean.instances.set(0);
        assembler.createApplication(config.configureApplication(ejbJar));

        String failoverURI = "failover:sticky:";
        failoverURI += "ejbd://127.0.0.1:" + daemons.get(0).getPort() + "?red,";
        failoverURI += "ejbd://127.0.0.1:" + daemons.get(1).getPort() + "?blue";
View Full Code Here

        assertEquals(asList(Everything.class.getName()), beanInfo.businessLocal);
        assertEquals(asList(Everything.class.getName()), beanInfo.businessRemote);
        assertEquals(Everything.class.getName(), beanInfo.serviceEndpoint);

        assembler.createApplication(ejbJarInfo);

        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        BeanContext deployment = containerSystem.getBeanContext(beanInfo.ejbDeploymentId);

        assertEquals(asList(Everything.class), deployment.getBusinessLocalInterfaces());
View Full Code Here

                Assembler assembler = new Assembler();
                assembler.buildContainerSystem(config.getOpenEjbConfiguration());

                final AppInfo appInfo = config.configureApplication(appModule);

                final AppContext appContext = assembler.createApplication(appInfo);

                try {
                    final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
                    final BeanContext context = containerSystem.getBeanContext(javaClass.getName());
View Full Code Here

        beans.addManagedClass(ProducesEjbInjector.class);

        EjbModule module = new EjbModule(ejbJar);
        module.setBeans(beans);

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

        Properties properties = new Properties(System.getProperties());
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
        ctx = new InitialContext(properties);
    }
View Full Code Here

        appModule.getWebModules().add(webModule);
        appModule.getEjbModules().add(new EjbModule(ejbJar));
        annotationDeployer.deploy(appModule);

        AppInfo appInfo = factory.configureApplication(appModule);
        final AppContext application = assembler.createApplication(appInfo);

        Context ctx = (Context) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{Context.class}, new InvocationHandler() {
            @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                if (args.length == 1 && args[0].equals("SimpleEJBLocalBean")) {
                    return new SimpleEJB();
View Full Code Here

                try {
                    contextInfo = addContextInfo(standardContext.getHostname(), standardContext);
                    AppInfo appInfo = configurationFactory.configureApplication(appModule);
                    contextInfo.appInfo = appInfo;

                    appContext = a.createApplication(contextInfo.appInfo, classLoader);
                    // todo add watched resources to context
                } catch (Exception e) {
                    logger.error("Unable to deploy collapsed ear in war " + standardContext.getPath() + ": Exception: " + e.getMessage(), e);
                }
            }
View Full Code Here

        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Orange", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Apple", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Peach", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Pear", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Plum", Fruit.class));
        assembler.createApplication(config.configureApplication(ejbJar));

        try {

            // good creds
            Properties props = new Properties();
View Full Code Here

        assertTrue(beanInfo.properties.containsKey("color"));
        assertTrue(beanInfo.properties.containsKey("openejb.client.color"));
        assertEquals("orange", beanInfo.properties.get("color"));
        assertEquals("red", beanInfo.properties.get("openejb.client.color"));
       
        assembler.createApplication(ejbJarInfo);

        ContainerSystem cs = SystemInstance.get().getComponent(ContainerSystem.class);
        BeanContext info = cs.getBeanContext("WidgetBean");
        assertNotNull(info);
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.