Creating a Search Object
To search the registry, the user must create a search object using a BeanPool instance. The BeanPool offers several methods for creating search objects:
Without arguments: BeanPool.createSearch();
This creates a search object which, when executed, searches for objects in the registry from all registered bean types. See
Bean Types Managed by CSAF.
When a List of items is passed: BeanPool.createSearch(List<Class<? extends RegistryBean>> beanClasses)
The created search object searches through all objects in the registry, from the specified list of types.
When a single type is passed: BeanPool.createSearch(Class<? extends RegistryBean bean> beanClass)
The search object searches the registry only for items from the specified type.
The search object has a result() method that searches the registry and returns a list of all RegistryBean objects that satisfy the search criteria.
Example:
BeanPool beanPool = sessionContext.getCurrentBeanPool();
Search search = beanPool.createSearch();