Package org.eclnt.jsfserver.util
Class ThreadingSynchronization
java.lang.Object
org.eclnt.jsfserver.util.ThreadingSynchronization
This class provides synchonization objects which are applied when UI requests
are processed and access data that is bound to the dialog processing. Per
dialog session a corresponding object is managed.
Example: the central
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, IExternalRequestProcessing externalChainProcessing)
{
...
Object synchObject = ThreadingSynchronization.getSynchObject(...);
synchronized(synchObject)
{
...
...all internal processing of the CC-processing...
...
}
...
}
In case of creating a separate thread and in case of accessing/updating UI-objects from this thread you must ensure to synchronize with the CaptainCasa synchronization! This means, you have to also arrange your functions in a corresponding synchronized-block.
Example: the central
ThreadingFilter
performas in the following
way:public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, IExternalRequestProcessing externalChainProcessing)
{
...
Object synchObject = ThreadingSynchronization.getSynchObject(...);
synchronized(synchObject)
{
...
...all internal processing of the CC-processing...
...
}
...
}
In case of creating a separate thread and in case of accessing/updating UI-objects from this thread you must ensure to synchronize with the CaptainCasa synchronization! This means, you have to also arrange your functions in a corresponding synchronized-block.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetSynchObject
(ISessionAbstraction dialogSession) static ThreadingSynchronization
instance()
void
unregisterDialogSession
(String subPageId) This function is automatically called when a dialog session is closed on server side.
-
Constructor Details
-
ThreadingSynchronization
public ThreadingSynchronization()
-
-
Method Details
-
instance
-
getSynchObject
- Parameters:
dialogSession
- Within the request processing you may useHttpSessionAccess.getCurrentDialogSession()
for getting the current dialog session.- Returns:
- Synchronization object for the corresponding session. If no dialog session is passed then a new Object is passed back.
-
unregisterDialogSession
This function is automatically called when a dialog session is closed on server side.
-