background image

 
}
  }

    在 运 行 期 , ApplicationContext 会 自 动 在 当 前 的 所 有 Bean 中 寻 找
ApplicationListener 接 口 的 实 现 , 并 将 其 作 为 事 件 接 收 对 象 。 当
Application.publishEvent 方法调用时,所有的 ApplicationListener 接口实现都会被
激发,每个 ApplicationListener 可根据事件的类型判断是否是自己需要处理的事件,
如上面的 ActionListener 只处理 ActionEvent 事件。