org.jboss.webbeans.context.api
Interface BeanStore

All Known Implementing Classes:
AbstractMapBackedBeanStore, ConcurrentHashMapBeanStore, ForwardingBeanStore

public interface BeanStore

Interface for different implementations of Bean to Bean instance storage. Used primarily by the contexts.

Author:
Nicklas Karlsson

Method Summary
 void clear()
          Clears the storage of any bean instances
<T> BeanInstance<T>
get(Contextual<? extends T> bean)
          Gets an instance of a bean from the storage.
 java.lang.Iterable<Contextual<? extends java.lang.Object>> getBeans()
          Returns an Iterable over the current contents in the storage
<T> void
put(BeanInstance<T> beanInstance)
          Adds a bean instance to the storage
 

Method Detail

get

<T> BeanInstance<T> get(Contextual<? extends T> bean)
Gets an instance of a bean from the storage.

Parameters:
bean - The bean whose instance to return
Returns:
The instance. Null if not found

clear

void clear()
Clears the storage of any bean instances


getBeans

java.lang.Iterable<Contextual<? extends java.lang.Object>> getBeans()
Returns an Iterable over the current contents in the storage

Returns:
An Iterable over the keys in the storage

put

<T> void put(BeanInstance<T> beanInstance)
Adds a bean instance to the storage

Parameters:
bean - The bean type. Used as key
instance - The instance to add


Copyright © 2008-2009. All Rights Reserved.