public class JPAEventPublisher extends Object
JPAEventPublisher
is used to publish events pertaining to
EclipseLink and the persistence layer. This class uses a synchronized bus and
will therefore run on the current thread. This is desirable since JPA events
are time-senstive and cannot be executed in an asynchronous manner most of
the time.
This publisher was created specifically for AMBARI-17970. The headless server
thread which monitors the database for things to do (known as the action
scheduler) polls every second. However, it takes EclipseLink up to 1000ms to
update L1 persistence context cache references in other threads. Therefore,
it's possible that the action scheduler can pickup a ClusterEntity
with stale data, including stale configurations. Those stale configurations
can then be sent in commands down to agents.Constructor and Description |
---|
JPAEventPublisher() |
Modifier and Type | Method and Description |
---|---|
void |
publish(JPAEvent event)
Publishes the specified event to all registered listeners that
Subscribe to any of the
JPAEventPublisher instances. |
void |
register(Object object)
Register a listener to receive events.
|
public void publish(JPAEvent event)
Subscribe
to any of the
JPAEventPublisher
instances.event
- the eventpublic void register(Object object)
Subscribe
annotation.object
- the listener to receive events.Copyright © 2022 Apache Software Foundation. All rights reserved.