org.jboss.webbeans.context.api
Interface BeanStore

All Known Implementing Classes:
AbstractAttributeBackedBeanStore, AbstractMapBackedBeanStore, ApplicationBeanStore, ConcurrentHashMapBeanStore, ConversationBeanStore, ForwardingBeanStore, HttpRequestSessionBeanStore, HttpSessionBeanStore

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> 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(Contextual<? extends T> bean, T instance)
          Adds a bean instance to the storage
<T> T
remove(Contextual<? extends T> bean)
          Removes an instance of a bean from the storage
 

Method Detail

get

<T> 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

remove

<T> T remove(Contextual<? extends T> bean)
Removes an instance of a bean from the storage

Parameters:
bean - The bean whose instance to remove
Returns:
The removed instance. Null if not found in storage.

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(Contextual<? extends T> bean,
             T instance)
Adds a bean instance to the storage

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


Copyright © 2011. All Rights Reserved.