Search in sources :

Example 1 with FieldAccessMode

use of org.apache.johnzon.mapper.access.FieldAccessMode in project tomee by apache.

the class TomEEJsonbProviderTest method service.

@Module
public static EjbModule service() {
    final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
    final EnterpriseBean bean = new SingletonBean(Endpoint.class).localBean();
    module.getEjbJar().addEnterpriseBean(bean);
    final Resources resources = new Resources();
    final Service configuredTomEEJsonbProvider = new Service("configuredTomEEJsonbProvider", null);
    configuredTomEEJsonbProvider.setClassName(TomEEJsonbProvider.class.getName());
    configuredTomEEJsonbProvider.getProperties().put("dateFormat", "MMM-yyyy");
    configuredTomEEJsonbProvider.getProperties().put("locale", Locale.GERMANY);
    configuredTomEEJsonbProvider.getProperties().put("accessMode", new FieldAccessMode(true, true));
    resources.getService().add(configuredTomEEJsonbProvider);
    module.initResources(resources);
    final PojoDeployment e = new PojoDeployment();
    e.setClassName("jaxrs-application");
    e.getProperties().setProperty("cxf.jaxrs.providers", "configuredTomEEJsonbProvider");
    module.getOpenejbJar().getPojoDeployment().add(e);
    return module;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) OpenejbJar(org.apache.openejb.jee.oejb3.OpenejbJar) EnterpriseBean(org.apache.openejb.jee.EnterpriseBean) EjbModule(org.apache.openejb.config.EjbModule) Service(org.apache.openejb.config.sys.Service) PojoDeployment(org.apache.openejb.jee.oejb3.PojoDeployment) Resources(org.apache.openejb.config.sys.Resources) FieldAccessMode(org.apache.johnzon.mapper.access.FieldAccessMode) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) Module(org.apache.openejb.testing.Module)

Aggregations

FieldAccessMode (org.apache.johnzon.mapper.access.FieldAccessMode)1 EjbModule (org.apache.openejb.config.EjbModule)1 Resources (org.apache.openejb.config.sys.Resources)1 Service (org.apache.openejb.config.sys.Service)1 EjbJar (org.apache.openejb.jee.EjbJar)1 EnterpriseBean (org.apache.openejb.jee.EnterpriseBean)1 SingletonBean (org.apache.openejb.jee.SingletonBean)1 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)1 PojoDeployment (org.apache.openejb.jee.oejb3.PojoDeployment)1 Module (org.apache.openejb.testing.Module)1