public AppModule deploy(AppModule appModule) throws OpenEJBException {
// ApplicationClient META-INF/env-entries.properties
for (ClientModule module : appModule.getClientModules()) {
for (Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
apply(module.getApplicationClient(), envEntry, "AppClient");
}
}
// WebModule META-INF/env-entries.properties
for (WebModule webModule : appModule.getWebModules()) {
deploy(webModule);
}
// Resource Adapters do not have an ENC
// EjbJar META-INF/env-entries.properties
for (EjbModule module : appModule.getEjbModules()) {
for (Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
// To override a specific ejb only
// the following format is used:
// <ejb-name>.name = value
if (envEntry.getName().contains(".")) {
String name = envEntry.getName();
String ejbName = name.substring(0,name.indexOf('.'));
name = name.substring(name.indexOf('.')+1);
EnterpriseBean bean = module.getEjbJar().getEnterpriseBean(ejbName);
if (bean != null){
// Set the new property name without the <ejb-name>. prefix
envEntry.setName(name);
apply(bean, envEntry, bean.getEjbName());
continue;
}
}