public interface JohnsonEventContainer
Events
Johnson maintains exactly one event container, which is accessed statically. As a result, all implementations
of this interface are required to be thread-safe. However, because Johnson may be used to filter all requests to the
application, implementations should be careful in how they achieve that thread-safety. Using heavy synchronisation
techniques may impose significant performance penalties.| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(Event event)
Adds the provided event to the collection.
|
Collection<Event> |
getEvents()
Retrieves an immutable view of the contained
Events. |
boolean |
hasEvents()
Retrieves a flag indicating whether there are
Events in the container. |
void |
removeEvent(Event event)
Removes the specified
Event from the container, if it can be found. |
void addEvent(@Nonnull Event event)
event - the event to add@Nonnull Collection<Event> getEvents()
Events.boolean hasEvents()
Events in the container.
This can be thought of as a shortcut for !getEvents().isEmpty().true if there are events; otherwise, falsevoid removeEvent(@Nonnull Event event)
Event from the container, if it can be found.
Warning: Due to how Event.equals(Object) and Event.hashCode() are implemented, an exact
match on every field is required in order to match an event. As a result, it may be necessary to iterate over
the events in the collection and remove the event using the exact instance already in the
collection.event - the event to removeCopyright © 2014 Atlassian. All rights reserved.