constructor = parent.getClass().getConstructor(types2);
object = (ObjectNode) constructor.newInstance(args2);
parentUri.getStore().storeObject(parentUri, object);
} catch (ClassNotFoundException ex) {
// Can't find role implementing class
throw new ObjectNotFoundException(subjectUri);
} catch (NoSuchMethodException ex) {
// Can't find appropriate constructor
throw new ObjectNotFoundException(subjectUri);
} catch (InstantiationException ex) {
// Can't instatiate object
throw new ObjectNotFoundException(subjectUri);
} catch (InvocationTargetException ex) {
// Can't invoke constructor
throw new ObjectNotFoundException(subjectUri);
} catch (IllegalAccessException ex) {
// Constructor is not public
throw new ObjectNotFoundException(subjectUri);
} catch (ObjectAlreadyExistsException ex) {
// Should never happen
e.printStackTrace();
throw new ObjectNotFoundException(subjectUri);
}
return subjectUri.getStore().retrieveObject(subjectUri);
}
}
}