1 2 17 18 package org.springframework.context; 19 20 23 public class BeanThatListens implements ApplicationListener { 24 25 private int events; 26 27 30 public BeanThatListens() { 31 super(); 32 } 33 34 public void zero() { 35 events = 0; 36 } 37 38 41 public void onApplicationEvent(ApplicationEvent e) { 42 ++events; 43 } 45 46 public int getEventCount() { 47 return events; 48 } 49 50 } 51 | Popular Tags |