E- The life-cycle event class to post this hook.
public interface LifecycleHook<E extends LifecycleEvent>
getLifecycleEventClass(), this hook is posted via the
Life-cycle hooks are defined in the experiment schema at the meta, state or test level. Those hooks, defined
at the meta level are schema-scoped and are applicable to all states and tests in the schema.
Hooks defined at the state level are state-scoped and are only applicable to the state where
they are defined. Finally, hooks defined at the test level are test-scoped and are only applicable
to the test where they are defined. It is an error to define a state-scoped hook which listens to a non-
StateAwareLifecycleEvent. Likewise, is an error to define a test-scoped hook which listens to a non-
VariationAwareLifecycleEvent. Whenever a life-cycle event of type T is raised, Variant server posts
all hooks whose
getLifecycleEventClass() returns either T or its subclass.
If multiple hooks are to be posted by same life-cycle event, they form a hook chain, and Variant server will
post them in the order they were defined in the schema. Hooks are posted one after another, until the
post(LifecycleEvent) method returns a non-null value. If no user defined hook returned a non-null value,
the default hook is posted.
An implementation must provide at least one public constructor:
Variant creates a new instance of the implementing class for each raised event.
|Modifier and Type||Interface and Description|
The result of the
|Modifier and Type||Method and Description|
Implementation must tell the server what life cycle event type(s) it wants to be posted on.
The callback method, called by the server when a life cycle event of type assignable to that returned by
Classobject associated with the life cycle event type(s) of interest.
LifecycleHook.PostResult post(E event) throws java.lang.Exception
getLifecycleEventClass()is reached. This method may either return a usable result (in the form of a
LifecycleHook.PostResultobject, or pass the event down the hook chain, i.e. let another hook process the event.
event- The posting life cycle event. May be further examined for details, e.g. the foreground session for the runtime event types.
LifecycleHook.PostResultor null. An "empty"
LifecycleHook.PostResultobject is obtained by calling the appropriate factory method in
Variant Experience Server release 0.9.3. Updated 06 Dec 2018.
Copyright © 2018 Variant Inc.