@Override public Class getDecoratorClass() { if (create != null) { return create.decorator(); } else { return null; } }
@Override public void postConstruct() { super.postConstruct(); create = getAnnotation(targetMethod, Create.class); resolverType = create.resolver(); try { model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(), new LocalStringManagerImpl(targetType), habitat.<DomDocument>getService(DomDocument.class), commandName, AnnotationUtil.presentTransitive(ManagedJob.class, create.decorator()), create.resolver(), create.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()); logger.log(Level.SEVERE, ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, commandName); throw new RuntimeException(msg, e); } }
CreationDecorator<ConfigBeanProxy> decorator = habitat.getComponent(create.decorator()); if (decorator==null) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.decorator_not_found", "The CreationDecorator {0} could not be found in the habitat, is it annotated with @Service ?", create.decorator().toString()); result.failure(logger, msg); throw new TransactionFailure(msg);
decorator = habitat.getService(create.decorator()); "GenericCreateCommand.decorator_not_found", "The CreationDecorator {0} could not be found in the habitat, is it annotated with @Service ?", create == null ? "null" : create.decorator().toString()); result.failure(logger, msg); throw new TransactionFailure(msg);
public void postConstruct() { super.postConstruct(); create = getAnnotation(targetMethod, Create.class); resolverType = create.resolver(); try { model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(), new LocalStringManagerImpl(targetType), habitat.getComponent(DomDocument.class), commandName, create.resolver(), create.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); } }