org.jboss.weld.context.beanstore
Class AbstractAttributeBackedBeanStore

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

public abstract class AbstractAttributeBackedBeanStore
extends java.lang.Object
implements org.jboss.weld.context.api.BeanStore

Provides common BeanStore operations

Author:
Nicklas Karlsson

Constructor Summary
AbstractAttributeBackedBeanStore()
           
 
Method Summary
 void clear()
          Clears the bean store
<T> org.jboss.weld.context.api.ContextualInstance<T>
get(java.lang.String id)
          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.util.Collection<java.lang.String> getContextualIds()
          Returns the beans present in the store
protected abstract  NamingScheme getNamingScheme()
          Gets an naming scheme for handling keys in a bean store
<T> void
put(java.lang.String id, org.jboss.weld.context.api.ContextualInstance<T> beanInstance)
          Puts an instance of a bean in 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> org.jboss.weld.context.api.ContextualInstance<T> get(java.lang.String id)
Gets a bean from the store

Specified by:
get in interface org.jboss.weld.context.api.BeanStore
Parameters:
contextual - The bean to get
Returns:
The instance

clear

public void clear()
Clears the bean store

Specified by:
clear in interface org.jboss.weld.context.api.BeanStore

getContextualIds

public java.util.Collection<java.lang.String> getContextualIds()
Returns the beans present in the store

Specified by:
getContextualIds in interface org.jboss.weld.context.api.BeanStore
Returns:
The beans

put

public <T> void put(java.lang.String id,
                    org.jboss.weld.context.api.ContextualInstance<T> beanInstance)
Puts an instance of a bean in the store

Specified by:
put in interface org.jboss.weld.context.api.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 NamingScheme 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 © 2008-2009 Seam Framework. All Rights Reserved.