Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.SingletonBean


        ejbJar.getAssemblyDescriptor().addInterceptorBinding(new InterceptorBinding("*", InternalSecurityInterceptor.class.getName()));
        module.getMbeans().add(JMXDeployer.class.getName());

        final String className = "org.apache.tomee.catalina.deployer.WebappDeployer";
        if (exists(className)) {
            final SingletonBean bean = ejbJar.addEnterpriseBean(new SingletonBean("openejb/WebappDeployer", className));
            final EjbDeployment deployment = openejbJar.addEjbDeployment(bean);
            deployment.getProperties().put("openejb.jndiname.format", "{deploymentId}{interfaceType.annotationName}");

            final SingletonBean exceptionManager = ejbJar.addEnterpriseBean(new SingletonBean("openejb/ExceptionManagerFacade", "org.apache.tomee.catalina.facade.ExceptionManagerFacadeBean"));
            final EjbDeployment exceptionMgr = openejbJar.addEjbDeployment(exceptionManager);
            exceptionMgr.getProperties().put("openejb.jndiname.format", "{deploymentId}{interfaceType.annotationName}");
        }


View Full Code Here


            .build();
    }

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

@RunWith(ValidationRunner.class)
public class CheckDependsOnTest {
    @Keys({@Key(value = "dependsOn.circuit", count = 2), @Key(value = "dependsOn.noSuchEjb", count = 2)})
    public EjbJar dependsOn() throws OpenEJBException {
        final EjbJar ejbJar = new EjbJar();
        final SingletonBean one = new SingletonBean(One.class);
        final SingletonBean two = new SingletonBean(Two.class);
        final SingletonBean three = new SingletonBean(Three.class);
        final SingletonBean four = new SingletonBean(Four.class);
        final SingletonBean five = new SingletonBean(Five.class);
        final SingletonBean six = new SingletonBean(Six.class);
        ejbJar.addEnterpriseBean(one);
        ejbJar.addEnterpriseBean(two);
        ejbJar.addEnterpriseBean(three);
        ejbJar.addEnterpriseBean(four);
        ejbJar.addEnterpriseBean(five);
View Full Code Here

    public EjbJar test() throws Exception {
        final EjbJar ejbJar = new EjbJar();
        final StatelessBean testBean = ejbJar.addEnterpriseBean(new StatelessBean("TestStateless", TestBean.class));
        testBean.addAroundInvoke("wrongMethod");
        testBean.addPostConstruct("wrongMethod");
        ejbJar.addEnterpriseBean(new SingletonBean("TestSingleton", TestBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("FooStateful", FooBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("BarStateful", BarBean.class));
        final StatefulBean starBean = ejbJar.addEnterpriseBean(new StatefulBean("StarStateful", StarBean.class));
        starBean.setAfterBeginMethod(new NamedMethod("myAfterBegin"));
        starBean.setBeforeCompletionMethod(new NamedMethod("myBeforeCompletion"));
View Full Code Here

public class CheckInvalidConcurrencyAttributeTest extends TestCase {
    @Keys({@Key(value = "ann.invalidConcurrencyAttribute", type = KeyType.WARNING), @Key(value = "aroundInvoke.invalidArguments")})
    public EjbJar test() throws Exception {
        System.setProperty("openejb.validation.output.level", "VERBOSE");
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new SingletonBean(TestBean.class));
        return ejbJar;
    }
View Full Code Here

@RunWith(ApplicationComposer.class)
public class ContextServiceTest {
    @Module
    public EnterpriseBean bean() {
        return new SingletonBean(ContextServiceFacade.class).localBean();
    }
View Full Code Here

@RunWith(ApplicationComposer.class)
public class InjectionTest {
    @Module
    public EnterpriseBean bean() {
        return new SingletonBean(CUBean.class).localBean();
    }
View Full Code Here

            .build();
    }

    @Module
    public EnterpriseBean bean() {
        return new SingletonBean(CustomCUBean.class).localBean();
    }
View Full Code Here

    @Module
    public EjbModule module() {
        final EjbModule module = new EjbModule(new EjbJar());
        module.setOpenejbJar(new OpenejbJar());

        final SingletonBean bean = new SingletonBean(MyWebservice.class);
        bean.setLocalBean(new Empty());

        final EjbDeployment deployment = new EjbDeployment(bean);
        deployment.getProperties().setProperty("openejb.endpoint.configurator", CustomConfigurator.class.getName());

        module.getOpenejbJar().addEjbDeployment(deployment);
View Full Code Here

    }

    @Module
    public EjbModule app() {
        final EjbJar jar = new EjbJar();
        jar.addEnterpriseBean(new SingletonBean(AuthenticatorServiceBean.class).localBean());

        final OpenejbJar openejbJar = new OpenejbJar();
        openejbJar.addEjbDeployment(new EjbDeployment(jar.getEnterpriseBeans()[0]));
        final Properties properties = openejbJar.getEjbDeployment().iterator().next().getProperties();
        properties.setProperty(CxfService.OPENEJB_JAXWS_CXF_FEATURES, MyFeature.class.getName());
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.