Class MX4JComponentAdapter<T>

    • Field Detail

      • 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
      • exocontainer

        protected final transient ExoContainer exocontainer
        .
    • Method Detail

      • 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
      • 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.