com.cc.framework.dialog
Class DialogContext

java.lang.Object
  extended bycom.cc.framework.dialog.DialogContext

public abstract class DialogContext
extends java.lang.Object

Base Class for all dialog context classes.

Since:
1.0
Version:
$Revision: 1.1 $
Author:
Harald Schulz

Field Summary
private  java.util.HashMap attributes
          The registered attributes.
private  java.lang.String lastAction
          The action to return to
 
Constructor Summary
DialogContext()
           
 
Method Summary
 void clearAttributes()
          Clears all known names/values.
protected static DialogContext get(javax.servlet.http.HttpServletRequest request, boolean create, java.lang.String name, java.lang.Class ctxClass)
          Returns a Dialog Context
protected static DialogContext get(javax.servlet.http.HttpSession session, boolean create, java.lang.String name, java.lang.Class ctxClass)
          Identifys the specified dialog context from the users session.
protected static DialogContext get(javax.servlet.http.HttpSession session, java.lang.String name, java.lang.Class ctxClass)
          Identifys or creates a new dialog context from the users session.
protected static DialogContext get(RequestContext ctx, boolean create, java.lang.String name, java.lang.Class ctxClass)
          Returns a Dialog Context
 java.lang.Object getAttribute(java.lang.String attributeName)
          Retrieve the value associated with the specified name.
 int getAttributeCount()
           
 java.util.Set getAttributeNames()
           
private static java.util.Hashtable getContextTable(javax.servlet.http.HttpSession session)
          Returns a collection with the active Dialog Contexts
 java.lang.String getLastAction()
          Gets the lastAction
static void remove(RequestContext ctx, java.lang.String name)
          Removes a Context from the memory
 java.lang.Object removeAttribute(java.lang.String attributeName)
          Remove the value associated with the specified name and return it.
 void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
          Associate a value with the specified name which will remain available until this workflow terminates or it is removed using the removeAttribute() method.
 void setLastAction(java.lang.String lastAction)
          Sets the lastAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastAction

private java.lang.String lastAction
The action to return to


attributes

private java.util.HashMap attributes
The registered attributes. HashMap chosen over Hashtable for its ability to store a null value.

Constructor Detail

DialogContext

public DialogContext()
Method Detail

getContextTable

private static java.util.Hashtable getContextTable(javax.servlet.http.HttpSession session)
Returns a collection with the active Dialog Contexts

Parameters:
session - HttpSession
Returns:
Hashtable

get

protected static DialogContext get(javax.servlet.http.HttpSession session,
                                   java.lang.String name,
                                   java.lang.Class ctxClass)
Identifys or creates a new dialog context from the users session.

Parameters:
session - HttpSession
name - Name
ctxClass - Context Class
Returns:
DialogContext

get

protected static DialogContext get(javax.servlet.http.HttpSession session,
                                   boolean create,
                                   java.lang.String name,
                                   java.lang.Class ctxClass)
Identifys the specified dialog context from the users session. If no context is specified a new context will be created.

Parameters:
session - HttpSession
create - Zeigt an, ob der Dialogkontext neu erzeugt werden soll
name - Name
ctxClass - Context Class
Returns:
DialogContext

get

protected static DialogContext get(RequestContext ctx,
                                   boolean create,
                                   java.lang.String name,
                                   java.lang.Class ctxClass)
Returns a Dialog Context

Parameters:
ctx - ActionContext
create - Zeigt an, ob der Dialogkontext neu erzeugt werden soll
name - Name
ctxClass - Context Class
Returns:
DialogContext

get

protected static DialogContext get(javax.servlet.http.HttpServletRequest request,
                                   boolean create,
                                   java.lang.String name,
                                   java.lang.Class ctxClass)
Returns a Dialog Context

Parameters:
request - HttpServletRequest
create - Zeigt an, ob der Dialogkontext neu erzeugt werden soll
name - Name
ctxClass - Context Class
Returns:
DialogContext

remove

public static void remove(RequestContext ctx,
                          java.lang.String name)
Removes a Context from the memory

Parameters:
ctx - ActionContext
name - Name

getAttributeNames

public java.util.Set getAttributeNames()
Returns:
The names of all known attributes for this workflow. May be null if there are no known attributes.

getAttributeCount

public int getAttributeCount()
Returns:
The number of all known attributes for this workflow.

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
Retrieve the value associated with the specified name.

Parameters:
attributeName - The name associated with the value sought.
Returns:
The value associated with the specified name. May be null if the attribute with the specified name is unknown.

removeAttribute

public java.lang.Object removeAttribute(java.lang.String attributeName)
Remove the value associated with the specified name and return it.

Parameters:
attributeName - The name associated with the value sought.
Returns:
The value associated with the specified name that was removed. May be null if the attribute with the specified name is unknown.

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attributeValue)
                  throws java.lang.IllegalArgumentException
Associate a value with the specified name which will remain available until this workflow terminates or it is removed using the removeAttribute() method.

Parameters:
attributeName - The name associated with the value to be stored.
attributeValue - The value to be associated with the name and stored. If an attribute is already stored under the specified name for this workflow, it is replaced by this one.
Throws:
java.lang.IllegalArgumentException - If the attribute name is null.

clearAttributes

public void clearAttributes()
Clears all known names/values.


getLastAction

public java.lang.String getLastAction()
Gets the lastAction

Returns:
Returns a String

setLastAction

public void setLastAction(java.lang.String lastAction)
Sets the lastAction

Parameters:
lastAction - The lastAction to set


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.