1
2
3
4
5 package org.directdemocracyportal.democracy.web;
6
7 import org.springframework.context.ApplicationContext;
8 import org.springframework.context.MessageSource;
9 import org.springframework.context.support.ResourceBundleMessageSource;
10
11 import thinwire.ui.event.ActionListener;
12
13 /***
14 * The Class BeanLocator.
15 */
16 public class BeanLocator
17 {
18
19 /***
20 * Gets the application context.
21 *
22 * @return the application context
23 */
24 private static ApplicationContext getApplicationContext() {
25 return StaticContextLoaderListener.getWebApplicationContext();
26 }
27
28 /***
29 * Gets the resource bundle message source.
30 *
31 * @return the resource bundle message source
32 */
33 public static MessageSource getResourceBundleMessageSource() {
34 return (ResourceBundleMessageSource) getApplicationContext().getBean(
35 "messageSource");
36 }
37
38 /***
39 * Gets the application action listener.
40 *
41 * @return the application action listener
42 */
43 public static ActionListener getApplicationActionListener() {
44 return (ActionListener) getApplicationContext().getBean(
45 "applicationActionListener");
46 }
47 }