use of org.codehaus.stomp.StompFrame in project narayana by jbosstm.
the class TcpTransport method run.
/**
* reads packets from a Socket
*/
public void run() {
log.trace("StompConnect TCP consumer thread starting");
while (!stopped.get()) {
try {
StompFrame frame = marshaller.unmarshal(dataIn);
log.debug("Sending stomp frame");
try {
inputHandler.onStompFrame(frame);
} catch (IOException e) {
if (frame.getAction().equals(Stomp.Responses.ERROR)) {
log.warn("Could not send frame to client: " + new String(frame.getContent()));
}
throw e;
}
} catch (Throwable e) {
// no need to log EOF exceptions
if (e instanceof EOFException) {
// Happens when the remote side disconnects
log.debug("Caught an EOFException: " + e.getMessage(), e);
} else {
log.fatal("Caught an exception: " + e.getMessage(), e);
}
try {
stop();
} catch (Exception e2) {
log.warn("Caught while closing: " + e2 + ". Now Closed", e2);
}
}
}
}
Aggregations