Class AbstractMapBackedBeanStore

java.lang.Object
org.jboss.weld.contexts.beanstore.AbstractMapBackedBeanStore
All Implemented Interfaces:
Iterable<org.jboss.weld.serialization.spi.BeanIdentifier>, BeanStore
Direct Known Subclasses:
ConcurrentHashMapBeanStore, HashMapBeanStore

public abstract class AbstractMapBackedBeanStore extends Object implements BeanStore
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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
    protected abstract Map<org.jboss.weld.serialization.spi.BeanIdentifier,Object>
     
    boolean
     
    <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
    Set<org.jboss.weld.serialization.spi.BeanIdentifier>
     
    int
     
    Iterator<org.jboss.weld.serialization.spi.BeanIdentifier>
     
    <T> void
    put(org.jboss.weld.serialization.spi.BeanIdentifier id, org.jboss.weld.context.api.ContextualInstance<T> beanInstance)
    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 class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jboss.weld.contexts.beanstore.BeanStore

    lock

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • AbstractMapBackedBeanStore

      public AbstractMapBackedBeanStore()
  • Method Details

    • delegate

      protected abstract Map<org.jboss.weld.serialization.spi.BeanIdentifier,Object> delegate()
    • get

      public <T> org.jboss.weld.context.api.ContextualInstance<T> get(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Description copied from interface: BeanStore
      Gets an instance of a contextual from the store
      Specified by:
      get in interface BeanStore
      Parameters:
      id - The id of the contextual to return
      Returns:
      The instance or null if not found
    • clear

      public void clear()
      Description copied from interface: BeanStore
      Clears the store of contextual instances
      Specified by:
      clear in interface BeanStore
    • contains

      public boolean contains(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Description copied from interface: BeanStore
      Check if the store contains an instance
      Specified by:
      contains in interface BeanStore
      Parameters:
      id - the id of the instance to check for
      Returns:
      true if the instance is present, otherwise false
    • remove

      public <T> org.jboss.weld.context.api.ContextualInstance<T> remove(org.jboss.weld.serialization.spi.BeanIdentifier id)
      Description copied from interface: BeanStore
      Removes a bean instance identified by the given id.
      Specified by:
      remove in interface BeanStore
      Parameters:
      id - The bean id
      Returns:
      the removed bean instance of null if there was no bean instance before
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getContextualIds

      public Set<org.jboss.weld.serialization.spi.BeanIdentifier> getContextualIds()
    • put

      public <T> void put(org.jboss.weld.serialization.spi.BeanIdentifier id, org.jboss.weld.context.api.ContextualInstance<T> beanInstance)
      Description copied from interface: BeanStore
      Adds a bean instance to the storage
      Specified by:
      put in interface BeanStore
      beanInstance - the contextual instance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • iterator

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