Index: trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListener.java
===================================================================
--- trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListener.java	(revision 1374)
+++ trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListener.java	(revision 1382)
@@ -44,5 +44,8 @@
 /**
  * <p>
- * TODO comment
+ * recording an exchange can not be done in one step. This is due to the fact, that the proxy
+ * servlet notifies different processing states for requests and response. An exchange listener
+ * records all these event. On the occurrence of the final event, it compiles an
+ * {@link HttpExchange} and forwards it to the exchange handler.
  * </p>
  * 
@@ -52,35 +55,51 @@
     
     /**
-     * 
+     * <p>
+     * the exchange handler to forward compiles exchanges to
+     * </p>
      */
     private HttpMonitorExchangeHandler exchangeHandler;
     
     /**
-     * 
+     * <p>
+     * the request of compiled exchange
+     * </p>
      */
     private HttpServletRequest request;
 
     /**
-     * 
+     * <p>
+     * the content of the request of compiled exchange
+     * </p>
      */
     private List<ByteBuffer> requestData = new LinkedList<ByteBuffer>();
     
     /**
-     * 
+     * <p>
+     * the response of compiled exchange
+     * </p>
      */
     private HttpServletResponse response;
 
     /**
-     * 
+     * <p>
+     * the content of the response of compiled exchange
+     * </p>
      */
     private List<ByteBuffer> responseData = new LinkedList<ByteBuffer>();
     
     /**
-     * 
+     * <p>
+     * the last time an event for the exchange was received (used for supporting timeouts)
+     * </p>
      */
     private long lastUpdate = System.currentTimeMillis();
     
     /**
-     *
+     * <p>
+     * initialized the exchange listener with the exchange handler to forward compiled exchanges to
+     * </p>
+     * 
+     * @param exchangeHandler the exchange handler to forward compiled exchanges to
      */
     ExchangeListener(HttpMonitorExchangeHandler exchangeHandler) {
@@ -89,5 +108,9 @@
 
     /**
-     * 
+     * <p>
+     * called, when the request was received by the proxy
+     * </p>
+     * 
+     * @param request the request of the exchange
      */
     public void onRequest(HttpServletRequest request) throws IllegalStateException {
@@ -103,5 +126,9 @@
 
     /**
-     * 
+     * <p>
+     * called, when some content of the request was processed by the proxy
+     * </p>
+     * 
+     * @param data the processed content of the request of the exchange
      */
     public void onRequestContent(ByteBuffer data) {
@@ -117,5 +144,9 @@
     
     /**
-     * 
+     * <p>
+     * called, when the response is to be returned by the proxy
+     * </p>
+     * 
+     * @param response the response of the exchange
      */
     public void onResponse(HttpServletResponse response) {
@@ -131,5 +162,9 @@
     
     /**
-     * 
+     * <p>
+     * called, when some content of the response was processed by the proxy
+     * </p>
+     * 
+     * @param data the processed content of the response of the exchange
      */
     public void onResponseContent(ByteBuffer data) {
@@ -145,5 +180,9 @@
     
     /**
-     * 
+     * <p>
+     * called, when proxy finished proxying a request
+     * </p>
+     * 
+     * @param status the status of the proxying after finalization
      */
     public void onFinish(Status status) {
@@ -159,5 +198,5 @@
     
     /**
-     * @return the request
+     * @return the request of the exchange
      */
     HttpServletRequest getRequest() {
@@ -166,5 +205,5 @@
 
     /**
-     *
+     * @return the last time this listener received an event
      */
     long getLastUpdate() {
@@ -173,5 +212,10 @@
 
     /**
-     *
+     * <p>
+     * convenience method to compile an {@link HttpExchange} and send it to the exchange handler
+     * after finalization of the exchange.
+     * </p>
+     * 
+     * @param status the status of the proxying after finalization
      */
     private void sendToExchangeHandler(Status status) {
@@ -202,5 +246,7 @@
 
     /**
-     *
+     * <p>
+     * convenience method to map an {@link HttpServletRequest} to an {@link HttpRequest}
+     * </p>
      */
     private HttpRequest map(HttpServletRequest request, ObjectFactory eventObjectFactory) {
@@ -261,5 +307,7 @@
 
     /**
-     *
+     * <p>
+     * convenience method to map an {@link HttpServletResponse} to an {@link HttpResponse}
+     * </p>
      */
     private HttpResponse map(HttpServletResponse response, ObjectFactory eventObjectFactory) {
@@ -297,5 +345,7 @@
 
     /**
-     *
+     * <p>
+     * convenience method to create a string out of recorded request or response content
+     * </p>
      */
     private String createString(List<ByteBuffer> bufferList) {
