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

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

Introduction

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

Prototype

@Override
public void publishEvent(ApplicationEvent event) 

Source Link

Document

Publish the given event to all listeners.

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();//  ww  w  .  j  av a 2s . c  o  m
    context.publishEvent(jobEvent);
}