use of org.apache.openejb.config.WebModule in project tomee by apache.
the class MaxChildTest method app.
@Module
public AppModule app() {
final String jarLocation = "target/" + getClass().getSimpleName();
return new AppModule(Thread.currentThread().getContextClassLoader(), jarLocation, new Application(), true) {
{
getEjbModules().add(new EjbModule(new EjbJar("app"), new OpenejbJar() {
{
getPojoDeployment().add(new PojoDeployment() {
{
setClassName(SimpleContractImpl.class.getName());
getProperties().setProperty("cxf.jaxws.properties", "cxfLargeMsgSize");
}
});
}
}));
getWebModules().add(new WebModule(new WebApp().contextRoot("app").addServlet("ws", SimpleContractImpl.class.getName(), "/ws"), "app", Thread.currentThread().getContextClassLoader(), jarLocation, "app"));
getServices().add(new Service() {
{
setId("cxfLargeMsgSize");
setClassName(Properties.class.getName());
getProperties().setProperty("org.apache.cxf.stax.maxChildElements", "1");
}
});
}
};
}
use of org.apache.openejb.config.WebModule in project tomee by apache.
the class LoggingJAXRSWebAppModuleClassConfigurationTest method service.
@Module
public AppModule service() throws Exception {
final WebModule war = new WebModule(getWebApp(), "/test", Thread.currentThread().getContextClassLoader(), "", "test");
war.getRestApplications().add(LogginTestApplication.class.getName());
final AppModule appModule = new AppModule(getEjbModule(LogginTestApplication.class.getName(), "test"), war);
configureLoggin();
return appModule;
}
use of org.apache.openejb.config.WebModule in project tomee by apache.
the class LoggingJAXRSWebAppModuleTest method service.
@Module
public AppModule service() throws Exception {
final WebModule war = new WebModule(getWebApp(), "/test", Thread.currentThread().getContextClassLoader(), "", "test");
war.getRestApplications().add(LogginTestApplication.class.getName());
final AppModule appModule = new AppModule(getEjbModule("jaxrs-application", "test"), war);
configureLoggin();
return appModule;
}
use of org.apache.openejb.config.WebModule in project tomee by apache.
the class AddContainerCdiBeansExtension method addCdiExtLib.
public void addCdiExtLib(@Observes final BeforeAppInfoBuilderEvent event) {
for (final EjbModule ejbModule : event.getAppModule().getEjbModules()) {
if (ejbModule.getModuleId().startsWith("ear-scoped-cdi-beans")) {
final Beans beans = ejbModule.getBeans();
if (CompositeBeans.class.isInstance(beans)) {
final CompositeBeans cb = CompositeBeans.class.cast(beans);
cb.getManagedClasses().put(EXT_LIB, new ArrayList<>(BEANS));
}
return;
}
}
// else a war
for (final WebModule webModule : event.getAppModule().getWebModules()) {
for (final EjbModule ejbModule : event.getAppModule().getEjbModules()) {
if (ejbModule.getModuleId().equals(webModule.getModuleId())) {
final Beans beans = ejbModule.getBeans();
if (CompositeBeans.class.isInstance(beans)) {
final CompositeBeans cb = CompositeBeans.class.cast(beans);
cb.getManagedClasses().put(EXT_LIB, new ArrayList<>(BEANS));
}
return;
}
}
}
}
use of org.apache.openejb.config.WebModule in project tomee by apache.
the class CheckAnnotations method validate.
@Override
public void validate(final AppModule appModule) {
try {
for (final EjbModule ejbModule : appModule.getEjbModules()) {
module = ejbModule;
findClassesAnnotatedWithWebService(ejbModule);
}
for (final WebModule webModule : appModule.getWebModules()) {
module = webModule;
findClassesAnnotatedWithWebService(webModule);
}
} catch (final Exception e) {
logger.error("Error while validating @WebService annotation", e);
}
}
Aggregations