Package org.jboss.weld.serialization
Class BeanIdentifierIndex
java.lang.Object
org.jboss.weld.serialization.BeanIdentifierIndex
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNote that the index can only be built once.voidcleanup()org.jboss.weld.serialization.spi.BeanIdentifiergetIdentifier(int idx) getIndex(org.jboss.weld.serialization.spi.BeanIdentifier identifier) The index hash is used to detect possible inconsistencies in distributed environments.booleanisBuilt()booleanisEmpty()toString()
-
Constructor Details
-
BeanIdentifierIndex
public BeanIdentifierIndex()
-
-
Method Details
-
getIndex
- 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
The index hash is used to detect possible inconsistencies in distributed environments.- Returns:
- the index hash
- See Also:
-
build
Note that the index can only be built once.- Parameters:
beans- The set of beans the index should be built from, only instances ofCommonBeanand implementations ofPassivationCapableare included- Throws:
IllegalStateException- If the index is built already
-
isBuilt
public boolean isBuilt()- Returns:
trueif the index is built,falseotherwise
-
isEmpty
public boolean isEmpty()- Returns:
trueif the index is empty,falseotherwise
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceorg.jboss.weld.bootstrap.api.Service
-
toString
-
getDebugInfo
-