org.jboss.webbeans.context.beanstore
Class AbstractAttributeBackedBeanStore

java.lang.Object
  extended by org.jboss.webbeans.context.beanstore.AbstractAttributeBackedBeanStore
All Implemented Interfaces:
BeanStore
Direct Known Subclasses:
ApplicationBeanStore, HttpRequestSessionBeanStore, HttpSessionBeanStore

public abstract class AbstractAttributeBackedBeanStore
extends java.lang.Object
implements BeanStore

Provides common BeanStore operations

Author:
Nicklas Karlsson

Constructor Summary
AbstractAttributeBackedBeanStore()
           
 
Method Summary
 void clear()
          Clears the bean store
<T> T
get(Contextual<? extends T> contextual)
          Gets a bean from the store
protected abstract  java.lang.Object getAttribute(java.lang.String key)
          Gets an attribute from the underlying storage
protected abstract  java.util.Enumeration<java.lang.String> getAttributeNames()
          Gets an enumeration of the attribute names present in the underlying storage
 java.lang.Iterable<Contextual<? extends java.lang.Object>> getBeans()
          Returns the beans present in the store
protected abstract  BeanStoreNamingScheme getNamingScheme()
          Gets an naming scheme for handling keys in a bean store
<T> void
put(Contextual<? extends T> bean, T instance)
          Puts an instance of a bean in the store
<T> T
remove(Contextual<? extends T> contextual)
          Removes an instance from the store
protected abstract  void removeAttribute(java.lang.String key)
          Removes an attribute from the underlying storage
protected abstract  void setAttribute(java.lang.String key, java.lang.Object instance)
          Sets an instance under a key in the underlying storage
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAttributeBackedBeanStore

public AbstractAttributeBackedBeanStore()
Method Detail

get

public <T> T get(Contextual<? extends T> contextual)
Gets a bean from the store

Specified by:
get in interface BeanStore
Parameters:
contextual - The bean to get
Returns:
The instance

remove

public <T> T remove(Contextual<? extends T> contextual)
Removes an instance from the store

Specified by:
remove in interface BeanStore
Parameters:
contextual - The bean of the instance to remove
Returns:
The removed instance

clear

public void clear()
Clears the bean store

Specified by:
clear in interface BeanStore

getBeans

public java.lang.Iterable<Contextual<? extends java.lang.Object>> getBeans()
Returns the beans present in the store

Specified by:
getBeans in interface BeanStore
Returns:
The beans

put

public <T> void put(Contextual<? extends T> bean,
                    T instance)
Puts an instance of a bean in the store

Specified by:
put in interface BeanStore
Parameters:
bean - The key bean
instance - The instance

getAttribute

protected abstract java.lang.Object getAttribute(java.lang.String key)
Gets an attribute from the underlying storage

Parameters:
key - The key of the attribute
Returns:
The data

removeAttribute

protected abstract void removeAttribute(java.lang.String key)
Removes an attribute from the underlying storage

Parameters:
key - The attribute to remove

getAttributeNames

protected abstract java.util.Enumeration<java.lang.String> getAttributeNames()
Gets an enumeration of the attribute names present in the underlying storage

Returns:
The attribute names

setAttribute

protected abstract void setAttribute(java.lang.String key,
                                     java.lang.Object instance)
Sets an instance under a key in the underlying storage

Parameters:
key - The key
instance - The instance

getNamingScheme

protected abstract BeanStoreNamingScheme getNamingScheme()
Gets an naming scheme for handling keys in a bean store

Returns:
The naming scheme

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.