CommandFactory.createCommand() method
This method searches the
command registry(CMDREG table) for an entry corresponding to the specified
command name (Interface)and storeId. if no entry is found for specified store,
it will look for an entry corresponding to storeId=0. if both fail, it will
check for a default implementation of the command from the interface and
returns an entry that represent the default implementation of the interface.
Ex:
static final String defaultCommandClassName = "com.ibm.commerce.sample.commands.MyNewControllerCmdImpl";
so, when you make a command with the CommandFactory class, you need to pass in the interface name, rather than the implementation class, since the field looked up in the database is the CMDREG.INTERFACE field.
if you specify the implementation class (MyNewControllerCmdImpl) rather than the interface (MyNewControllerCmd) may result in a ClassNotFoundException.
static final String defaultCommandClassName = "com.ibm.commerce.sample.commands.MyNewControllerCmdImpl";
so, when you make a command with the CommandFactory class, you need to pass in the interface name, rather than the implementation class, since the field looked up in the database is the CMDREG.INTERFACE field.
if you specify the implementation class (MyNewControllerCmdImpl) rather than the interface (MyNewControllerCmd) may result in a ClassNotFoundException.
Comments