package com.example.spring.aop; import org.springframework.context.support.ClassPathXmlApplicationContext; public class BankApp { /** * @param args */ public static void main(String[] args) { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] { "classpath:META-INF/spring/applicationContext.xml",}); Account acc = ctx.getBean("account", Account.class); acc.printDetails(); // 250 acc.withdraw(10); acc.printDetails(); // 240 acc.deposit(20); acc.printDetails(); // 260 System.out.println("An exception should occur here if attempted to withdraw a large amount."); // acc.withdraw(1200); // Uncommented, this should throw an exception acc.printDetails(); // 260 ctx.close(); } }