use of org.apache.openejb.jee.oejb3.PojoDeployment in project tomee by apache.
the class AdvancedProviderConfigTest method service.
@Module
public static EjbModule service() throws Exception {
final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
final EnterpriseBean bean = new SingletonBean(AdvancedBean.class).localBean();
module.getEjbJar().addEnterpriseBean(bean);
final Resources resources = new Resources();
final Service feature = new Service("xml", null);
feature.setClassName(JAXBElementProvider.class.getName());
feature.getProperties().put("eventHandler", "$handler");
resources.getService().add(feature);
final Service handler = new Service("handler", null);
handler.setClassName(MyValidator.class.getName());
resources.getService().add(handler);
module.initResources(resources);
final PojoDeployment e = new PojoDeployment();
e.setClassName("jaxrs-application");
e.getProperties().setProperty("cxf.jaxrs.providers", "xml");
module.getOpenejbJar().getPojoDeployment().add(e);
return module;
}
use of org.apache.openejb.jee.oejb3.PojoDeployment in project tomee by apache.
the class CustomContextTest method service.
@Module
public static EjbModule service() throws Exception {
final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
final SingletonBean bean = new SingletonBean(CustomContextInjectedBean.class);
bean.setLocalBean(new Empty());
module.getEjbJar().addEnterpriseBean(bean);
final PojoDeployment e = new PojoDeployment();
e.setClassName("jaxrs-application");
e.getProperties().setProperty("cxf.jaxrs.providers", CustomProvider.class.getName());
module.getOpenejbJar().getPojoDeployment().add(e);
return module;
}
use of org.apache.openejb.jee.oejb3.PojoDeployment in project tomee by apache.
the class FeatureTest method app.
@Module
public EjbModule app() {
final StatelessBean bean = (StatelessBean) new StatelessBean(MySecondRestClass.class).localBean();
bean.setRestService(true);
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(bean);
final OpenejbJar openejbJar = new OpenejbJar();
final PojoDeployment e = new PojoDeployment();
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;
}
Aggregations