public class ServletContextBeanFinder extends Object implements BeanFinder
BeanFinder
allows to register implementations of a given interface by setting a servlet
context parameter. See the following configuration for an example how to register the implementation of TogglzConfig
so that this class is able to find it.
<context-param> <param-name>org.togglz.core.config.TogglzConfig</param-name> <param-value>com.example.myapp.TogglzConfigImpl</param-value> </context-param>
Constructor and Description |
---|
ServletContextBeanFinder() |
Modifier and Type | Method and Description |
---|---|
<E> Collection<E> |
find(Class<E> clazz,
Object context)
Retrieve a list of all beans of the given type.
|
public <E> Collection<E> find(Class<E> clazz, Object context)
BeanFinder
find
in interface BeanFinder
clazz
- The type to lookup. In most cases this will be an interface.context
- An optional context that may help the implementation to interact with the bean container. In Servlet
environments this context object is the ServletContext.null
Copyright © 2014. All Rights Reserved.