T resource = null;
try {
resource = resourceSubclass.newInstance();
} catch (InstantiationException e) {
log.error("Cannot instantiate the resource", e);
throw new BusinessLogicException("Cannot instantiate the resource of class " + resourceSubclass, e);
} catch (IllegalAccessException e) {
log.error("Cannot instantiate the resource", e);
throw new BusinessLogicException("Cannot instantiate the resource of class " + resourceSubclass, e);
}
//Contract identity
Contract contract = contractReader.getContract(contractId);
resource.setContract(contract);