Class ThreadingSynchronization

java.lang.Object
org.eclnt.jsfserver.util.ThreadingSynchronization

public class ThreadingSynchronization extends Object
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 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 Details

    • ThreadingSynchronization

      public ThreadingSynchronization()
  • Method Details

    • instance

      public static ThreadingSynchronization instance()
    • getSynchObject

      public Object getSynchObject(ISessionAbstraction dialogSession)
      Parameters:
      dialogSession - Within the request processing you may use HttpSessionAccess.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

      public void unregisterDialogSession(String subPageId)
      This function is automatically called when a dialog session is closed on server side.