Class DelegatingContextualLifecycle<T>

java.lang.Object
org.infinispan.cdi.common.util.DelegatingContextualLifecycle<T>
Type Parameters:
T -
All Implemented Interfaces:
ContextualLifecycle<T>

public class DelegatingContextualLifecycle<T> extends Object implements ContextualLifecycle<T>
An implementation of ContextualLifecycle that is backed by an InjectionTarget.
Author:
Pete Muir, Stuart Douglas
  • Constructor Summary

    Constructors
    Constructor
    Description
    DelegatingContextualLifecycle(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget)
    Instantiate a new ContextualLifecycle backed by an InjectionTarget.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(javax.enterprise.inject.spi.Bean<T> bean, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
    Callback invoked by a created bean when Contextual.create(CreationalContext) is called.
    void
    destroy(javax.enterprise.inject.spi.Bean<T> bean, T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
    Callback invoked by a created bean when Contextual.destroy(Object, CreationalContext) is called.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DelegatingContextualLifecycle

      public DelegatingContextualLifecycle(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget)
      Instantiate a new ContextualLifecycle backed by an InjectionTarget.
      Parameters:
      injectionTarget - the InjectionTarget used to create and destroy instances
  • Method Details

    • create

      public T create(javax.enterprise.inject.spi.Bean<T> bean, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Description copied from interface: ContextualLifecycle
      Callback invoked by a created bean when Contextual.create(CreationalContext) is called.
      Specified by:
      create in interface ContextualLifecycle<T>
      Parameters:
      bean - the bean initiating the callback
      creationalContext - the context in which this instance was created
    • destroy

      public void destroy(javax.enterprise.inject.spi.Bean<T> bean, T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Description copied from interface: ContextualLifecycle
      Callback invoked by a created bean when Contextual.destroy(Object, CreationalContext) is called.
      Specified by:
      destroy in interface ContextualLifecycle<T>
      Parameters:
      bean - the bean initiating the callback
      instance - the contextual instance to destroy
      creationalContext - the context in which this instance was created