Class BeanManagerInstanceCreator
- java.lang.Object
-
- org.eclipse.yasson.internal.components.BeanManagerInstanceCreator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,JsonbComponentInstanceCreator
public class BeanManagerInstanceCreator extends Object implements JsonbComponentInstanceCreator
CDI instance manager. Instances are created and stored per instance ofJsonBinding
. Calling close on JsonBinding, cleans up Jsonb CDI instances and in case of "dependant" scope its dependencies.- Author:
- Roman Grigoriadi
-
-
Constructor Summary
Constructors Constructor Description BeanManagerInstanceCreator(javax.enterprise.inject.spi.BeanManager beanManager)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T> T
getOrCreateComponent(Class<T> componentClass)
Creates an instance of the CDI managed bean.
-
-
-
Method Detail
-
getOrCreateComponent
public <T> T getOrCreateComponent(Class<T> componentClass)
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
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-