de.grogra.imp.net
Class Connection
java.lang.Object
de.grogra.imp.net.Connection
- All Implemented Interfaces:
- java.lang.Runnable
public class Connection
- extends java.lang.Object
- implements java.lang.Runnable
Constructor Summary |
Connection(java.net.Socket socket)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Connection
public Connection(java.net.Socket socket)
throws java.io.IOException
- Throws:
java.io.IOException
addMessageHandler
public void addMessageHandler(MessageHandler h)
beginMessage
public long beginMessage(java.lang.String message,
ResponseHandler rh)
throws java.io.IOException
- Throws:
java.io.IOException
beginResponse
public long beginResponse(long requestId,
ResponseHandler rh)
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
consumeByte
public void consumeByte(int value)
throws java.io.IOException
- Throws:
java.io.IOException
consumeInt
public void consumeInt(int value)
throws java.io.IOException
- Throws:
java.io.IOException
end
public void end(long messageId)
throws java.io.IOException
- Throws:
java.io.IOException
getIn
public java.io.DataInputStream getIn()
getOut
public java.io.DataOutputStream getOut()
getSocket
public java.net.Socket getSocket()
handleMessage
protected boolean handleMessage(long messageId,
java.lang.String message,
boolean checkAvailability)
throws java.io.IOException
- Throws:
java.io.IOException
isAvailable
public SimpleResponseHandler isAvailable(java.lang.String message)
throws java.io.IOException
- Throws:
java.io.IOException
isClosed
public boolean isClosed()
removeMessageHandler
public void removeMessageHandler(MessageHandler h)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
skipRest
public void skipRest()
throws java.io.IOException
- Throws:
java.io.IOException
start
public void start()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object