Package org.exoplatform.container.jmx
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExoContainer.protected Tprotected booleanprotected booleanIndicates whether or not it should be managed as a singletonprotected final Lockprotected final AtomicReference<Class<? extends Annotation>> The scope of the adapter -
Constructor Summary
ConstructorsModifierConstructorDescriptionMX4JComponentAdapter(ExoContainer holder, ConcurrentContainer container, Object key, Class<T> implementation) protectedMX4JComponentAdapter(ExoContainer holder, ConcurrentContainer container, Object key, Class<T> implementation, Lock lock) -
Method Summary
Modifier and TypeMethodDescriptionprotected Tcreate()Must be used to create Singleton or Prototype onlyprotected TcreateInstance(javax.enterprise.context.spi.Context ctx) voidbooleanRetrieve the component instance.getId()Class<? extends Annotation> getScope()Gives the scope of the adapterprotected static MethodgetSetMethod(Class<?> clazz, String name, Class<?> pluginClass) Finds the best "set method" according to the given method name and type of plugininthashCode()booleanIndicates whether or not this adapter is a singletonprotected booleanmanageScope(boolean isSingleton, boolean isInitialized, boolean hasInjectableConstructor, boolean isInjectPresent) Defines the scope of the componentMethods inherited from class org.exoplatform.container.AbstractComponentAdapter
checkTypeCompatibility, getComponentImplementation, getComponentKey, toString
-
Field Details
-
instance_
-
lock
-
isSingleton
protected volatile boolean isSingletonIndicates whether or not it should be managed as a singleton -
isInitialized
protected transient volatile boolean isInitialized -
scope
The scope of the adapter -
exocontainer
.
-
-
Constructor Details
-
MX4JComponentAdapter
public MX4JComponentAdapter(ExoContainer holder, ConcurrentContainer container, Object key, Class<T> implementation) -
MX4JComponentAdapter
protected MX4JComponentAdapter(ExoContainer holder, ConcurrentContainer container, Object key, Class<T> implementation, Lock lock)
-
-
Method Details
-
getComponentInstance
Description copied from interface:ComponentAdapterRetrieve the component instance. This method will usually create a new instance each time it is called, but that is not required.- Specified by:
getComponentInstancein interfaceComponentAdapter<T>- Returns:
- the component instance.
-
getScope
Gives the scope of the adapter -
createInstance
-
isSingleton
public boolean isSingleton()Indicates whether or not this adapter is a singleton- Specified by:
isSingletonin interfaceComponentAdapter<T>
-
getSetMethod
Finds the best "set method" according to the given method name and type of plugin -
create
Must be used to create Singleton or Prototype only -
create
- Specified by:
createin interfacejavax.enterprise.context.spi.Contextual<T>
-
destroy
public void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext) - Specified by:
destroyin interfacejavax.enterprise.context.spi.Contextual<T>
-
hashCode
public int hashCode() -
equals
-
getId
- Specified by:
getIdin interfacejavax.enterprise.inject.spi.PassivationCapable
-
manageScope
protected boolean manageScope(boolean isSingleton, boolean isInitialized, boolean hasInjectableConstructor, boolean isInjectPresent) Defines the scope of the component- Returns:
trueif the component is considered as a singleton,falseotherwise.
-