}
}
}
// Clone the prototype request
Request request = getClientResource().createRequest(
getClientResource().getRequest());
// The Java method was annotated
request.setMethod(annotation.getRestletMethod());
// Set the entity
request.setEntity(requestEntity);
// Updates the client preferences if they weren't changed
if ((request.getClientInfo().getAcceptedCharacterSets().size() == 0)
&& (request.getClientInfo().getAcceptedEncodings()
.size() == 0)
&& (request.getClientInfo().getAcceptedLanguages()
.size() == 0)
&& (request.getClientInfo().getAcceptedMediaTypes()
.size() == 0)) {
List<Variant> responseVariants = annotation
.getResponseVariants(getClientResource()
.getMetadataService(), getClientResource()
.getConverterService());
if (responseVariants != null) {
request.setClientInfo(new ClientInfo(responseVariants));
}
}
// Effectively handle the call
Response response = getClientResource().handle(request);