Module org.eclipse.yasson
Class BeanManagerInstanceCreator
java.lang.Object
org.eclipse.yasson.internal.components.BeanManagerInstanceCreator
- All Implemented Interfaces:
Closeable,AutoCloseable,JsonbComponentInstanceCreator
CDI instance manager.
Instances are created and stored per instance of
JsonBinding.
Calling close on JsonBinding, cleans up Jsonb CDI instances and in case of "dependant" scope its dependencies.
CDI API dependency is optional, this class is never referenced / loaded if CDI API is not resolvable.-
Field Summary
Fields inherited from interface org.eclipse.yasson.spi.JsonbComponentInstanceCreator
DEFAULT_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<T> TgetOrCreateComponent(Class<T> componentClass) Creates an instance of the CDI managed bean.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.yasson.spi.JsonbComponentInstanceCreator
getPriority
-
Constructor Details
-
BeanManagerInstanceCreator
Creates a new instance.- Parameters:
beanManager- Bean manager.
-
-
Method Details
-
getOrCreateComponent
Creates an instance of the CDI managed bean. Calls CDI API to inject into the bean.- Specified by:
getOrCreateComponentin interfaceJsonbComponentInstanceCreator- Type Parameters:
T- Jsonb component type- Parameters:
componentClass- bean class to be instantiated.- Returns:
- New instance of bean class with injected content.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-