Skip to main content

[javaee-spec users] [jsr342-experts] Interceptors in JAX-WS

  • From: Antonio Goncalves <antonio.goncalves@...>
  • To: jsr342-experts <jsr342-experts@...>
  • Subject: [javaee-spec users] [jsr342-experts] Interceptors in JAX-WS
  • Date: Mon, 29 Oct 2012 18:03:57 +0100
  • List-id: <jsr342-experts.javaee-spec.java.net>

Hi all,

One difference between Servlet and EJB endpoint in JAX-WS is that EJB's can use interceptors (and with CDI, interceptor binding) :

@WebService
@Stateless
public class CardValidator {

  @LoggableInterceptor
  public boolean validate(CreditCard creditCard) {
  }
}


Which is not possible with just Servlet endpoint 

@WebService
public class CardValidator {

  @InterceptorDoesNotWork
  public boolean validate(CreditCard creditCard) {
  }
}

If we spread CDI and Managed Beans all over, I would think that Servlet endpoint are managed beans, therefore interceptors would work... as well as transactions  :

@WebService
@Transactional
public class CardValidator {

  @InterceptorShouldWork
  public boolean validate(CreditCard creditCard) {
  }
}


What you all think ?


--
Antonio Goncalves
Software architect and Java Champion

Web site | TwitterLinkedInParis JUG | Devoxx France


[javaee-spec users] [jsr342-experts] Interceptors in JAX-WS

Antonio Goncalves 10/29/2012
 
 
Close
loading
Please Confirm
Close