Only change will be in config file.
<context:annotation-config />
<!-- Enable AspectJ style of Spring AOP -->
<aop:aspectj-autoproxy />
<!-- Configure Aspect Beans, without this Aspects advise won't execute -->
<bean name="manyAspects" class="com.javabykiran.AspectCode" />
<bean id="invoice" class="com.javabykiran.Invoice" />
Client code will also change accordingly
ApplicationContext context = new ClassPathXmlApplicationContext("spconfig.xml");
Invoice invoice = (Invoice)context.getBean("invoice");
System.out.println(invoice);
invoice.receivePayment();
invoice.returnCash();