Class BasicComponentInstance

java.lang.Object
org.jboss.as.ee.component.BasicComponentInstance
All Implemented Interfaces:
Serializable, ComponentInstance

public class BasicComponentInstance extends Object implements ComponentInstance
An abstract base component instance.
Author:
David M. Lloyd
See Also:
  • Field Details

    • INSTANCE_KEY

      public static final Object INSTANCE_KEY
  • Constructor Details

    • BasicComponentInstance

      protected BasicComponentInstance(BasicComponent component, org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method,org.jboss.invocation.Interceptor> methodInterceptors)
      Construct a new instance.
      Parameters:
      component - the component
  • Method Details

    • getComponent

      public Component getComponent()
      Get the component associated with this instance.
      Specified by:
      getComponent in interface ComponentInstance
      Returns:
      the component
    • getInstance

      public Object getInstance()
      Get the actual object instance. The object instance has all injections filled.
      Specified by:
      getInstance in interface ComponentInstance
      Returns:
      the instance
    • getInterceptor

      public org.jboss.invocation.Interceptor getInterceptor(Method method) throws IllegalStateException
      Get the instance interceptor (entry point) for the given method. This is the internal entry point for the component instance, which bypasses view interceptors.
      Specified by:
      getInterceptor in interface ComponentInstance
      Parameters:
      method - the method
      Returns:
      the interceptor
      Throws:
      IllegalStateException - if the method does not exist
    • allowedMethods

      public Collection<Method> allowedMethods()
      Get the list of allowed methods for this component instance. The handler will only accept invocations on these exact Method objects.
      Specified by:
      allowedMethods in interface ComponentInstance
      Returns:
      the list of methods
    • destroy

      public final void destroy()
      Destroy this component instance. Implementations of this method must be idempotent, meaning that destroying a component instance more than one time has no additional effect.
      Specified by:
      destroy in interface ComponentInstance
    • getInstanceData

      public Object getInstanceData(Object key)
      Description copied from interface: ComponentInstance
      Gets some data that was attached to this component instance
      Specified by:
      getInstanceData in interface ComponentInstance
      Parameters:
      key - The component data key
      Returns:
      The attached data
    • setInstanceData

      public void setInstanceData(Object key, Object value)
      Description copied from interface: ComponentInstance
      Attaches some data to this component instance. This should only be used during component construction.
      Specified by:
      setInstanceData in interface ComponentInstance
      Parameters:
      key - The key to store the data
      value - The data value
    • constructionFinished

      public void constructionFinished()
    • preDestroy

      protected void preDestroy()
      Method that sub classes can use to override destroy logic.
    • prepareInterceptorContext

      protected org.jboss.invocation.InterceptorContext prepareInterceptorContext()