Example usage for org.springframework.context.support StaticApplicationContext addApplicationListener

List of usage examples for org.springframework.context.support StaticApplicationContext addApplicationListener

Introduction

In this page you can find the example usage for org.springframework.context.support StaticApplicationContext addApplicationListener.

Prototype

@Override
    public void addApplicationListener(ApplicationListener<?> listener) 

Source Link

Usage

From source file:com.bbytes.zorba.jobworker.event.JobEventTest.java

@Test
public void testEventPublishAndListener() {
    JobEvent jobEvent = new JobEvent("testid", JobStatusType.STARTED, null, "Test event");
    StaticApplicationContext context = new StaticApplicationContext();
    context.addApplicationListener(this);
    context.refresh();/*  w ww  .j  a v  a 2  s.co  m*/
    context.publishEvent(jobEvent);
}