public final class Emitter extends Object
Broadcastable
) to registered listeners.Constructor and Description |
---|
Emitter() |
Modifier and Type | Method and Description |
---|---|
void |
emit(Broadcastable event,
Grammar grammar,
Broadcaster broadcaster,
ErrorManager em)
Sends an event to registered subscribers of the given event type (i.e., class), including any subscribers to types within
the event's class hierarchy.
|
SubscriptionPhase |
phase()
Gets the current
SubscriptionPhase . |
void |
phase(SubscriptionPhase phase)
Sets the current
SubscriptionPhase . |
void |
register(Object subscriber)
Registers an instance of an object to receive broadcasted events (usually a
Plugin instance). |
public void phase(SubscriptionPhase phase)
SubscriptionPhase
. This determines which registered subscribers receive broadcasts.phase
- The current phase.public SubscriptionPhase phase()
SubscriptionPhase
.SubscriptionPhase
.public void register(Object subscriber)
Plugin
instance).
The methods on the class of the object will be scanned for applicable annotations (e.g., Rework
, Validate
).
The methods will be invoked when the matching event is broadcasted in the applicable phase.
subscriber
- Register this object to receive events.public void emit(Broadcastable event, Grammar grammar, Broadcaster broadcaster, ErrorManager em)
"Event" here refers to an instance of a Broadcastable
.
event
- The event instance.grammar
- The Grammar
instance.broadcaster
- The Broadcaster
that refiners should use.em
- The ErrorManager
instance.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.