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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
<T> T
getOrCreateComponent
(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, wait
Methods 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:
getOrCreateComponent
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-