Invocation Stack

For each method, Qi4J will create and re-use an Invocation Stack. It will be built with the sequence of Modifiers and an end-point that will link into the stateful Mixin.

It is important to recognize that, for memory footprint reasons, Invocation Stacks are shared across Composites of the same Composite Type. They are however thread-safe, in that Qi4j will never bind the same Invocation Stack to more than one Composite instance during a method call, but that between method invocations the Modifiers in the Invocation Stack can not assume that it is bound to the same Composite instance. Therefor, Modifiers are not expected to keep state between method invocations, and when it needs to do that, then it should reference a Mixin via the @This annotation. Qi4j will during the binding of the Invocation Stack to the Composite, also ensure that all referenced Mixins are correctly injected in the Invocation Stack.


Qi4j and the Qi4j logo are trademarks of Richard Öberg, Niclas Hedhman and the members of the Qi4j Core Team. See Qi4j licensing for more information.
Powered by SiteVisionexternal link.