()
| 411 | |
| 412 | |
| 413 | @Override |
| 414 | public final void recycle() { |
| 415 | // StreamProcessor instances are not re-used. |
| 416 | |
| 417 | // Calling removeRequestProcessor even though the RequestProcesser was |
| 418 | // never added will add the values from the RequestProcessor to the |
| 419 | // running total for the GlobalRequestProcessor |
| 420 | RequestGroupInfo global = handler.getProtocol().getGlobal(); |
| 421 | if (global != null) { |
| 422 | global.removeRequestProcessor(request.getRequestProcessor()); |
| 423 | } |
| 424 | |
| 425 | /* |
| 426 | * Clear the statistics ready for re-use of the request. If we don't clear the statistics, the statistics for |
| 427 | * the current request will be included in the statistics for all future requests. |
| 428 | */ |
| 429 | request.getRequestProcessor().recycleStatistcs(); |
| 430 | |
| 431 | // Clear fields that can be cleared to aid GC and trigger NPEs if this |
| 432 | // is reused |
| 433 | setSocketWrapper(null); |
| 434 | } |
| 435 | |
| 436 | |
| 437 | @Override |
no test coverage detected