Package org.apache.openejb.config

Examples of org.apache.openejb.config.EjbModule


        EjbJar ejbJar = new EjbJar();

        StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(EchoBean.class));
        bean.setServiceEndpoint(EchoServiceEndpoint.class.getName());

        return new EjbModule(this.getClass().getClassLoader(), this.getClass().getSimpleName(), "test", ejbJar, null);
    }
View Full Code Here


        EnterpriseBean bean3 = ejbJar.addEnterpriseBean(new StatelessBean(Target3Bean.class));
        InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean3));
        binding.setExcludeDefaultInterceptors(true);
        binding.setExcludeClassInterceptors(true);

        return new EjbModule(ejbJar);
    }
View Full Code Here

  private AppModule getAppModule(InputSource ejbJarSrc, InputSource openEjbJarSrc) throws ConversionException {
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
   
    try {
      EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
          EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
          ejbModule.setClassLoader(classLoader);
          appModule.getEjbModules().add(ejbModule);

      if (openEjbJarSrc != null) {
            InitEjbDeployments initEjbDeployments = new InitEjbDeployments();
            initEjbDeployments.deploy(ejbModule);

            JAXBElement<?> element = (JAXBElement<?>) JaxbOpenejbJar2.unmarshal(OpenejbJarType.class, openEjbJarSrc.getByteStream());
            OpenejbJarType openejbJarType = (OpenejbJarType) element.getValue();
            ejbModule.getAltDDs().put("openejb-jar.xml", openejbJarType); //$NON-NLS-1$

            CmpJpaConversion cmpJpaConversion = new CmpJpaConversion();
            cmpJpaConversion.deploy(appModule);

            OpenEjb2Conversion openEjb2Conversion = new OpenEjb2Conversion();
View Full Code Here

    InputStream is = getClass().getResourceAsStream("empty-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    new EjbReferencesConverter(jdtFacade).convert(appModule);
View Full Code Here

    InputStream is = getClass().getResourceAsStream("nobeans-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    new EjbReferencesConverter(jdtFacade).convert(appModule);
View Full Code Here

    InputStream is = getClass().getResourceAsStream("badsession-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    new EjbReferencesConverter(jdtFacade).convert(appModule);
View Full Code Here

    InputStream is = getClass().getResourceAsStream("emptysession-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    new EjbReferencesConverter(jdtFacade).convert(appModule);
View Full Code Here

    InputStream is = getClass().getResourceAsStream("single-session-bean.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    context.checking(new Expectations() {
View Full Code Here

    InputStream is = getClass().getResourceAsStream("single-session-bean-local.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
    EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
        ejbModule.setClassLoader(classLoader);
   
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
    appModule.getEjbModules().add(ejbModule);
   
    context.checking(new Expectations() {
View Full Code Here

        openejbJar.getPojoDeployment().add(e);
        e.setClassName("jaxrs-application");
        final Properties properties = e.getProperties();
        properties.setProperty(CxfRsHttpListener.CXF_JAXRS_PREFIX + CxfUtil.FEATURES, "my-feature");

        final EjbModule module = new EjbModule(ejbJar);
        module.setOpenejbJar(openejbJar);

        final Resources resources = new Resources();

        final Service feature = new Service("my-feature", null);
        feature.setClassName(MyFeature.class.getName());
        resources.getService().add(feature);

        module.initResources(resources);

        return module;
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.config.EjbModule

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.