Class MX4JComponentAdapter<T>

java.lang.Object
org.exoplatform.container.AbstractComponentAdapter<T>
org.exoplatform.container.jmx.MX4JComponentAdapter<T>
All Implemented Interfaces:
Serializable, javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.PassivationCapable, ComponentAdapter<T>, ComponentAdapter<T>
Direct Known Subclasses:
ManageableComponentAdapter

public class MX4JComponentAdapter<T> extends AbstractComponentAdapter<T> implements javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.PassivationCapable
Version:
$Revision: 1.5 $
Author:
James Strachan, Mauro Talevi, Jeppe Cramon, Benjamin Mestrallet
See Also:
  • Field Details

    • instance_

      protected transient volatile T instance_
    • lock

      protected final transient Lock lock
    • isSingleton

      protected volatile boolean isSingleton
      Indicates whether or not it should be managed as a singleton
    • isInitialized

      protected transient volatile boolean isInitialized
    • scope

      protected final transient AtomicReference<Class<? extends Annotation>> scope
      The scope of the adapter
    • exocontainer

      protected final transient ExoContainer exocontainer
      .
  • Constructor Details

  • Method Details

    • getComponentInstance

      public T getComponentInstance()
      Description copied from interface: ComponentAdapter
      Retrieve the component instance. This method will usually create a new instance each time it is called, but that is not required.
      Specified by:
      getComponentInstance in interface ComponentAdapter<T>
      Returns:
      the component instance.
    • getScope

      public Class<? extends Annotation> getScope()
      Gives the scope of the adapter
    • createInstance

      protected T createInstance(javax.enterprise.context.spi.Context ctx)
    • isSingleton

      public boolean isSingleton()
      Indicates whether or not this adapter is a singleton
      Specified by:
      isSingleton in interface ComponentAdapter<T>
    • getSetMethod

      protected static Method getSetMethod(Class<?> clazz, String name, Class<?> pluginClass)
      Finds the best "set method" according to the given method name and type of plugin
      Parameters:
      clazz - the Class of the target component
      name - the name of the method
      pluginClass - the Class of the plugin
      Returns:
      the "set method" corresponding to the given context
    • create

      protected T create()
      Must be used to create Singleton or Prototype only
    • create

      public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Specified by:
      create in interface javax.enterprise.context.spi.Contextual<T>
    • destroy

      public void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Specified by:
      destroy in interface javax.enterprise.context.spi.Contextual<T>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getId

      public String getId()
      Specified by:
      getId in interface javax.enterprise.inject.spi.PassivationCapable
    • manageScope

      protected boolean manageScope(boolean isSingleton, boolean isInitialized, boolean hasInjectableConstructor, boolean isInjectPresent)
      Defines the scope of the component
      Returns:
      true if the component is considered as a singleton, false otherwise.