ikrs.yuccasrv.commandline
Class YuccaCommand
java.lang.Object
ikrs.util.AbstractCommand
ikrs.util.DefaultCommand
ikrs.yuccasrv.commandline.YuccaCommand
- All Implemented Interfaces:
- Command, java.lang.Comparable<Command>
- Direct Known Subclasses:
- CommandHelp, CommandLicense, CommandListen, CommandLogLevel, CommandQuit, CommandStatus, CommandUnlisten, CommandVersion, CommandWarranty
public class YuccaCommand
- extends DefaultCommand
- implements Command
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
YuccaCommand
protected YuccaCommand(java.lang.String name)
YuccaCommand
public YuccaCommand(YuccaCommandFactory myFactory,
java.lang.String name,
BasicType[] params)
setFactory
protected void setFactory(YuccaCommandFactory factory)
getFactory
protected YuccaCommandFactory getFactory()
setName
protected void setName(java.lang.String name)
- Overrides:
setName
in class AbstractCommand
setParams
protected void setParams(BasicType[] params)
- Overrides:
setParams
in class AbstractCommand
execute
public int execute()
- This is the final execution method - the default implementation has only one
simple effect: if the command name equals "QUIT" or "EXIT" (not case sensitive)
the method calls System.exit(0).
Otherwise it returns always 1.
Your subclasses should override this method.
Note that this method does _not_ throw any exceptions!
Its up to a stored internal command handler to handle exceptions.
- Specified by:
execute
in interface Command
- Overrides:
execute
in class DefaultCommand
- Returns:
- a return code that indicates the execution result. It depends
on the context what the exact meaning of the return code is,
but usually the value 0 (zero) implies success.