Class CreationalContextImpl<T>

java.lang.Object
org.jboss.weld.contexts.CreationalContextImpl<T>
All Implemented Interfaces:
jakarta.enterprise.context.spi.CreationalContext<T>, Serializable, org.jboss.weld.construction.api.WeldCreationalContext<T>, WeldCreationalContext<T>

public class CreationalContextImpl<T> extends Object implements jakarta.enterprise.context.spi.CreationalContext<T>, WeldCreationalContext<T>, Serializable
Author:
Pete Muir, Ales Justin, Jozef Hartinger
See Also:
  • Constructor Details

    • CreationalContextImpl

      public CreationalContextImpl(jakarta.enterprise.context.spi.Contextual<T> contextual)
  • Method Details

    • push

      public void push(T incompleteInstance)
      Specified by:
      push in interface jakarta.enterprise.context.spi.CreationalContext<T>
    • getCreationalContext

      public <S> CreationalContextImpl<S> getCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
      Specified by:
      getCreationalContext in interface WeldCreationalContext<T>
    • getProducerReceiverCreationalContext

      public <S> CreationalContextImpl<S> getProducerReceiverCreationalContext(jakarta.enterprise.context.spi.Contextual<S> contextual)
      Description copied from interface: WeldCreationalContext
      The returned CreationalContext shares nothing but incomplete instances.
      Specified by:
      getProducerReceiverCreationalContext in interface WeldCreationalContext<T>
      Returns:
      the CreationalContext for a producer reciever
    • getIncompleteInstance

      public <S> S getIncompleteInstance(jakarta.enterprise.context.spi.Contextual<S> bean)
      Specified by:
      getIncompleteInstance in interface WeldCreationalContext<T>
    • containsIncompleteInstance

      public boolean containsIncompleteInstance(jakarta.enterprise.context.spi.Contextual<?> bean)
    • addDependentInstance

      public void addDependentInstance(org.jboss.weld.context.api.ContextualInstance<?> contextualInstance)
      Specified by:
      addDependentInstance in interface WeldCreationalContext<T>
    • release

      public void release()
      Specified by:
      release in interface jakarta.enterprise.context.spi.CreationalContext<T>
      Specified by:
      release in interface WeldCreationalContext<T>
    • release

      public void release(jakarta.enterprise.context.spi.Contextual<T> contextual, T instance)
    • getParentCreationalContext

      public CreationalContextImpl<?> getParentCreationalContext()
      Specified by:
      getParentCreationalContext in interface WeldCreationalContext<T>
      Returns:
      the parent CreationalContext or null if there isn't any parent.
    • getDependentInstances

      public List<org.jboss.weld.context.api.ContextualInstance<?>> getDependentInstances()
      Returns an unmodifiable list of dependent instances.
      Specified by:
      getDependentInstances in interface WeldCreationalContext<T>
    • writeReplace

      protected Object writeReplace() throws ObjectStreamException
      Throws:
      ObjectStreamException
    • addDependentResourceReference

      public void addDependentResourceReference(org.jboss.weld.injection.spi.ResourceReference<?> resourceReference)
      Register a ResourceReference as a dependency. ResourceReference.release() will be called on every ResourceReference once this CreationalContext instance is released.
      Specified by:
      addDependentResourceReference in interface WeldCreationalContext<T>
    • destroyDependentInstance

      public boolean destroyDependentInstance(T instance)
      Destroys dependent instance
      Specified by:
      destroyDependentInstance in interface WeldCreationalContext<T>
      Parameters:
      instance -
      Returns:
      true if the instance was destroyed, false otherwise
    • getContextual

      public jakarta.enterprise.context.spi.Contextual<T> getContextual()
      Specified by:
      getContextual in interface WeldCreationalContext<T>
      Returns:
      the Contextual for which this CreationalContext is created.
    • getAroundConstructCallbacks

      public List<org.jboss.weld.construction.api.AroundConstructCallback<T>> getAroundConstructCallbacks()
    • setConstructorInterceptionSuppressed

      public void setConstructorInterceptionSuppressed(boolean value)
      Specified by:
      setConstructorInterceptionSuppressed in interface org.jboss.weld.construction.api.WeldCreationalContext<T>
    • isConstructorInterceptionSuppressed

      public boolean isConstructorInterceptionSuppressed()
      Specified by:
      isConstructorInterceptionSuppressed in interface org.jboss.weld.construction.api.WeldCreationalContext<T>
    • registerAroundConstructCallback

      public void registerAroundConstructCallback(org.jboss.weld.construction.api.AroundConstructCallback<T> callback)
      Specified by:
      registerAroundConstructCallback in interface org.jboss.weld.construction.api.WeldCreationalContext<T>
    • getAroundConstructInterceptionContext

      public InterceptionContext getAroundConstructInterceptionContext()
      Returns:
      the interception context used for Weld-managed AroundConstruct interceptors or null if no such interceptors were applied
    • setAroundConstructInterceptionContext

      public void setAroundConstructInterceptionContext(InterceptionContext aroundConstructInterceptionContext)