gnu.beanfactory
Class ScopeManager

java.lang.Object
  |
  +--gnu.beanfactory.ScopeManager

public class ScopeManager
extends java.lang.Object

Singleton class used to attach namespace/scopes to the current thread.

Version:
$Id: ScopeManager.java,v 1.26 2002/03/20 06:47:14 rschoening Exp $
Author:
Rob Schoening <rob@beanfactory.net>

Field Summary
static java.lang.String REQUEST_CONTEXT_KEY
           
static java.lang.String RESPONSE_CONTEXT_KEY
           
static java.lang.String SERVLET_CONTEXT_KEY
           
static java.lang.String SESSION_CONTEXT_KEY
           
static java.lang.String UNBOUND_MESSAGE_TEXT
           
 
Constructor Summary
ScopeManager()
           
 
Method Summary
static void bind()
          Binds the current thread to its thread scope.
static void bind(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.ServletContext ctx)
           
static void bind(javax.servlet.ServletContext ctx)
           
static ScopeDictionary getScopeDictionary(BeanDefinition def)
           
static ScopeDictionary getScopeDictionary(CurrentContext currentContext, BeanDefinition def)
          Gets the proper scope for a set of BeanAttributes.
static int lookupScope(java.lang.String scope)
          Insert the method's description here.
static void unbind()
          Removes the scope bindings from the calling thead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNBOUND_MESSAGE_TEXT

public static java.lang.String UNBOUND_MESSAGE_TEXT

SERVLET_CONTEXT_KEY

public static java.lang.String SERVLET_CONTEXT_KEY

SESSION_CONTEXT_KEY

public static java.lang.String SESSION_CONTEXT_KEY

REQUEST_CONTEXT_KEY

public static java.lang.String REQUEST_CONTEXT_KEY

RESPONSE_CONTEXT_KEY

public static java.lang.String RESPONSE_CONTEXT_KEY
Constructor Detail

ScopeManager

public ScopeManager()
Method Detail

bind

public static void bind()
Binds the current thread to its thread scope. Repeated calls to bind() will erase prior contents of the thread-scope namespace, thus it is safe to use with pooled threads.

bind

public static void bind(javax.servlet.ServletContext ctx)

bind

public static void bind(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        javax.servlet.http.HttpSession session,
                        javax.servlet.ServletContext ctx)

unbind

public static void unbind()
Removes the scope bindings from the calling thead. The global scope is not thead-specific, so it may be accessed even after unbind() has been called.

getScopeDictionary

public static ScopeDictionary getScopeDictionary(BeanDefinition def)
                                          throws IllegalBeanDefinitionException

getScopeDictionary

public static ScopeDictionary getScopeDictionary(CurrentContext currentContext,
                                                 BeanDefinition def)
                                          throws IllegalBeanDefinitionException
Gets the proper scope for a set of BeanAttributes.

lookupScope

public static int lookupScope(java.lang.String scope)
                       throws IllegalBeanDefinitionException
Insert the method's description here.
Parameters:
scope - java.lang.String
Returns:
int