Class 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 Detail

      • BeanIdentifierIndex

        public BeanIdentifierIndex()
    • Method Detail

      • 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:
        Arrays.hashCode(Object[])
      • 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
      • getDebugInfo

        public String getDebugInfo()