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
public class SupplierThreadScopeBean extends JerseyBean<Object>
Creates an implementation ofBeaninterface using Jersey'sSupplierInstanceBinding. Binding provides the information about the bean also calledBeanAttributesinformation. TheBeandoes not useJerseyInjectionTargetbecause 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
PerThreadand 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcreate(jakarta.enterprise.context.spi.CreationalContext<Object> ctx)voiddestroy(Object instance, jakarta.enterprise.context.spi.CreationalContext<Object> creationalContext)Class<?>getBeanClass()Class<? extends Annotation>getScope()-
Methods inherited from class org.glassfish.jersey.inject.cdi.se.bean.JerseyBean
getId, getInjectionPoints, getName, getQualifiers, getRank, getStereotypes, getTypes, isAlternative, isNullable, transformScope
-
-
-
-
Method Detail
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScopein interfacejakarta.enterprise.inject.spi.BeanAttributes<Object>- Overrides:
getScopein classJerseyBean<Object>
-
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
public Class<?> getBeanClass()
- Specified by:
getBeanClassin interfacejakarta.enterprise.inject.spi.Bean<Object>- Overrides:
getBeanClassin classJerseyBean<Object>
-
-