magoffin.matt.ma2.support
Class BasicBizContext

java.lang.Object
  extended by magoffin.matt.ma2.support.BasicBizContext
All Implemented Interfaces:
BizContext
Direct Known Subclasses:
InternalBizContext, WebBizContext

public class BasicBizContext
extends java.lang.Object
implements BizContext

Basic implementation of BizContext interface.

Note this implementation is not thread safe.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Nested Class Summary
 
Nested classes/interfaces inherited from interface magoffin.matt.ma2.biz.BizContext
BizContext.Feature
 
Constructor Summary
BasicBizContext()
          Default constructor.
BasicBizContext(magoffin.matt.xweb.util.AppContextSupport appContextSupport)
          Constructor.
 
Method Summary
 User getActingUser()
          Get the acting user.
 magoffin.matt.xweb.util.AppContextSupport getAppContextSupport()
          Get the application context.
 java.lang.Object getAttribute(java.lang.String key)
          Get an attribute value.
 java.util.Locale getLocale()
          Get the Locale to use for messages, etc.
 boolean isFeatureEnabled(BizContext.Feature feature)
          Test if a feature is enabled.
 void setActingUser(User user)
          Set the acting user.
protected  void setAppContextSupport(magoffin.matt.xweb.util.AppContextSupport appContextSupport)
          Set the AppContextSupport.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Set an attribute value.
protected  void setLocale(java.util.Locale locale)
          Set the locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBizContext

public BasicBizContext(magoffin.matt.xweb.util.AppContextSupport appContextSupport)
Constructor.

Parameters:
appContextSupport - the application context

BasicBizContext

public BasicBizContext()
Default constructor.

Method Detail

setActingUser

public void setActingUser(User user)
Set the acting user.

Parameters:
user -

getActingUser

public User getActingUser()
Description copied from interface: BizContext
Get the acting user.

Specified by:
getActingUser in interface BizContext
Returns:
the acting user

getAppContextSupport

public magoffin.matt.xweb.util.AppContextSupport getAppContextSupport()
Description copied from interface: BizContext
Get the application context.

Specified by:
getAppContextSupport in interface BizContext
Returns:
AppContextSupport

getLocale

public java.util.Locale getLocale()
Description copied from interface: BizContext
Get the Locale to use for messages, etc.

Specified by:
getLocale in interface BizContext
Returns:
locale

isFeatureEnabled

public boolean isFeatureEnabled(BizContext.Feature feature)
Description copied from interface: BizContext
Test if a feature is enabled.

Specified by:
isFeatureEnabled in interface BizContext
Parameters:
feature - the feature to test
Returns:
boolean

setLocale

protected void setLocale(java.util.Locale locale)
Set the locale.

Parameters:
locale - the locale to set

setAppContextSupport

protected void setAppContextSupport(magoffin.matt.xweb.util.AppContextSupport appContextSupport)
Set the AppContextSupport.

Parameters:
appContextSupport -

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Description copied from interface: BizContext
Get an attribute value.

Specified by:
getAttribute in interface BizContext
Parameters:
key - the attribute key
Returns:
the attribute value, or null

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Description copied from interface: BizContext
Set an attribute value.

Specified by:
setAttribute in interface BizContext
Parameters:
key - the attribute key
value - the attribute value