Hi
Why do you have to customize these interceptors ?
Have a look at
org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor
it shows how all this info can be obtained...
Cheers, Sergey
On 17/10/14 15:35, Vassilis Virvilis wrote:
Hi,
I managed to install my own JAXRSInInterceptor and JAXRSOutInterceptor.
What I would like is to log the final method name and parameter values
for logging purposes. I have done something similar for SOAP in the past
but the crucial BindingOperationInfo is null in case of rest.
Any ideas?
private String getMethod(Message message) {
final BindingOperationInfo bop =
message.getExchange().getBindingOperationInfo();
if (bop != null) {
final MethodDispatcher md = (MethodDispatcher) message
.getExchange().get(Service.class)
.get(MethodDispatcher.class.getName());
Object parameters = message.getContent(List.class);
if (parameters == null) {
parameters = message.getContent(Object.class);
}
return String.format("%s(%s)", md.getMethod(bop).getName(),
StringUtils.preetyPrintObject(new StringBuilder(),
parameters,
-1));
}
final Method method = (Method) message
.get("org.apache.cxf.resource.method");
if (method != null) {
return method.getName();
}
return "unknown";
}
Vassilis Virvilis
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com