public class EventManager extends Object
Listener can register and unregister to specific events.
Events can be fired and propagated to listeners.
The following events are supported :
Proxy events : ESIGate process an incoming request (ESIGate configured as a proxy).
EVENT_PROXY_PRE
: before processing an incoming request.EVENT_PROXY_POST
: after processing an incoming request.Fragment events : A fragment is required for inclusion (esi:include). ESIGate will try to use its cache or fallback to an http call to the remote backend.
EVENT_FRAGMENT_PRE
: before retrieving a fragment.EVENT_FRAGMENT_POST
: after retrieving a fragment.Fetch events : An HTTP call is made to a remote backend.
EVENT_FETCH_PRE
: before creating the HTTP call.EVENT_FETCH_POST
: after we receive the response.Render events : Renderers are applied to the current page. This event can be used to inject additional renderers.
EVENT_RENDER_PRE
: before applying renderersEVENT_RENDER_POST
: after applying renderersEncoding event : response is read using the charset declared by HTTP headers.
EVENT_READ_ENTITY
: after reading response using the default encodingModifier and Type | Field and Description |
---|---|
static EventDefinition |
EVENT_FETCH_POST |
static EventDefinition |
EVENT_FETCH_PRE |
static EventDefinition |
EVENT_FRAGMENT_POST |
static EventDefinition |
EVENT_FRAGMENT_PRE |
static EventDefinition |
EVENT_HTTP_BUILDER_INITIALIZATION |
static EventDefinition |
EVENT_PROXY_POST |
static EventDefinition |
EVENT_PROXY_PRE |
static EventDefinition |
EVENT_READ_ENTITY |
static EventDefinition |
EVENT_RENDER_POST |
static EventDefinition |
EVENT_RENDER_PRE |
Constructor and Description |
---|
EventManager(String driverId) |
Modifier and Type | Method and Description |
---|---|
void |
fire(EventDefinition eventDefinition,
Event eventDetails)
Fire a new event and run all the listeners.
|
void |
register(EventDefinition eventDefinition,
IEventListener listener)
Start listening to an event.
|
void |
unregister(EventDefinition eventDefinition,
IEventListener eventListener)
Stop listening to an event.
|
public static final EventDefinition EVENT_FRAGMENT_PRE
public static final EventDefinition EVENT_FRAGMENT_POST
public static final EventDefinition EVENT_FETCH_PRE
public static final EventDefinition EVENT_FETCH_POST
public static final EventDefinition EVENT_PROXY_PRE
public static final EventDefinition EVENT_PROXY_POST
public static final EventDefinition EVENT_RENDER_PRE
public static final EventDefinition EVENT_RENDER_POST
public static final EventDefinition EVENT_READ_ENTITY
public static final EventDefinition EVENT_HTTP_BUILDER_INITIALIZATION
public EventManager(String driverId)
public void register(EventDefinition eventDefinition, IEventListener listener)
eventDefinition
- listener
- public void fire(EventDefinition eventDefinition, Event eventDetails)
eventDefinition
- eventDetails
- public void unregister(EventDefinition eventDefinition, IEventListener eventListener)
eventDefinition
- eventListener
- Copyright © 2008–2018. All rights reserved.