Class TelnetDeamon
java.lang.Object
|
+--TelnetDeamon
- public abstract class TelnetDeamon
- extends java.lang.Object
This class is the abstract root for a Telnet Client/Server example
it provides the underpinnings, but it does not interpret any commands.
The dervied class is expected to interpret the commands (but it won't
need to do any socket manipulation).
- Version:
- 1.0
- Author:
- Paul Regenhardt
Constructor Summary |
TelnetDeamon()
The constructor opens the socket server and listens
for incoming connection requests. |
Method Summary |
static java.lang.String |
get(java.lang.String key)
|
abstract void |
performAction(TelnetThread t,
java.lang.String s)
This is the main processing loop, it is an abstract message
and must be present in your derived class |
void |
setprompt(TelnetThread t)
This method sets the prompt for telnet thread to display. |
static void |
start(java.lang.String[] args)
This method loads the configuration file. |
void |
welcomeMessage(TelnetThread t)
This method requests the telnet thread to display a
welcome message, it's a nice method to overload to get
a specific welcome message for you application. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
config
public static Configuration config
connections
protected java.util.Vector connections
TelnetDeamon
public TelnetDeamon()
- The constructor opens the socket server and listens
for incoming connection requests. When it finds one,
it creates a TelnetThread.
start
public static void start(java.lang.String[] args)
- This method loads the configuration file.
get
public static java.lang.String get(java.lang.String key)
welcomeMessage
public void welcomeMessage(TelnetThread t)
- This method requests the telnet thread to display a
welcome message, it's a nice method to overload to get
a specific welcome message for you application.
setprompt
public void setprompt(TelnetThread t)
- This method sets the prompt for telnet thread to display.
it's a nice method to overload to set
a specific application prompt.
performAction
public abstract void performAction(TelnetThread t,
java.lang.String s)
- This is the main processing loop, it is an abstract message
and must be present in your derived class