Package org.jboss.as.ee.component
Class BasicComponentInstance
java.lang.Object
org.jboss.as.ee.component.BasicComponentInstance
- All Implemented Interfaces:
Serializable,ComponentInstance
An abstract base component instance.
- Author:
- David M. Lloyd
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBasicComponentInstance(BasicComponent component, org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method, org.jboss.invocation.Interceptor> methodInterceptors) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the list of allowed methods for this component instance.voidfinal voiddestroy()Destroy this component instance.Get the component associated with this instance.Get the actual object instance.getInstanceData(Object key) Gets some data that was attached to this component instanceorg.jboss.invocation.InterceptorgetInterceptor(Method method) Get the instance interceptor (entry point) for the given method.protected voidMethod that sub classes can use to override destroy logic.protected org.jboss.invocation.InterceptorContextvoidsetInstanceData(Object key, Object value) Attaches some data to this component instance.
-
Field Details
-
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
Get the component associated with this instance.- Specified by:
getComponentin interfaceComponentInstance- Returns:
- the component
-
getInstance
Get the actual object instance. The object instance has all injections filled.- Specified by:
getInstancein interfaceComponentInstance- Returns:
- the instance
-
getInterceptor
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:
getInterceptorin interfaceComponentInstance- Parameters:
method- the method- Returns:
- the interceptor
- Throws:
IllegalStateException- if the method does not exist
-
allowedMethods
Get the list of allowed methods for this component instance. The handler will only accept invocations on these exactMethodobjects.- Specified by:
allowedMethodsin interfaceComponentInstance- 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:
destroyin interfaceComponentInstance
-
getInstanceData
Description copied from interface:ComponentInstanceGets some data that was attached to this component instance- Specified by:
getInstanceDatain interfaceComponentInstance- Parameters:
key- The component data key- Returns:
- The attached data
-
setInstanceData
Description copied from interface:ComponentInstanceAttaches some data to this component instance. This should only be used during component construction.- Specified by:
setInstanceDatain interfaceComponentInstance- Parameters:
key- The key to store the datavalue- 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()
-