public abstract class LifecycleEventImpl<T> extends Object implements LifecycleEvent<T>
Constructor and Description |
---|
LifecycleEventImpl() |
Modifier and Type | Method and Description |
---|---|
void |
fireAsync(T instance)
Fire this event, notifying any listeners for this event type by calling the respective
LifecycleListener.observeEvent(LifecycleEvent) methods. |
void |
fireAsync(T instance,
LifecycleCallback callback)
Fire this event, notifying any listeners for this event type by calling the respective
LifecycleListener.observeEvent(LifecycleEvent) methods. |
abstract Class<?> |
getEventType()
This must return the interface of the event it represents (i.e.
|
T |
getInstance()
This method should only be called from within
LifecycleListener.observeEvent(LifecycleEvent) . |
void |
veto()
Veto this event.
|
public void fireAsync(T instance)
LifecycleEvent
LifecycleListener.observeEvent(LifecycleEvent)
methods.fireAsync
in interface LifecycleEvent<T>
instance
- The bean instance associated with this event.public void fireAsync(T instance, LifecycleCallback callback)
LifecycleEvent
LifecycleListener.observeEvent(LifecycleEvent)
methods.fireAsync
in interface LifecycleEvent<T>
instance
- The bean instance associated with this event.callback
- A callback for receiving the result of a fired event (whether or not any listeners
vetoed.public void veto()
LifecycleEvent
LifecycleListener
during the
LifecycleListener.observeEvent(LifecycleEvent)
then:
LifecycleCallback.callback(boolean)
will be invoked with the
parameter value false
.veto
in interface LifecycleEvent<T>
public abstract Class<?> getEventType()
Access
rather than AccessImpl
).public T getInstance()
LifecycleEvent
LifecycleListener.observeEvent(LifecycleEvent)
. The instance is set immediately before
calling listeners and unset immediately after.getInstance
in interface LifecycleEvent<T>
null
if this event is not
actively being fired.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.