Package org.springframework.context

Examples of org.springframework.context.ApplicationListener


    protected void setSubscriptionsOnService(Service service) throws MuleException
    {
        List<String> endpoints = new ArrayList<String>();
        for (Iterator iterator = listeners.iterator(); iterator.hasNext();)
        {
            ApplicationListener listener = (ApplicationListener) iterator.next();
            if (listener instanceof AsynchronousEventListener)
            {
                listener = ((AsynchronousEventListener) listener).getListener();
            }
            if (listener instanceof MuleSubscriptionEventListener)
View Full Code Here


    }
   
    /** {@inheritDoc}*/
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        ctx = (AbstractApplicationContext)applicationContext;
        @SuppressWarnings("rawtypes")
        ApplicationListener listener = new ApplicationListener() {
            public void onApplicationEvent(ApplicationEvent event) {
                SpringBus.this.onApplicationEvent(event);
            }
        };
        ctx.addApplicationListener(listener);
View Full Code Here

    }
   
    /** {@inheritDoc}*/
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        ctx = (AbstractApplicationContext)applicationContext;
        @SuppressWarnings("rawtypes")
        ApplicationListener listener = new ApplicationListener() {
            public void onApplicationEvent(ApplicationEvent event) {
                SpringBus.this.onApplicationEvent(event);
            }
        };
        ctx.addApplicationListener(listener);
View Full Code Here

          }
        }
        if (!this.defaultRetriever.applicationListenerBeans.isEmpty()) {
          BeanFactory beanFactory = getBeanFactory();
          for (String listenerBeanName : this.defaultRetriever.applicationListenerBeans) {
            ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class);
            if (!allListeners.contains(listener) && supportsEvent(listener, eventType, sourceType)) {
              retriever.applicationListenerBeans.add(listenerBeanName);
              allListeners.add(listener);
            }
          }
View Full Code Here

        allListeners.add(listener);
      }
      if (!this.applicationListenerBeans.isEmpty()) {
        BeanFactory beanFactory = getBeanFactory();
        for (String listenerBeanName : this.applicationListenerBeans) {
          ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class);
          allListeners.add(listener);
        }
      }
      OrderComparator.sort(allListeners);
      return allListeners;
View Full Code Here

          log.debug("suppressed " + event);
      }
    };

    // Piggyback on owning application context refresh
    owningApplicationContext.addApplicationListener(new ApplicationListener() {
      public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent)
          ConfigurationProcessor.this.childApplicationContext.refresh();
      }
    });
View Full Code Here

          }
        }
        if (!this.defaultRetriever.applicationListenerBeans.isEmpty()) {
          BeanFactory beanFactory = getBeanFactory();
          for (String listenerBeanName : this.defaultRetriever.applicationListenerBeans) {
            ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class);
            if (!allListeners.contains(listener) && supportsEvent(listener, eventType, sourceType)) {
              retriever.applicationListenerBeans.add(listenerBeanName);
              allListeners.add(listener);
            }
          }
View Full Code Here

        allListeners.add(listener);
      }
      if (!this.applicationListenerBeans.isEmpty()) {
        BeanFactory beanFactory = getBeanFactory();
        for (String listenerBeanName : this.applicationListenerBeans) {
          ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class);
          if (!this.preFiltered && !allListeners.contains(listener)) {
            allListeners.add(listener);
          }
        }
      }
View Full Code Here

        final SessionFactory sessionFactory =
            (SessionFactory) applicationContext.getBean("hibSessionFactory");
        HibUtil.setUpSession(sessionFactory);
       
        if (applicationContext instanceof ConfigurableApplicationContext) {
            ((ConfigurableApplicationContext)applicationContext).addApplicationListener(new ApplicationListener() {
                public void onApplicationEvent(ApplicationEvent event) {
                    if (event instanceof ContextLoadedEvent) {
                        HibUtil.tearDownSession(sessionFactory, null);
                    }
                }
View Full Code Here

    }
   
    /** {@inheritDoc}*/
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        ctx = (AbstractApplicationContext)applicationContext;
        @SuppressWarnings("rawtypes")
        ApplicationListener listener = new ApplicationListener() {
            public void onApplicationEvent(ApplicationEvent event) {
                SpringBus.this.onApplicationEvent(event);
            }
        };
        ctx.addApplicationListener(listener);
View Full Code Here

TOP

Related Classes of org.springframework.context.ApplicationListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.