Changeset 1382 for trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListenerManager.java
- Timestamp:
- 02/13/14 11:28:18 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListenerManager.java
r1381 r1382 35 35 /** 36 36 * <p> 37 * TODO update comment 38 * The log manager handles different {@link HttpMonitorOutputWriter}s to perform the logging 39 * of recorded messages. It initializes a new writer if the first message for a specific 40 * client is received and it closes a writer if for a specific period of time no further message 41 * of the same client was received. The writers themselves consider log rotation. For handling 42 * messages, the {@link HttpMonitorExchangeHandler} mechanism provided by the 43 * {@link HttpMonitorServer} is used. 37 * {@link ExchangeListener}s need to be managed, as there is one instantiated for each proxied 38 * request/response. They need to be timed out, if for a longer time, no update is received. All 39 * this is done by the ExchangeListenerManager. 44 40 * </p> 45 41 * … … 52 48 53 49 /** 50 * <p> 54 51 * the timeout after which a writer of an inactive client is closed 52 * </p> 55 53 */ 56 54 private static final int SESSION_TIMEOUT = 10 * 60 * 1000; 57 55 58 56 /** 59 * 57 * <p> 58 * the exchange handler forwarded to the exchange listeners 59 * </p> 60 60 */ 61 61 private HttpMonitorExchangeHandler exchangeHandler; 62 62 63 63 /** 64 * the mapping of client ids to the respective writers. 64 * <p> 65 * the mapping of requests handled by the proxy to the respective exchange listeners 66 * </p> 65 67 */ 66 68 private Map<HttpServletRequest, ExchangeListener> listeners; 67 69 68 70 /** 69 * a timer used to detect exchange timeouts 71 * <p> 72 * a timer used to detect exchange listener timeouts 73 * </p> 70 74 */ 71 75 private Timer listenerTimer; 72 76 73 77 /** 74 * 75 * 78 * <p> 79 * creates the exchange listener manager with the exchange handler to be forwarded to the 80 * exchange listeners 81 * </p> 82 * 83 * @param exchangeHandler the exchange handler to be forwarded to the exchange listeners 76 84 */ 77 85 ExchangeListenerManager(HttpMonitorExchangeHandler exchangeHandler) { … … 130 138 131 139 /** 132 * 140 * <p> 141 * called, when the request was received by the proxy. Calls the appropriate method on 142 * the exchange listener. 143 * </p> 144 * 145 * @param request the request of the exchange 133 146 */ 134 147 public void onRequest(HttpServletRequest request) throws IllegalStateException { … … 137 150 138 151 /** 139 * 152 * <p> 153 * called, when some content of the request was processed by the proxy. Calls the appropriate 154 * method on the exchange listener. 155 * </p> 156 * 157 * @param request the request of the exchange 158 * @param data the processed content of the request of the exchange 140 159 */ 141 160 public void onRequestContent(HttpServletRequest request, ByteBuffer data) … … 146 165 147 166 /** 148 * 167 * <p> 168 * called, when the response is to be returned by the proxy. Calls the appropriate 169 * method on the exchange listener. 170 * </p> 171 * 172 * @param request the request of the exchange 173 * @param response the response of the exchange 149 174 */ 150 175 public void onResponse(HttpServletRequest request, HttpServletResponse response) … … 155 180 156 181 /** 157 * 182 * <p> 183 * called, when some content of the response was processed by the proxy. Calls the appropriate 184 * method on the exchange listener. 185 * </p> 186 * 187 * @param request the request of the exchange 188 * @param data the processed content of the response of the exchange 158 189 */ 159 190 public void onResponseContent(HttpServletRequest request, ByteBuffer data) … … 164 195 165 196 /** 166 * 197 * <p> 198 * called, when proxy finished proxying a request. Calls the appropriate method on the 199 * exchange listener and afterwards cleans up the listener. 200 * </p> 201 * 202 * @param request the request of the exchange 203 * @param status the status of the proxying after finalization 167 204 */ 168 205 public void onFinish(HttpServletRequest request, Status status) throws IllegalStateException { … … 173 210 174 211 /** 175 * 212 * <p> 213 * convenience method to ensure a listener for a specific HTTP servlet request to be handled. 214 * </p> 176 215 */ 177 216 private ExchangeListener ensureListener(HttpServletRequest request) { … … 194 233 /** 195 234 * <p> 196 * internal timer task used for detecting session timeouts of clients235 * internal timer task used for detecting exchange timeouts 197 236 * </p> 198 237 *
Note: See TracChangeset
for help on using the changeset viewer.