org.apache.webbeans.spi
Interface ContextsService


public interface ContextsService

Contexts services provides demarcation methods for each context that is defined in the specification. SPI providers implement related method that it supports.

For example, web container supports request, session conversation, application, singleton and dependent contexts.

Version:
$Rev$ $Date$

Method Summary
 void activateContext(Class<? extends Annotation> scopeType)
          Activate the context with the given scope type.
 void deActivateContext(Class<? extends Annotation> scopeType)
          Deactivates the context with the given scope type.
 void destroy(Object destroyObject)
          Destroys container contexts service.
 void endContext(Class<? extends Annotation> scopeType, Object endParameters)
          Ends the context with the given scope type.
 javax.enterprise.context.spi.Context getCurrentContext(Class<? extends Annotation> scopeType)
          Gets current context with given scope type with respect to the current thread of execution.
 void init(Object initializeObject)
          Initialize container contexts service.
 void startContext(Class<? extends Annotation> scopeType, Object startParameter)
          Starts the context with the given scope type.
 boolean supportsContext(Class<? extends Annotation> scopeType)
          If container supports the given scope type it returns true, otherwise it return false.
 

Method Detail

init

void init(Object initializeObject)
Initialize container contexts service.

Parameters:
initializeObject - any initialize object

destroy

void destroy(Object destroyObject)
Destroys container contexts service.

Parameters:
destroyObject - any destroy parameter

getCurrentContext

javax.enterprise.context.spi.Context getCurrentContext(Class<? extends Annotation> scopeType)
Gets current context with given scope type with respect to the current thread of execution.

If there is not current context, it returns null.

Parameters:
scopeType - context scope type
Returns:
current context with given scope type

supportsContext

boolean supportsContext(Class<? extends Annotation> scopeType)
If container supports the given scope type it returns true, otherwise it return false.

Parameters:
scopeType - scope type
Returns:
true if container supports given scope type false otherwise

startContext

void startContext(Class<? extends Annotation> scopeType,
                  Object startParameter)
                  throws javax.enterprise.context.ContextException
Starts the context with the given scope type. If given scope type is not supported, there is no action.

Parameters:
scopeType - scope type
startParameter - any parameter
Throws:
javax.enterprise.context.ContextException - if any exception thrown by starting context, it is wrapped inside ContextException and thrown.

endContext

void endContext(Class<? extends Annotation> scopeType,
                Object endParameters)
Ends the context with the given scope type. If given scope type is not supported, there is no action. Any exception thrown by the operation is catched and logged by the container.

Parameters:
scopeType - scope type
endParameters - any end parameter

activateContext

void activateContext(Class<? extends Annotation> scopeType)
Activate the context with the given scope type. If given scope type is not supported, there is no action. Any exception thrown by the operation is catched and logged by the container.

Parameters:
scopeType - scope type

deActivateContext

void deActivateContext(Class<? extends Annotation> scopeType)
Deactivates the context with the given scope type. If given scope type is not supported, there is no action. Any exception thrown by the operation is catched and logged by the container.

Parameters:
scopeType - scope type


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