if (newDescriptor instanceof EjbDescriptor) {
descriptor.addEjb((EjbDescriptor) newDescriptor);
} else if (newDescriptor instanceof RelationshipDescriptor) {
descriptor.addRelationship((RelationshipDescriptor) newDescriptor);
} else if (newDescriptor instanceof MethodPermissionDescriptor) {
MethodPermissionDescriptor nd = (MethodPermissionDescriptor) newDescriptor;
MethodDescriptor[] array = nd.getMethods();
for (int i=0;i<array.length;i++) {
EjbDescriptor target = descriptor.getEjbByName(array[i].getEjbName());
MethodPermission[] mps = nd.getMethodPermissions();
for (int j=0;j<mps.length;j++) {
DOLUtils.getDefaultLogger().fine("Adding mp " + mps[j] + " to " + array[i] + " for ejb " + array[i].getEjbName());
target.addPermissionedMethod(mps[j], array[i]);
}
}