Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class AbstractCommand implements Command {
"true".equals(System.getProperty("isMeasuringMetrics", "true"));

protected final Logger LOG = LoggerFactory.getLogger(getClass());

/**
* Using the given <code>builder</code>, constructs a command rooted at the given morphline JSON
* <code>config</code>.
Expand Down Expand Up @@ -304,6 +304,13 @@ protected Command buildCommand(Config cmdConfig, Command currentParent, Command
+ CommandBuilder.class.getName() + " but is: " + cmdClass.getName(), cmdConfig);
}
CommandBuilder builder = (CommandBuilder) obj;

// Since a Command can be invoked by multiple names,
// it could be useful to save the current name used to invoke it
// in order to make it available to the builder.
// In this way we avoid to modify Command interface
getContext().getSettings().put("currentCommandName", cmdName);

Command cmd = builder.build(cmdConfig.getConfig(cmdName), currentParent, finalChild, getContext());
return cmd;
}
Expand Down