Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 33 java ee 8 interceptionFactory configure add new RememberMeAnnotationLiteral 86400 cookieMaxAgeSeconds false cookieSecureOnly true cookieHttpOnly JREMEMBERMEID cookieName true isRememberMe Finally the above mentioned new proxy can be created with the configured interceptor binding applied to it using the interception factorys createInterceptedInstance method and return this from the produce method of the ApplicationInit bean that was shown at the start of this section return interceptionFactory createInterceptedInstance new HttpAuthenticationMechanismWrapper wrapper Note that theres a small caveat here if the Interceptor needs access to the interceptor bindings which is almost always the case when the binding has attributes you cannot just inspect the target type as you would usually do in CDI 12 and earlier code The interceptor binding annotation is not physically present on the type At present its not entirely clear how to obtain these in a portable way The interceptors in the Java EE Security reference implementation Soteria use a reference implementation specific way for now As a second example Ill demonstrate another use case where the Java Transaction API JTA @ Transactional annotation is dynamically applied to a single method of a bean For this example consider a simple Employee entity defined as follows @ Entity public class Employee
You must have JavaScript enabled to view digital editions.