public abstract class DefaultDispatcher extends java.util.HashMap<java.lang.String,java.lang.Object> implements java.io.Serializable, IDispatcher
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultDispatcher.DispatchedBeanInfo
Interface from tools (layout editor - bean browser) into the
application.
|
static class |
DefaultDispatcher.DispatcherInfo
Interface from tools (layout editor - bean browser) into the
application.
|
| Constructor and Description |
|---|
DefaultDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDispatcherExtension(IDispatcherExtension dispatcherExtension) |
boolean |
checkIfDispatchedBeanIsLoaded(java.lang.Class dispatchedBeanClass) |
boolean |
checkIfDispatchedBeanIsLoaded(java.lang.String dispatchedBeanName) |
ModalPopup |
createModalPopup()
Create a modal popup instance within the context of this dispatcher.
|
ModelessPopup |
createModelessPopup()
Create a modeless popup instance within the context of this dispatcher.
|
protected java.lang.Object |
createObjectInstance(java.lang.Class resultClass)
After resolving the class for a given name, an object needs to be created
for the class.
|
int |
createSubDispatcherIndex() |
IDispatcher |
createSubDispatcherInstance()
Creates a sub dispatcher instance: the class of the instance
is the current class of this instance.
|
IDispatcher |
createSubDispatcherInstance(java.lang.Class subDispatcherClass)
Creates a sub dispatcher instance of the class that is passed
as argument.
|
void |
destroy()
Destroys the dispatcher and its contained objects.
|
java.lang.Object |
get(java.lang.Object key) |
java.util.List<IDispatcher> |
getChildDispatchers()
A dispatcher may be hierarchized.
|
java.lang.String |
getContentReplace()
Returns the content replace statement that is passed to included
pages.
|
static IDispatcher |
getDialogSessionInstance()
Returns the root dispatcher instance within the current dialog session.
|
java.lang.Object |
getDispatchedBean(java.lang.Class dispatchedBeanClass)
Find managed bean for class.
|
java.lang.Object |
getDispatchedBean(java.lang.String dispatchedBeanName)
Find managed bean for name.
|
java.lang.String |
getExpressionBase()
Each dispatcher is the entry point to its managed beans.
|
java.lang.String |
getMyExpression(java.lang.Class cl)
Returns the expression for the object that is managed inside the
dispatcher.
|
java.lang.String |
getMyExpression(java.lang.Object o)
Returns the expression for the object that is managed inside the
dispatcher.
|
IDispatcher |
getOwner()
Passes back the dispatcher above.
|
protected java.lang.Class |
getPreferredConstructorArguentClass()
Preferred constructor argument for creation of managed beans.
|
protected java.lang.String |
getRootExpression()
Override if NOT using "#{d}" as root dispatcher..
|
static DefaultDispatcher.DispatcherInfo |
getStaticDispatcherInfo() |
IDispatcher |
getTopOwner()
Passes back the top owner of the dispatcher hierarchy.
|
protected void |
initDispatcher() |
protected java.util.List<DefaultDispatcher.DispatchedBeanInfo> |
initRegisteredBeanInfos(java.util.List<DefaultDispatcher.DispatchedBeanInfo> infos)
This method is called one time during first initialization of the dispatcher.
|
protected java.util.List<java.lang.String> |
initRegisteredPackages(java.util.List<java.lang.String> packageNames)
This method is called one time during first initialization of the dispatcher.
|
protected void |
outputLogInfoWhenNoClassWasResolved(java.lang.String key)
The default method
readObject(String) tries to resolve a class for a key
that is passed. |
protected void |
prepareObject(java.lang.Object object)
After the creation of the object (default:
readObject(String) this
method is called. |
protected java.lang.Object |
readObject(java.lang.String key)
This is the method that is called internally in order to read a
dispatched object - which is not in the hashtable of dispatched
objects yet.
|
protected void |
registerSubDispatcherInstance(IDispatcher subDispatcher) |
void |
removeDispatchedBean(java.lang.Class dispatchedBeanClass)
Removes dispatched bean from dispatcher.
|
void |
removeDispatchedBean(java.lang.String dispatchedBeanName)
Removes dispatched bean from dispatcher.
|
static void |
removeDispatcherExtension(IDispatcherExtension dispatcherExtension) |
java.lang.Class |
resolveClass(java.lang.String key)
Resolves the class for a binding key.
|
void |
setOwner(IDispatcher owner) |
java.lang.String |
toString() |
void |
unregisterSubDispatcherInstance(IDispatcher subDispatcher) |
java.lang.String |
updateExpression(java.lang.String expression)
Within the bean processing you may create components in a dynamic
way, e.g. using the feature "componentbinding".
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic static IDispatcher getDialogSessionInstance()
protected java.lang.String getRootExpression()
public static void addDispatcherExtension(IDispatcherExtension dispatcherExtension)
public static void removeDispatcherExtension(IDispatcherExtension dispatcherExtension)
public static DefaultDispatcher.DispatcherInfo getStaticDispatcherInfo()
public int createSubDispatcherIndex()
createSubDispatcherIndex in interface IDispatcherpublic void setOwner(IDispatcher owner)
setOwner in interface IDispatcherpublic java.lang.Object getDispatchedBean(java.lang.String dispatchedBeanName)
IDispatchergetDispatchedBean in interface IDispatcherdispatchedBeanName - Name of the beans - this is the name that is used for binding
the bean within the user interface, as well. E.g. if the
bean's binding is "#{d.AbcdeUI. ...} then you may access
the bean by passing "AbcdeUI".public void removeDispatchedBean(java.lang.String dispatchedBeanName)
IDispatcherremoveDispatchedBean in interface IDispatcherpublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Map<java.lang.String,java.lang.Object>get in class java.util.HashMap<java.lang.String,java.lang.Object>protected java.lang.Object readObject(java.lang.String key)
throws java.lang.Exception
resolveClass(String). Then a "best fitting" constructor is
searched and an object is created.java.lang.Exceptionprotected java.lang.Object createObjectInstance(java.lang.Class resultClass)
throws java.lang.Exception
IDispatcher or the IWorkpageDispatcher instance) is checked.
If this does not exsit, then a constructor without parameters is called.java.lang.Exceptionprotected void prepareObject(java.lang.Object object)
readObject(String) this
method is called. Here you can add own preparation logic.protected void outputLogInfoWhenNoClassWasResolved(java.lang.String key)
readObject(String) tries to resolve a class for a key
that is passed. If does not find one it throws an error and outputs corresponding
log information. The output of log information is done in this method.
You may override this method in case you override the readObject-method - sometimes
you want to implement your readObject-method in a way that you first want to test
if the default object resolution is successful, and only in case of an error perform
your own resolution. In this case you do not want the default mechanism to produce
huge error log messages.public java.lang.Class resolveClass(java.lang.String key)
public boolean checkIfDispatchedBeanIsLoaded(java.lang.Class dispatchedBeanClass)
checkIfDispatchedBeanIsLoaded in interface IDispatcherpublic boolean checkIfDispatchedBeanIsLoaded(java.lang.String dispatchedBeanName)
checkIfDispatchedBeanIsLoaded in interface IDispatcherpublic java.lang.Object getDispatchedBean(java.lang.Class dispatchedBeanClass)
IDispatchergetDispatchedBean in interface IDispatcherpublic void removeDispatchedBean(java.lang.Class dispatchedBeanClass)
IDispatcherremoveDispatchedBean in interface IDispatcherpublic IDispatcher createSubDispatcherInstance()
createSubDispatcherInstance in interface IDispatcherpublic IDispatcher createSubDispatcherInstance(java.lang.Class subDispatcherClass)
protected void registerSubDispatcherInstance(IDispatcher subDispatcher)
public java.lang.String getExpressionBase()
IDispatchergetExpressionBase in interface IDispatcherpublic void destroy()
IDispatcherdestroy in interface IDispatcherpublic void unregisterSubDispatcherInstance(IDispatcher subDispatcher)
unregisterSubDispatcherInstance in interface IDispatcherpublic java.lang.String updateExpression(java.lang.String expression)
IDispatcherupdateExpression in interface IDispatcherexpression - The normal expression, e.g. "#{d.Car}".public java.lang.String getContentReplace()
IDispatchergetContentReplace in interface IDispatcherpublic IDispatcher getOwner()
IDispatchergetOwner in interface IDispatcherpublic IDispatcher getTopOwner()
IDispatchergetTopOwner in interface IDispatcherpublic java.lang.String getMyExpression(java.lang.Object o)
IDispatchergetMyExpression in interface IDispatcherpublic java.lang.String getMyExpression(java.lang.Class cl)
IDispatchergetMyExpression in interface IDispatcherpublic ModalPopup createModalPopup()
createModalPopup in interface IDispatcherpublic ModelessPopup createModelessPopup()
createModelessPopup in interface IDispatcherpublic java.lang.String toString()
toString in class java.util.AbstractMap<java.lang.String,java.lang.Object>public java.util.List<IDispatcher> getChildDispatchers()
getChildDispatchers in interface IDispatcherprotected void initDispatcher()
protected java.util.List<java.lang.String> initRegisteredPackages(java.util.List<java.lang.String> packageNames)
packageNames - List of used packages.protected java.util.List<DefaultDispatcher.DispatchedBeanInfo> initRegisteredBeanInfos(java.util.List<DefaultDispatcher.DispatchedBeanInfo> infos)
infos - List of dispatched bean infos.protected java.lang.Class getPreferredConstructorArguentClass()
Copyright © CaptainCasa Gmbh. All Rights Reserved.