org.apache.tuscany.sca.core.scope
Class HttpSessionScopeContainer

java.lang.Object
  extended by org.apache.tuscany.sca.core.scope.AbstractScopeContainer<java.lang.Object>
      extended by org.apache.tuscany.sca.core.scope.HttpSessionScopeContainer
All Implemented Interfaces:
java.util.EventListener, ScopeContainer<java.lang.Object>, RuntimeEventListener

public class HttpSessionScopeContainer
extends AbstractScopeContainer<java.lang.Object>

A scope context which manages atomic component instances keyed on HTTP session


Field Summary
 
Fields inherited from class org.apache.tuscany.sca.core.scope.AbstractScopeContainer
component, lifecycleState, scope, wrappers
 
Fields inherited from interface org.apache.tuscany.sca.core.scope.ScopeContainer
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
HttpSessionScopeContainer(RuntimeComponent component)
           
 
Method Summary
protected  InstanceWrapper getInstanceWrapper(boolean create)
           
 InstanceWrapper getWrapper(java.lang.Object contextId)
          Returns an instance wrapper associated with the current scope context, creating one if necessary
 void onEvent(Event event)
          Accepts and event and acts on it
 void start()
          Starts the Lifecycle.
 void stop()
          Stops the Lifecycle.
 
Methods inherited from class org.apache.tuscany.sca.core.scope.AbstractScopeContainer
addWrapperReference, checkInit, createInstanceWrapper, getAssociatedWrapper, getComponent, getLifecycleState, getScope, isEagerInit, registerWrapper, remove, returnWrapper, setComponent, setLifecycleState, startContext, stopContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpSessionScopeContainer

public HttpSessionScopeContainer(RuntimeComponent component)
Method Detail

onEvent

public void onEvent(Event event)
Description copied from interface: RuntimeEventListener
Accepts and event and acts on it

Specified by:
onEvent in interface RuntimeEventListener
Overrides:
onEvent in class AbstractScopeContainer<java.lang.Object>
Parameters:
event - The event to act on

start

public void start()
Description copied from interface: ScopeContainer
Starts the Lifecycle.

Specified by:
start in interface ScopeContainer<java.lang.Object>
Overrides:
start in class AbstractScopeContainer<java.lang.Object>

stop

public void stop()
Description copied from interface: ScopeContainer
Stops the Lifecycle.

Specified by:
stop in interface ScopeContainer<java.lang.Object>
Overrides:
stop in class AbstractScopeContainer<java.lang.Object>

getInstanceWrapper

protected InstanceWrapper getInstanceWrapper(boolean create)
                                      throws TargetResolutionException
Throws:
TargetResolutionException

getWrapper

public InstanceWrapper getWrapper(java.lang.Object contextId)
                           throws TargetResolutionException
Description copied from interface: ScopeContainer
Returns an instance wrapper associated with the current scope context, creating one if necessary

Specified by:
getWrapper in interface ScopeContainer<java.lang.Object>
Overrides:
getWrapper in class AbstractScopeContainer<java.lang.Object>
Parameters:
contextId - the id for the scope context
Returns:
the wrapper for the target instance
Throws:
TargetResolutionException - if there was a problem instantiating the target instance