org.enhydra.barracuda.contrib.dbroggisch.page
Class PageEventDispatcher

java.lang.Object
  extended byorg.enhydra.barracuda.core.event.DefaultEventDispatcher
      extended byorg.enhydra.barracuda.contrib.dbroggisch.page.PageEventDispatcher
All Implemented Interfaces:
EventDispatcher

public class PageEventDispatcher
extends DefaultEventDispatcher

The PageEventDispatcher is used to suppress errors that can result from using the page model with session based pages. If a user makes two requests short after each other it can happen that concurrent modifications of the page stored in the session occur. Then for example a control event that expects a certain page to be stored in the session can get into trouble, usually resulting in classcastexceptions.

The PageEventDispatcher solves this by synchronizing the request around the session object.

Future enhacements might include the possibility to turn the behaviour on or off on a per-session basis.

Version:
1.0
Author:
Diez B. Roggisch

Field Summary
static boolean PAGE_SYNCHRONIZATION_ACTIVATED
          PAGE_SYNCHRONIZATION_ACTIVATED can be used to globally deactivate the synchronization.
 
Fields inherited from class org.enhydra.barracuda.core.event.DefaultEventDispatcher
DEFAULT_RESPONSE_EVENT, logger, MAX_DISPATCH_QUEUE_DEPTH, MAX_POLY_CHAIN_DEPTH
 
Constructor Summary
PageEventDispatcher()
           
 
Method Summary
 void dispatchEvent(EventBroker eb, EventContext context)
          Synchronizes around the session if PAGE_SYNCHRONIZATION_ACTIVATED is true.
 
Methods inherited from class org.enhydra.barracuda.core.event.DefaultEventDispatcher
dispatch, findListeners, getEventChain, notifyListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGE_SYNCHRONIZATION_ACTIVATED

public static boolean PAGE_SYNCHRONIZATION_ACTIVATED
PAGE_SYNCHRONIZATION_ACTIVATED can be used to globally deactivate the synchronization. Default value is true.

Constructor Detail

PageEventDispatcher

public PageEventDispatcher()
Method Detail

dispatchEvent

public void dispatchEvent(EventBroker eb,
                          EventContext context)
                   throws EventException
Synchronizes around the session if PAGE_SYNCHRONIZATION_ACTIVATED is true.

Specified by:
dispatchEvent in interface EventDispatcher
Overrides:
dispatchEvent in class DefaultEventDispatcher
Parameters:
eb - an EventBroker value
context - an EventContext value
Throws:
EventException - if an error occurs


Copyright © 2003 BarracudaMVC.org All Rights Reserved.