org.apache.shale.dialog.base
Class AbstractDialogContextManager

java.lang.Object
  extended by org.apache.shale.dialog.base.AbstractDialogContextManager
All Implemented Interfaces:
EventListener, HttpSessionBindingListener, DialogContextManager

public abstract class AbstractDialogContextManager
extends Object
implements DialogContextManager, HttpSessionBindingListener

Abstract base class for DialogContextManager implementations. Provides listener registration and event firing convenience methods. Subclasses are expected to be serializable.

Since:
1.0.4

Constructor Summary
AbstractDialogContextManager()
           
 
Method Summary
 void addDialogContextManagerListener(DialogContextManagerListener listener)
          Register a new DialogContextManagerListener instance.
protected  void fireOnCreate(DialogContext context)
          Fire an onCreate() event to all registered listeners.
protected  void fireOnRemove(DialogContext context)
          Fire an onRemove() event to all registered listeners.
 DialogContext getActiveDialogContext(javax.faces.context.FacesContext context)
          Return the currently active DialogContext instance for the current request, if there is one; otherwise, return null.
 DialogContextManagerListener[] getDialogContextManagerListeners()
          Return the set of currently registered DialogContextManagerListeners.
 void removeDialogContextManagerListener(DialogContextManagerListener listener)
          Deregister an existing DialogContextManagerListener instance.
 void valueBound(HttpSessionBindingEvent event)
          Handle an instance of this class being bound into an HttpSession.
 void valueUnbound(HttpSessionBindingEvent event)
          Handle an instance of this class being unbound from an HttpSession.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.shale.dialog.DialogContextManager
create, create, get, remove
 

Constructor Detail

AbstractDialogContextManager

public AbstractDialogContextManager()
Method Detail

valueBound

public void valueBound(HttpSessionBindingEvent event)

Handle an instance of this class being bound into an HttpSession.

Specified by:
valueBound in interface HttpSessionBindingListener
Parameters:
event - HttpSessionBindingEvent to be handled

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)

Handle an instance of this class being unbound from an HttpSession.

Specified by:
valueUnbound in interface HttpSessionBindingListener
Parameters:
event - HttpSessionBindingEvent to be handled

getActiveDialogContext

public DialogContext getActiveDialogContext(javax.faces.context.FacesContext context)

Return the currently active DialogContext instance for the current request, if there is one; otherwise, return null.

Specified by:
getActiveDialogContext in interface DialogContextManager
Parameters:
context - FacesContext for the current request
Since:
1.1.0

addDialogContextManagerListener

public void addDialogContextManagerListener(DialogContextManagerListener listener)

Register a new DialogContextManagerListener instance.

Specified by:
addDialogContextManagerListener in interface DialogContextManager
Parameters:
listener - The new listener instance to be registered

getDialogContextManagerListeners

public DialogContextManagerListener[] getDialogContextManagerListeners()

Return the set of currently registered DialogContextManagerListeners. If there are no registered listeners, a zero-length array is returned.

Specified by:
getDialogContextManagerListeners in interface DialogContextManager

removeDialogContextManagerListener

public void removeDialogContextManagerListener(DialogContextManagerListener listener)

Deregister an existing DialogContextManagerListener instance.

Specified by:
removeDialogContextManagerListener in interface DialogContextManager
Parameters:
listener - The existing listener to be deregistered

fireOnCreate

protected void fireOnCreate(DialogContext context)

Fire an onCreate() event to all registered listeners.

Parameters:
context - The DialogContext instance that has been created

fireOnRemove

protected void fireOnRemove(DialogContext context)

Fire an onRemove() event to all registered listeners.

Parameters:
context - The DialogContext instance that has been removed


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.