Package ortus.boxlang.runtime.events
Class InterceptorState
java.lang.Object
ortus.boxlang.runtime.events.InterceptorState
An interceptor state is an event state that is used to hold observers that want to listent
to that specific state. For example, the "preProcess" state is used to hold observers that
listen to "preProcess" events.
The is in charge of managing all states and event registrations in BoxLang.
-
Constructor Summary
ConstructorsConstructorDescriptionInterceptorState(String name) ConstructorInterceptorState(Key name) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidannounce(IStruct data, IBoxContext context) Process the state by announcing it to all observersexists(DynamicObject observer) Check if an observer is registered for this stategetName()Get the state nameregister(DynamicObject observer) Register an observer for this stateintsize()Get the number of observers registered for this stateunregister(DynamicObject observer) Unregister an observer for this state
-
Constructor Details
-
InterceptorState
Constructor- Parameters:
name- The state name
-
InterceptorState
Constructor- Parameters:
name- The state name
-
-
Method Details
-
getName
Get the state name- Returns:
- The state name
-
register
Register an observer for this state- Parameters:
observer- The observer- Returns:
- The same state
-
unregister
Unregister an observer for this state- Parameters:
observer- The observer- Returns:
- The same state
-
exists
Check if an observer is registered for this state- Parameters:
observer- The observer to check- Returns:
- True if the observer is registered, false otherwise
-
size
public int size()Get the number of observers registered for this state- Returns:
- The number of observers registered for this state
-
announce
Process the state by announcing it to all observers- Parameters:
data- The struct of data to pass to the observerscontext- The box context to execute on
-