[jboss-user] [EJB 3.0] - have interceptors fire when calling ejb3 web service method

teraryan do-not-reply at jboss.com
Thu Mar 12 09:34:34 EDT 2009


It's easiest to explain by giving an example. I have an EJB3 stateless session / web method annotated with interceptors:

@Interceptors({a.class, b.class})
  | @WebMethod
  | public String processService(String request)
  | 

Now I need to create another method that, instead of returning a String, returns a more complex object, ie. But the more complex Object can be created using a String from calling processService(), ie.


  | @WebMethod
  | public ComplexObject processServiceComplex(String request)  {
  |   return new ComplexObject(processService(request));
  | }

But when I do this (implementing processServiceComplex in the same class as processService), the interceptors for processService don't fire. Is there any way I can get them to fire? I can't use all the interceptors on processServiceComplex, because some of them expect a String as the return value. I also want both methods to be available in the same web services interface, although they don't necessarily need to be in the same class. Basically, I want to re-use the interceptors if possible. Is there any way to do this?

Thanks


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217455#4217455

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217455



More information about the jboss-user mailing list