
You should implement your own command handler in your application to allow handle more commands than are implemented in remotecons package.
It is even possible to create many command handlers and use them at the same time. You can put to remote console List containing many implementation of this interface - command handlers and remotecons will use them all. Every command received from the network is passed to all command handlers and result from all handlers are displayed. So be aware for implementing command with the same name in many command handlers. It can produce some side effects and in other cases may be very useful.
Created: Fri Jan 11 10:42:39 2002
Definition at line 45 of file CommandHandlerIfc.java.
Public Methods | |
| String | handleCommand (String command) |
handleCommand handle and process given command as a String here. | |
| String | help () |
help method should return string containing help for all commands provided by this command handler. | |
| String | help (String command) |
help method should return string describing in detail command given as a parameter or empty string if there is no such command in this command handler. | |
| CommandHandlerIfc | getInstance () |
getInstance method should return instance of defined implementation for this instance. | |
|
|
Common implementation should lookds like following: public class MyCommandHandler implements remotecons.ifc.CommandHandlerIfc { (... other methods definition ...) public remotecons.ifc.CommandHandlerIfc getInstance() { return new MyCommandHandler(); } }It is necessary for cases when you create commands handlers which are inner classes. Maybe it is not good practice but very useful for developing and debuging applications which works long time.
Implemented in CommandHandlerImpl, InternalCommands, and SampleCommandHandler. |
|
|
If you will return
To get next command prompt on user side you must return string ended with "
Implemented in CommandHandlerImpl, InternalCommands, and SampleCommandHandler. |
|
|
Implemented in CommandHandlerImpl, InternalCommands, and SampleCommandHandler. |
|
|
Implemented in CommandHandlerImpl, InternalCommands, and SampleCommandHandler. |
1.3-rc2