public abstract class AbstractDelegatingCommandFactory extends AbstractLoggingBean implements CommandFactory
Modifier and Type | Field and Description |
---|---|
private CommandFactory |
delegate |
private java.lang.String |
name |
log
Modifier | Constructor and Description |
---|---|
protected |
AbstractDelegatingCommandFactory(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
Command |
createCommand(ChannelSession channel,
java.lang.String command)
Create a command with the given name.
|
protected Command |
createUnsupportedCommand(java.lang.String command) |
protected abstract Command |
executeSupportedCommand(java.lang.String command) |
CommandFactory |
getDelegateCommandFactory() |
abstract boolean |
isSupportedCommand(java.lang.String command) |
void |
setDelegateCommandFactory(CommandFactory factory) |
java.lang.String |
toString() |
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
split
private final java.lang.String name
private CommandFactory delegate
protected AbstractDelegatingCommandFactory(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public CommandFactory getDelegateCommandFactory()
public void setDelegateCommandFactory(CommandFactory factory)
public Command createCommand(ChannelSession channel, java.lang.String command) throws java.io.IOException
CommandFactory
createCommand
in interface CommandFactory
channel
- The ChannelSession
through which the command has been receivedcommand
- The command that will be runnull
Command
instancejava.io.IOException
- if failed to create the instancepublic abstract boolean isSupportedCommand(java.lang.String command)
command
- The command about to be executedtrue
if this command is supported by the command factory, false
if it will be
passed on to the delegate
factoryprotected abstract Command executeSupportedCommand(java.lang.String command)
protected Command createUnsupportedCommand(java.lang.String command)