response.setHeader("Access-Control-Allow-Origin",
this.config.getHeaderAccessControl());
final TomcatClientResponder responder = new TomcatClientResponder(
response);
final ReadResponse readResponse = new ReadResponse();
final ReadRequest readRequestObject = ReadRequest.checkRequest(request,
readResponse);
if (readRequestObject != null) {
// read status updates
final ReadStatusUpdates readStatusUpdatesCommand = new ReadStatusUpdates(
this, readResponse, readRequestObject);
this.commandQueue.add(readStatusUpdatesCommand);
try {
this.workingQueue.take();
} catch (final InterruptedException e) {
System.err
.println("request status queue failed due to read request");
e.printStackTrace();
}
}
responder.addLine(readResponse.toString());
responder.finish();
}