|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DynamicContextSource
Instances of this kind of ContextSource can support reloading their context
class. Engines that support context reload will
discover that the context class has changed by calling getContextType. This
call will likely be initiated by a template reload request, since all
templates may need to be recompiled if the context class has changed.
Because Tea engines may execute many templates concurrently, the two argument createContext method is called to inform the context source what specific context class is tied to the application request. The returned context instance must be of the requested type. DynamicContextSources must support instantiating the old context class(es) as well as the new context class.
The context source may release old context classes to free resources only when it is safe to do so. One way of achieving this is by using weak references.
| Method Summary | |
|---|---|
Object |
createContext(Class<?> contextClass,
Object param)
Creates a context instance that must be of the requested type. |
| Methods inherited from interface org.teatrove.tea.engine.ContextSource |
|---|
createContext, getContextType |
| Method Detail |
|---|
Object createContext(Class<?> contextClass,
Object param)
throws Exception
contextClass - Expected type of returned context instanceparam - engine specific parameter that
may be used to create the context instance
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||