users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] Re: Interceptors 1.2 MR candidate is available for the final review

From: Antonio Goncalves <antonio.goncalves_at_gmail.com>
Date: Fri, 12 Apr 2013 11:29:07 +0200

Marina, something that is not clear to me. Let's say you have an
interceptor class that intercept construtor and method invocations,
something like :

public class LoggingInterceptor {

  *_at_AroundConstruct*
  private void logConstructor(InvocationContext ic) throws Exception {...}

  *_at_AroundInvoke*
  public Object logMethod(InvocationContext ic) throws Exception {...}
}


If the bean defines the interceptor on the class, all interceptions
(contructor + method calls) will happen, correct :

*_at_Interceptors(LoggingInterceptor.class)*
public class CustomerService {
  public void createCustomer(Customer customer) {...}
  public Customer findCustomerById(Long id) {...}
}

But if the interceptor is defined only on a method, the @AroundConstruct
will not be invoked. Am I correct here ? By reading the spec this sounds a
bit vague (or I might have missed something)

public class CustomerService {
  public void createCustomer(Customer customer) {...}
* @Interceptors(LoggingInterceptor.class)*
  public Customer findCustomerById(Long id) {...}
}


Thanks
Antonio


On Fri, Apr 12, 2013 at 3:20 AM, Marina Vatkina
<marina.vatkina_at_oracle.com>wrote:

> For those of you who follow the Interceptors 1.2 MR,
>
> I have uploaded what is hopefully the final MR candidate, to the
> Interceptors java.net download page: Update of 0411 with change bars<http://java.net/projects/interceptors-spec/downloads/download/interceptor-1-2-mrel-0411.pdf>.
>
>
> The latest javadoc: javadoc MR candidate<http://java.net/projects/interceptors-spec/downloads/download/javax.interceptor-1-2-mr-candidate.zip>
>
> As you all read the email titled "Issues with interceptors bound to a
> component lifecycle callback", you know why the Interceptors MR did not
> become final when it was originally planned. The exact changes for the
> removal of support for lifecycle callback method interceptors can be found
> in a diff version: Changes to revert support of lifecycle-c allback
> method-level interceptors<http://java.net/projects/interceptors-spec/downloads/download/Chapters-lc-method-level-removed-diff.pdf>
> .
>
> The current version also include some fixed typos and editorial changes to
> clearly list constructor-level interceptors whenever method-level
> interceptors are discussed (if applicable).
>
> Pete, please forward to the CDI EG.
>
> Any review comments must be submitted by the Monday (04/15) to be included.
>
> thanks,
> -marina
>
>
>
>


-- 
Antonio Goncalves
Software architect and Java Champion
Web site <http://www.antoniogoncalves.org> |
Twitter<http://twitter.com/agoncal>|
LinkedIn <http://www.linkedin.com/in/agoncal> | Paris
JUG<http://www.parisjug.org> |
Devoxx France <http://www.devoxx.fr>