|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value=METHOD) @Retention(value=RUNTIME) public @interface DynaContext
This annotation associates a method with a context. The context is identified by the id. The id is a class or interface.
If impl value is provided the context id is considered as an identifier only and the class value of
impl is used for the context instantiation. Otherwise the id class is used. The instantiation can be
controlled by the attr property. There can happen the following scenarios:
Before the method execution the context is always created and pushed on the top of the stack associated with the current thread. Note: for each context id there is one stack associated with the current thread.
Before the method execution it is checked whether there is the appropriate context on the stack. If it is so the context from the top of the stack is used. Otherwise a new context is created and pushed on the top of the stack.
Before the method execution it is checked whether there is the appropriate context on the stack. If it is so the context is used otherwise the exception is thrown.
Before the method execution the context the this intance is pushed on the stack. It leads to a limitation
that only non-static methods can be annotated by the DynaContext annotation with This context attribute
as there is no "this" available in in static methods.
| Optional Element Summary | |
|---|---|
ContextAttributes |
attr
|
Class |
id
|
Class |
impl
|
String |
init
|
public abstract Class id
public abstract Class impl
public abstract ContextAttributes attr
public abstract String init
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||