public enum BeanManager extends Enum<BeanManager>
This configuration enum allows you to get the CDI
BeanManager anyway in cases where
CDI#current() may not work, or when you'd like to test availability of
CDI without having any direct CDI dependency (as done in
ApplicationListener). It will during initialization
grab the CDI bean manager instance as generic object from JNDI.
Do not use it directly. Use
Beans utility class instead. It will under the covers use this
configuration enum. This configuration enum is basically a leftover from OmniFaces 1.x where the CDI dependency was
getReference(Class) method is deprecated since OmniFaces 2.3 and will be removed in OmniFaces
|Enum Constant and Description|
Returns the lazily loaded enum singleton instance.
|Modifier and Type||Method and Description|
Returns the CDI bean manager.
Perform manual initialization whereby the bean manager is looked up from servlet context when not available.
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static BeanManager values()
for (BeanManager c : BeanManager.values()) System.out.println(c);
public static BeanManager valueOf(String name)
public void init(ServletContext servletContext)
servletContext- The servlet context to obtain the BeanManager from, if necessary.
IllegalStateException- When initialization fails.
public <T> T get()
ClassCastException- When you assign it to a variable which is not declared as CDI BeanManager.
@Deprecated public <T> T getReference(Class<T> beanClass)
T- The expected return type.
beanClass- The CDI managed bean class.
nullif there is none.
UnsupportedOperationException- When obtaining the CDI managed bean reference failed with an exception.
Copyright © 2012–2016 OmniFaces. All rights reserved.