moduleInfo = resolved.getAppInfo();
}
if(moduleInfo instanceof WebModuleInfo) {
// Check for web composite
ModelObject unresolved = new ModelObjectImpl();
unresolved.setUri(URI.create("WEB-INF/web.composite"));
ModelObject resolved = resolver.resolveModel(ModelObject.class, unresolved);
if(resolved != unresolved) {
// Found web composite
Composite appComposite = (Composite)resolved.getObject();
implementation.getServices().addAll(appComposite.getServices());
implementation.getReferences().addAll(appComposite.getReferences());
implementation.getProperties().addAll(appComposite.getProperties());
}
// TODO: Obtain includeDefaults value from the composite
boolean includeDefaults = false;
if(includeDefaults || resolved == unresolved) {
if(jeeOptionalExtension != null) {
ComponentType ct = jeeOptionalExtension.createImplementationJeeComponentType((WebModuleInfo)moduleInfo);
implementation.getReferences().addAll(ct.getReferences());
implementation.getProperties().addAll(ct.getProperties());
}
}
} else if(moduleInfo instanceof EjbModuleInfo) {
// Check for ejb-jar composite
ModelObject unresolved = new ModelObjectImpl();
unresolved.setUri(URI.create("META-INF/ejb-jar.composite"));
ModelObject resolved = resolver.resolveModel(ModelObject.class, unresolved);
if(resolved != unresolved) {
// Found ejb-jar composite
Composite appComposite = (Composite)resolved.getObject();
implementation.getServices().addAll(appComposite.getServices());
implementation.getReferences().addAll(appComposite.getReferences());
implementation.getProperties().addAll(appComposite.getProperties());
}
// TODO: Obtain includeDefaults value from the composite
boolean includeDefaults = false;
if(includeDefaults || resolved == unresolved) {
if(jeeExtension != null) {
ComponentType ct = jeeExtension.createImplementationJeeComponentType((EjbModuleInfo)moduleInfo);
implementation.getServices().addAll(ct.getServices());
}
if(jeeOptionalExtension != null) {
ComponentType ct = jeeOptionalExtension.createImplementationJeeComponentType((EjbModuleInfo)moduleInfo);
implementation.getServices().addAll(ct.getServices());
implementation.getReferences().addAll(ct.getReferences());
implementation.getProperties().addAll(ct.getProperties());
}
}
} else if(moduleInfo instanceof JavaEEApplicationInfo) {
// Check for application composite
Composite appComposite = null;
if(extEar != null) {
appComposite = extEar.getAppComposite();
} else {
ModelObject unresolved = new ModelObjectImpl();
unresolved.setUri(URI.create("META-INF/application.composite"));
ModelObject resolved = resolver.resolveModel(ModelObject.class, unresolved);
if(resolved != unresolved) {
// Found application composite
appComposite = (Composite)resolved.getObject();
}