Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 37 java ee 8 return interceptionFactory createInterceptedInstance new EmployeeBeanWrapper employeeBean Notice that I have now added the filterMethods part to select all methods with the name persist For this service that would be only one method Subsequently the code adds the @ Transaction annotation to that method via a TransactionLiteral which works in the same way as the RememberMeAnnotationLiteral shown above I also need a wrapper again which this time is created by subclassing the service instead of using an interface Its shown below public class EmployeeBeanWrapper extends EmployeeService private EmployeeService employeeBean public EmployeeBeanWrapper public EmployeeBeanWrapper EmployeeService employeeBean this employeeBean employeeBean EmployeeService getWrapped return employeeBean @ Override public void persist Employee employee getWrapped persist employee @ Override
You must have JavaScript enabled to view digital editions.