// NOTE: restlet 1.0.8 leaves a dangling thread on each request (see
// EncodeRepresentation.getStream()
// This problem is fixed in latest versions (2.x) of restlet. See the javadocs for
// FixedEncoder for further detail
// Encoder responseEncoder = new com.noelios.restlet.application.Encoder(context);
FixedEncoder encoder = new FixedEncoder(context);
encoder.setEncodeRequest(false);
encoder.setEncodeResponse(true);
encoder.setNext(router);
Decoder decoder = new Decoder(context);
decoder.setDecodeRequest(true);
decoder.setDecodeResponse(false);
decoder.setNext(encoder);