org.jboss.weld.context.beanstore.http
Class RequestBeanStore

java.lang.Object
  extended by org.jboss.weld.context.beanstore.AttributeBeanStore
      extended by org.jboss.weld.context.beanstore.http.RequestBeanStore
All Implemented Interfaces:
Iterable<String>, BeanStore, BoundBeanStore

public class RequestBeanStore
extends AttributeBeanStore

A BeanStore that uses a HTTP request as backing storage.

This class is not threadsafe

Author:
Nicklas Karlsson, David Allen, Pete Muir

Constructor Summary
RequestBeanStore(javax.servlet.ServletRequest request, NamingScheme namingScheme)
           
 
Method Summary
 boolean attach()
           Attach the bean store, any updates from now on will be written through to the underlying store.
 boolean detach()
          Detach the bean store, causing updates to longer be written through to the underlying store.
protected  Object getAttribute(String key)
          Gets an attribute from the underlying storage
protected  Collection<String> getAttributeNames()
          Gets an enumeration of the attribute names present in the underlying storage
 LockStore getLockStore()
           
 boolean isAttached()
          Return true if the bean store is attached
protected  void removeAttribute(String key)
          Removes an attribute from the underlying storage
protected  void setAttribute(String key, Object instance)
          Sets an instance under a key in the underlying storage
 
Methods inherited from class org.jboss.weld.context.beanstore.AttributeBeanStore
clear, contains, get, getNamingScheme, getPrefixedAttributeNames, iterator, lock, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestBeanStore

public RequestBeanStore(javax.servlet.ServletRequest request,
                        NamingScheme namingScheme)
Method Detail

getAttribute

protected Object getAttribute(String key)
Description copied from class: AttributeBeanStore
Gets an attribute from the underlying storage

Specified by:
getAttribute in class AttributeBeanStore
Parameters:
key - The (prefixed) id of the attribute
Returns:
The data

removeAttribute

protected void removeAttribute(String key)
Description copied from class: AttributeBeanStore
Removes an attribute from the underlying storage

Specified by:
removeAttribute in class AttributeBeanStore
Parameters:
key - The (prefixed) id of the attribute to remove

getAttributeNames

protected Collection<String> getAttributeNames()
Description copied from class: AttributeBeanStore
Gets an enumeration of the attribute names present in the underlying storage

Specified by:
getAttributeNames in class AttributeBeanStore
Returns:
The attribute names

setAttribute

protected void setAttribute(String key,
                            Object instance)
Description copied from class: AttributeBeanStore
Sets an instance under a key in the underlying storage

Specified by:
setAttribute in class AttributeBeanStore
Parameters:
key - The (prefixed) id of the attribute to set
instance - The instance

attach

public boolean attach()
Description copied from class: AttributeBeanStore

Attach the bean store, any updates from now on will be written through to the underlying store.

When the bean store is attached, the detached state is assumed to be authoritative if there are any conflicts.

Specified by:
attach in interface BoundBeanStore
Overrides:
attach in class AttributeBeanStore
Returns:
true if the bean store was attached, or false if the bean store is already attached

detach

public boolean detach()
Description copied from class: AttributeBeanStore
Detach the bean store, causing updates to longer be written through to the underlying store.

Specified by:
detach in interface BoundBeanStore
Overrides:
detach in class AttributeBeanStore
Returns:
true if the bean store was detached, or false if the bean store is already detached

isAttached

public boolean isAttached()
Description copied from interface: BoundBeanStore
Return true if the bean store is attached

Specified by:
isAttached in interface BoundBeanStore
Overrides:
isAttached in class AttributeBeanStore
Returns:
true if the bean store is attached or false if the bean store has been detached

getLockStore

public LockStore getLockStore()
Specified by:
getLockStore in class AttributeBeanStore


Copyright © 2013 Seam Framework. All Rights Reserved.