Package com.atlassian.confluence.event
Class TimingEventPublisher
- java.lang.Object
-
- com.atlassian.confluence.event.TimingEventPublisher
-
- All Implemented Interfaces:
com.atlassian.event.api.EventListenerRegistrar,com.atlassian.event.api.EventPublisher
@ThreadSafe @Internal public class TimingEventPublisher extends Object implements com.atlassian.event.api.EventPublisher
AnEventPublisherimplementation that times how long it takes to publish an event, and logs a warning if the time is above a threshold. Warnings are not started until the object receives anApplicationStartedEvent, to avoid warnings during the startup process which are known to produce slow events.- Since:
- 5.5.5
-
-
Field Summary
Fields Modifier and Type Field Description static org.joda.time.DurationEVENT_PUBLISH_WARN_THRESHOLD_DEFAULTDefault for the maximum time for a publish attempt to complete before logging warnings.static StringEVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTYSystem property to configure the maximum time for a publish attempt to complete before logging warnings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimingEventPublishercreate(com.atlassian.event.api.EventPublisher delegate)voidpublish(Object event)voidregister(Object listener)voidunregister(Object listener)voidunregisterAll()
-
-
-
Field Detail
-
EVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTY
public static final String EVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTY
System property to configure the maximum time for a publish attempt to complete before logging warnings.
-
EVENT_PUBLISH_WARN_THRESHOLD_DEFAULT
public static final org.joda.time.Duration EVENT_PUBLISH_WARN_THRESHOLD_DEFAULT
Default for the maximum time for a publish attempt to complete before logging warnings. 5 seconds.
-
-
Method Detail
-
create
public static TimingEventPublisher create(com.atlassian.event.api.EventPublisher delegate)
-
register
public void register(Object listener)
- Specified by:
registerin interfacecom.atlassian.event.api.EventListenerRegistrar
-
unregister
public void unregister(Object listener)
- Specified by:
unregisterin interfacecom.atlassian.event.api.EventListenerRegistrar
-
unregisterAll
public void unregisterAll()
- Specified by:
unregisterAllin interfacecom.atlassian.event.api.EventListenerRegistrar
-
publish
public void publish(Object event)
- Specified by:
publishin interfacecom.atlassian.event.api.EventPublisher
-
-