Interface BeanStore

All Superinterfaces:
Iterable<org.jboss.weld.serialization.spi.BeanIdentifier>
All Known Subinterfaces:
BoundBeanStore
All Known Implementing Classes:
AbstractMapBackedBeanStore, AttributeBeanStore, ConcurrentHashMapBeanStore, HashMapBeanStore, MapBeanStore, SessionMapBeanStore

public interface BeanStore extends Iterable<org.jboss.weld.serialization.spi.BeanIdentifier>
A Map like store of contextual instances, used to back the Weld built in contexts.
Author:
Nicklas Karlsson
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the store of contextual instances
    boolean
    contains(org.jboss.weld.serialization.spi.BeanIdentifier id)
    Check if the store contains an instance
    <T> org.jboss.weld.context.api.ContextualInstance<T>
    get(org.jboss.weld.serialization.spi.BeanIdentifier id)
    Gets an instance of a contextual from the store
    Iterator<org.jboss.weld.serialization.spi.BeanIdentifier>
     
    lock(org.jboss.weld.serialization.spi.BeanIdentifier id)
    Gets a creation lock for the given bean id.
    <T> void
    put(org.jboss.weld.serialization.spi.BeanIdentifier id, org.jboss.weld.context.api.ContextualInstance<T> contextualInstance)
    Adds a bean instance to the storage
    <T> org.jboss.weld.context.api.ContextualInstance<T>
    remove(org.jboss.weld.serialization.spi.BeanIdentifier id)
    Removes a bean instance identified by the given id.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • get

      <T> org.jboss.weld.context.api.ContextualInstance<T> get(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Gets an instance of a contextual from the store
      Parameters:
      id - The id of the contextual to return
      Returns:
      The instance or null if not found
    • contains

      boolean contains(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Check if the store contains an instance
      Parameters:
      id - the id of the instance to check for
      Returns:
      true if the instance is present, otherwise false
    • clear

      void clear()
      Clears the store of contextual instances
    • iterator

      Iterator<org.jboss.weld.serialization.spi.BeanIdentifier> iterator()
      Specified by:
      iterator in interface Iterable<org.jboss.weld.serialization.spi.BeanIdentifier>
    • put

      <T> void put(org.jboss.weld.serialization.spi.BeanIdentifier id, org.jboss.weld.context.api.ContextualInstance<T> contextualInstance)
      Adds a bean instance to the storage
      Parameters:
      contextualInstance - the contextual instance
    • lock

      LockedBean lock(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Gets a creation lock for the given bean id.
      Parameters:
      id - The bean id
      Returns:
      A handle that must be used to unlock the bean
    • remove

      <T> org.jboss.weld.context.api.ContextualInstance<T> remove(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Removes a bean instance identified by the given id.
      Parameters:
      id - The bean id
      Returns:
      the removed bean instance of null if there was no bean instance before