Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.gf.cdi

public Class CdiComponentProvider

extends ComponentProvider
Class Inheritance
Imports
java.lang.annotation.Annotation, java.util.Map, java.util.concurrent.ConcurrentHashMap, java.util.logging.Logger, jakarta.enterprise.context.spi.CreationalContext, jakarta.enterprise.inject.spi.AnnotatedType, .BeanManager, .InjectionTarget, .InjectionTargetFactory, javax.naming.InitialContext, .NamingException, org.glassfish.tyrus.core.ComponentProvider

Provides the instance for CDI class.
Author
Stepan Kopriva

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final BeanManager
private static final Map<Object, CdiComponentProvider.CdiInjectionContext>
private static final Logger
private final boolean

Constructor Summary

AccessConstructor and Description
public
CdiComponentProvider()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public <T> Object
create(Class<T>
Class to be created.
c
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.create.

Create new instance.

public boolean
destroy(Object
instance to be destroyed.
o
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.destroy.

Destroys the given managed instance.

public boolean
isApplicable(Class<?>
Class to be checked.
c
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.isApplicable.

Checks whether this component provider is able to provide an instance of given Class.

Inherited from org.glassfish.tyrus.core.ComponentProvider:
getInvocableMethod

Field Detail

beanManagerback to summary
private final BeanManager beanManager
cdiBeanToContextback to summary
private static final Map<Object, CdiComponentProvider.CdiInjectionContext> cdiBeanToContext
LOGGERback to summary
private static final Logger LOGGER
managerRetrievedback to summary
private final boolean managerRetrieved

Constructor Detail

CdiComponentProviderback to summary
public CdiComponentProvider() throws NamingException

Constructor.

Looks up the BeanManager which is later used to provide the instance.

Exceptions
NamingException:
when Bean Manager cannot be looked up.

Method Detail

createback to summary
public <T> Object create(Class<T> c)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.create.

Doc from org.glassfish.tyrus.core.ComponentProvider.create.

Create new instance.

Parameters
<T>
type of the created object.
c:Class<T>

Class to be created.

Returns:Object

instance, iff found, null otherwise.

Annotations
@SuppressWarnings:unchecked
@Override
destroyback to summary
public boolean destroy(Object o)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.destroy.

Doc from org.glassfish.tyrus.core.ComponentProvider.destroy.

Destroys the given managed instance.

Parameters
o:Object

instance to be destroyed.

Returns:boolean

true iff the instance was coupled to this ComponentProvider, false otherwise.

Annotations
@Override
isApplicableback to summary
public boolean isApplicable(Class<?> c)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.isApplicable.

Doc from org.glassfish.tyrus.core.ComponentProvider.isApplicable.

Checks whether this component provider is able to provide an instance of given Class.

Parameters
c:Class<?>

Class to be checked.

Returns:boolean

true iff this ComponentProvider is able to create an instance of the given Class.

Annotations
@Override
org.glassfish.tyrus.gf.cdi back to summary

private Class CdiComponentProvider.CdiInjectionContext

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.tyrus.gf.cdi.CdiComponentProvider.CdiInjectionContext

Field Summary

Modifier and TypeField and Description
pack-priv final CreationalContext<T>
pack-priv final InjectionTarget<T>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cleanup(Object instance)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ccback to summary
pack-priv final CreationalContext<T> cc
itback to summary
pack-priv final InjectionTarget<T> it

Constructor Detail

CdiInjectionContextback to summary
pack-priv CdiInjectionContext(InjectionTarget<T> it, CreationalContext<T> cc)

Method Detail

cleanupback to summary
public void cleanup(Object instance)
Annotations
@SuppressWarnings:unchecked