@Override public void postConstruct() { super.postConstruct(); delete = targetMethod.getAnnotation(Delete.class); resolverType = delete.resolver(); try { // we pass false for "useAnnotations" as the @Param declarations on // the target type are not used for the Delete method parameters. model = new GenericCommandModel(targetType, false, delete.cluster(), delete.i18n(), new LocalStringManagerImpl(targetType), habitat.getComponent(DomDocument.class), commandName, delete.resolver(), delete.decorator()); if (logger.isLoggable(level)) { for (String paramName : model.getParametersNames()) { CommandModel.ParamModel param = model.getModelFor(paramName); logger.fine("I take " + param.getName() + " parameters"); } } } catch(Exception e) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.command_model_exception", "Exception while creating the command model for the generic command {0} : {1}", commandName, e.getMessage()); logger.severe(msg); throw new ComponentException(msg, e); } }
@Override public void postConstruct() { super.postConstruct(); delete = targetMethod.getAnnotation(Delete.class); resolverType = delete.resolver(); try { // we pass false for "useAnnotations" as the @Param declarations on // the target type are not used for the Delete method parameters. model = new GenericCommandModel(targetType, false, delete.cluster(), delete.i18n(), new LocalStringManagerImpl(targetType), habitat.<DomDocument>getService(DomDocument.class), commandName, AnnotationUtil.presentTransitive(ManagedJob.class, delete.decorator()), delete.resolver(), delete.decorator()); if (logger.isLoggable(level)) { for (String paramName : model.getParametersNames()) { CommandModel.ParamModel param = model.getModelFor(paramName); logger.log(Level.FINE, "I take {0} parameters", param.getName()); } } } catch(Exception e) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.command_model_exception", "Exception while creating the command model for the generic command {0} : {1}", commandName, e.getMessage()); LogHelper.log(logger, Level.SEVERE, ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, e, new Object[] {commandName}); throw new RuntimeException(msg, e); } }