Advertisement
mano_paste

msg_service

Dec 18th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. @Component
  2. public class ApplicationSpringContext implements ApplicationContextAware {
  3.  
  4.     private static ApplicationContext context;
  5.  
  6.     public static MessagingService getMessagingService () {
  7.         return (MessagingService ) context.getBean("messageService");
  8.     }
  9.  
  10.  
  11.     @Override
  12.     public void setApplicationContext(ApplicationContext context)
  13.             throws BeansException {
  14.         ApplicationSpringContext.context = context;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement