cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D'Arcy, Hamlet B" <Hamlet.DA...@Pearson.com>
Subject RE: How to get Class of service implementor in an Interceptor?
Date Tue, 14 Apr 2009 17:27:58 GMT
I was able to do this... But it feels hokey. 

public void handleMessage(Message message) throws Fault {

	final Exchange exchange = message.getExchange();
	final BindingOperationInfo operationInfo =
exchange.get(BindingOperationInfo.class);
	final Service service = exchange.get(Service.class);
	final MethodDispatcher dispatcher =
(MethodDispatcher)service.get(MethodDispatcher.class.getName());
	final Method method = dispatcher.getMethod(operationInfo);

	...
}


--
Hamlet D'Arcy
hamlet.darcy@pearson.com



> -----Original Message-----
> From: D'Arcy, Hamlet B [mailto:Hamlet.DArcy@Pearson.com] 
> Sent: Tuesday, April 14, 2009 9:36 AM
> To: users@cxf.apache.org
> Subject: How to get Class of service implementor in an Interceptor? 
> 
> Is there a way for me to get the Class reference for my service
> implementer within an interceptor? 
> 
> Each WebMethod on my service class is annotated with some permissions
> information. I want to write an interceptor that reads that permission
> information and enforces them. 
> 
> My service class is created through Spring. I'll need a 
> reference to the
> Class of the bean and a way to get the name of the method (or Method
> object) being invoked. 
> 
> Thanks in advance! 
> 
> --
> Hamlet D'Arcy
> hamlet.darcy@pearson.com
> 

Mime
View raw message