June 2018
Intermediate to advanced
408 pages
11h 23m
English
We will define a regular Spring bean as target bean, say TransferService, and then, using ProxyFactoryBean, we will create a proxy that will be accessed by our application. To advice the transfer method of TransferService, we will set the point expression using AspectJExpressionPointcut and we will create the interceptor, which we will set into DefaultPointcutAdvisor to create the advisor.
The target object or bean is as follows:
public class TransferServiceImpl implements TransferService { private static final Logger LOGGER = Logger.getLogger(TransferServiceImpl.class); @Override public boolean transfer(Account source, Account dest, Double amount) { // transfer amount from source account to dest account LOGGER.info("Transferring ...Read now
Unlock full access