@Override
public void build(DeploymentUnit unit, Set<String> attachmentNames, Map<String, ManagedObject> managedObjects)
throws DeploymentException {
ManagedObject vdbMO = managedObjects.get(VDBMetaData.class.getName());
if (vdbMO != null) {
VDBMetaData vdb = (VDBMetaData) vdbMO.getAttachment();
for (Model m : vdb.getModels()) {
ManagedObject mo = this.mof.initManagedObject(m, ModelMetaData.class, m.getName(),m.getName());
if (mo == null) {
throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
}
managedObjects.put(mo.getName(), mo);
}
for (Translator t: vdb.getOverrideTranslators()) {
ManagedObject mo = this.mof.initManagedObject(t, VDBTranslatorMetaData.class, t.getName(), t.getName());
if (mo == null) {
throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
}
managedObjects.put(mo.getName(), mo);
}
}
}