The Focus Chain is a mechanism to resolve application components that other components depend on.
In the case of web applications the focus chain resembles the thread stack as this is the most efficient way to supply variables to a scope.
Focus Resolution Operator
- Focus Resolution Operator (FRO) is a localized singleton
- FRO uses a URI to locate name of a type exposed through Spiralcraft.lang package in the focus chain
- By referring to the type you get the instance closest to the caller of that type
- Spiralcraft VFS processes these requests. When used as a FRO the URI represents a Type
- Syntactically, the Focus Resolution Operator (FRO) is a name inside [ ]
FRO TypeURIs can take one of the following 4 forms
- Implicit Form (using the default namespace)
- Integrated form
- [namespace:name]
- eg: [webui : DataSessionComponent]
- Absolute form
- Disambiguation Form
- [TypeURI#dismbiguator]
- If there are multiple instances of a component referred to by the same URI that are available in the Focus Chain, this form allows a reference to an instance other than the one closest to the caller.
- eg [mytree:TreeNode#parent]
Namespaces are supplied by the container that provides access to the lang package. For example the enclosing webui template (in the case of webui, namespaces are declared in the page in which the expression appears). For example :
<%@namespace
html="class:/spiralcraft/servlet/webui/components/html/"
webui="class:/spiralcraft/servlet/webui/components/"
mywebui="class:/my/package/name/webui/"
http="class:/javax/servlet/http/"
%>
...
<%/@namespace%>