net.sourceforge.pain.network.console
Class ConsoleAdapter
java.lang.Object
net.sourceforge.pain.network.console.ConsoleAdapter
- Direct Known Subclasses:
- TelnetConsoleAdapter
- public abstract class ConsoleAdapter
- extends java.lang.Object
Method Summary |
void |
closedRemote()
|
abstract void |
flush()
this method used to notify console adapter that end of the current text output reached
if adapter wants it may flush this output every time we send text
but adapter MUST flush all it's output buffer when we call flush manually.
|
protected abstract void |
forceClose()
|
abstract java.lang.String |
getRemoteAddr()
|
void |
init(AbstractConsoleManager cm)
super class should call this method ONLY when it ready
to accept data |
void |
lineReceived(java.lang.String line)
|
abstract void |
outText(java.lang.String text)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NEW_LINE
public static final java.lang.String NEW_LINE
- See Also:
- Constant Field Values
console
protected BasicConsole console
ConsoleAdapter
public ConsoleAdapter()
init
public void init(AbstractConsoleManager cm)
- super class should call this method ONLY when it ready
to accept data
lineReceived
public void lineReceived(java.lang.String line)
forceClose
protected abstract void forceClose()
closedRemote
public void closedRemote()
outText
public abstract void outText(java.lang.String text)
flush
public abstract void flush()
throws java.io.IOException
- this method used to notify console adapter that end of the current text output reached
if adapter wants it may flush this output every time we send text
but adapter MUST flush all it's output buffer when we call flush manually.
NOTE: method impl should not block!
- Throws:
java.io.IOException
getRemoteAddr
public abstract java.lang.String getRemoteAddr()
- Returns:
- remote IP