Class SupplierThreadScopeBean
java.lang.Object
org.glassfish.jersey.inject.cdi.se.bean.JerseyBean<Object>
org.glassfish.jersey.inject.cdi.se.bean.SupplierThreadScopeBean
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Contextual<Object>,jakarta.enterprise.inject.spi.Bean<Object>,jakarta.enterprise.inject.spi.BeanAttributes<Object>,jakarta.enterprise.inject.spi.PassivationCapable
Creates an implementation of
Bean interface using Jersey's SupplierInstanceBinding.
Binding provides the information about the bean also called BeanAttributes information.
The Bean does not use JerseyInjectionTarget because serves already
created proxy, therefore the create operation just return provided instance without any other contextual operation
(produce, inject, destroy).
This bean is special and is used only for service registered as a PerThread and
works through the proxy which serves the correct instance per the given thread.
Register example:
AbstractBinder {
@Override
protected void configure() {
bindFactory(new MyFactoryInjectionProvider())
.to(MyBean.class)
.in(PerThread.class);
}
}
Inject example:
@Path("/")
public class MyResource {
@Inject
private MyBean myBean;
}
-
Method Summary
Methods inherited from class org.glassfish.jersey.inject.cdi.se.bean.JerseyBean
getId, getInjectionPoints, getName, getQualifiers, getRank, getStereotypes, getTypes, isAlternative, isNullable, transformScope
-
Method Details
-
getScope
- Specified by:
getScopein interfacejakarta.enterprise.inject.spi.BeanAttributes<Object>- Overrides:
getScopein classJerseyBean<Object>
-
create
-
destroy
public void destroy(Object instance, jakarta.enterprise.context.spi.CreationalContext<Object> creationalContext) - Specified by:
destroyin interfacejakarta.enterprise.context.spi.Contextual<Object>- Overrides:
destroyin classJerseyBean<Object>
-
getBeanClass
- Specified by:
getBeanClassin interfacejakarta.enterprise.inject.spi.Bean<Object>- Overrides:
getBeanClassin classJerseyBean<Object>
-