Class BeanIdentifierIndex

java.lang.Object
org.jboss.weld.serialization.BeanIdentifierIndex
All Implemented Interfaces:
org.jboss.weld.bootstrap.api.Service

public class BeanIdentifierIndex extends Object implements org.jboss.weld.bootstrap.api.Service
An optional per deployment service. The index holds identifiers for the specified set of beans (note that only instances of CommonBean and implementations of PassivationCapable are included). Identifiers are sorted into ascending order, according to the BeanIdentifier.asString() natural ordering.
Author:
Martin Kouba
  • Constructor Details

    • BeanIdentifierIndex

      public BeanIdentifierIndex()
  • Method Details

    • getIndex

      public Integer getIndex(org.jboss.weld.serialization.spi.BeanIdentifier identifier)
      Parameters:
      identifier -
      Returns:
      the position for the given bean identifier or null if the index does not contain the given identifier
    • getIdentifier

      public org.jboss.weld.serialization.spi.BeanIdentifier getIdentifier(int idx)
      Parameters:
      idx -
      Returns:
      the identifier at the specified position
    • getIndexHash

      public Integer getIndexHash()
      The index hash is used to detect possible inconsistencies in distributed environments.
      Returns:
      the index hash
      See Also:
    • build

      public void build(Set<jakarta.enterprise.inject.spi.Bean<?>> beans)
      Note that the index can only be built once.
      Parameters:
      beans - The set of beans the index should be built from, only instances of CommonBean and implementations of PassivationCapable are included
      Throws:
      IllegalStateException - If the index is built already
    • isBuilt

      public boolean isBuilt()
      Returns:
      true if the index is built, false otherwise
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if the index is empty, false otherwise
    • cleanup

      public void cleanup()
      Specified by:
      cleanup in interface org.jboss.weld.bootstrap.api.Service
    • toString

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

      public String getDebugInfo()