Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- new ClassPathXmlApplicationContext("/springtests/test01.xml");
- }
- ApplicationContext ctx = new ClassPathXmlApplicationContext("/springtests/test01.xml");
- MyClass myObj= MyClass.class.cast(ctx.getBean("myBeanName"));
- myObj.doStuff();
- public static CountDownLatch shutdownLatch = new CountDownLatch(1);
- public static void main(String[] args) {
- ApplicationContext context =
- new ClassPathXmlApplicationContext("/springtests/test01.xml");
- try {
- shutdownLatch.await();
- } finally {
- context.close();
- }
- }
Add Comment
Please, Sign In to add comment