org.apache.webbeans.context
Class ContextFactory

java.lang.Object
  extended by org.apache.webbeans.context.ContextFactory

public final class ContextFactory
extends Object

JSR-299 based standard context related operations.


Method Summary
static void activateContext(Class<? extends Annotation> scopeType)
          Activate context.
static void cleanUpContextFactory()
          This must be called before a WebApp shuts down.
static void deActivateContext(Class<? extends Annotation> scopeType)
          Deactivate context.
static void destroyApplicationContext(Object parameter)
          Destroys the application context and all of its components at the end of the application.
static void destroyConversationContext()
           
static void destroyRequestContext(Object request)
           
static void destroySessionContext(Object session)
           
static void destroySingletonContext(Object parameter)
           
static Context getCustomContext(Context context)
           
static Context getStandardContext(Class<? extends Annotation> scopeType)
          Gets the standard context with given scope type.
static Context getStandardContext(ContextsService contextService, ContextTypes type)
           
static Context getStandardContext(ContextTypes type)
          Gets the current context with given type.
static void initApplicationContext(Object parameter)
          Creates the application context at the application startup
static void initConversationContext(Object context)
           
static void initRequestContext(Object request)
           
static void initSessionContext(Object session)
           
static void initSingletonContext(Object parameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cleanUpContextFactory

public static void cleanUpContextFactory()
This must be called before a WebApp shuts down. It makes sure that all caches get cleaned up.


initRequestContext

public static void initRequestContext(Object request)

getCustomContext

public static Context getCustomContext(Context context)

destroyRequestContext

public static void destroyRequestContext(Object request)

initSessionContext

public static void initSessionContext(Object session)

destroySessionContext

public static void destroySessionContext(Object session)

initApplicationContext

public static void initApplicationContext(Object parameter)
Creates the application context at the application startup

Parameters:
parameter - parameter object

destroyApplicationContext

public static void destroyApplicationContext(Object parameter)
Destroys the application context and all of its components at the end of the application.

Parameters:
parameter - parameter object

initSingletonContext

public static void initSingletonContext(Object parameter)

destroySingletonContext

public static void destroySingletonContext(Object parameter)

initConversationContext

public static void initConversationContext(Object context)

destroyConversationContext

public static void destroyConversationContext()

getStandardContext

public static Context getStandardContext(ContextTypes type)
                                  throws ContextNotActiveException
Gets the current context with given type.

Returns:
the current context
Throws:
ContextNotActiveException - if context is not active
IllegalArgumentException - if the type is not a standard context

getStandardContext

public static Context getStandardContext(ContextsService contextService,
                                         ContextTypes type)
                                  throws ContextNotActiveException
Throws:
ContextNotActiveException

getStandardContext

public static Context getStandardContext(Class<? extends Annotation> scopeType)
Gets the standard context with given scope type.

Returns:
the current context, or null if no standard context exists for the given scopeType

activateContext

public static void activateContext(Class<? extends Annotation> scopeType)
Activate context.


deActivateContext

public static void deActivateContext(Class<? extends Annotation> scopeType)
Deactivate context.



Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.