Package org.jboss.as.ee.component
Class BasicComponent
java.lang.Object
org.jboss.as.ee.component.BasicComponent
- All Implemented Interfaces:
Component
A basic component implementation.
- Author:
- John Bailey, David M. Lloyd
-
Constructor Summary
ConstructorsConstructorDescriptionBasicComponent(BasicComponentCreateService createService) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomponentInstanceCreated(BasicComponentInstance basicComponentInstance) Method that can be overridden to perform setup on the instance after it has been createdprotected BasicComponentInstanceconstructComponentInstance(ManagedReference instance, boolean invokePostConstruct) Construct the component instance.protected BasicComponentInstanceconstructComponentInstance(ManagedReference instance, boolean invokePostConstruct, Map<Object, Object> context) Construct the component instance.Create a new instance of this component.createInstance(Object instance) Wraps an existing object instance in a ComponentInstance, and run the post construct interceptor chain on it.protected voidcreateInterceptors(org.jboss.invocation.InterceptorFactoryContext context) Class<?>Get the class of this bean component.Get the name of this bean component.org.jboss.msc.service.ServiceNamegetInstance(Object instance) Returns a component instance for a pre-existing instance.voidinit()protected BasicComponentInstanceinstantiateComponentInstance(org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method, org.jboss.invocation.Interceptor> methodInterceptors, Map<Object, Object> context) Responsible for instantiating theBasicComponentInstance.static org.jboss.msc.service.ServiceNameserviceNameOf(org.jboss.msc.service.ServiceName deploymentUnitServiceName, String componentName) voidstart()Start operation called when the Component is available.voidstop()Stop operation called when the Component is no longer available.toString()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jboss.as.ee.component.Component
isRemotable
-
Constructor Details
-
BasicComponent
Construct a new instance.- Parameters:
createService- the create service which created this component
-
-
Method Details
-
createInstance
Create a new instance of this component. This may be invoked by a component interceptor, a client interceptor, or in the course of creating a new client, or in the case of an "eager" singleton, at component start. This method will block until the component is available. If the component fails to start then a runtime exception will be thrown.- Specified by:
createInstancein interfaceComponent- Returns:
- the component instance
-
createInstance
Wraps an existing object instance in a ComponentInstance, and run the post construct interceptor chain on it.- Specified by:
createInstancein interfaceComponent- Parameters:
instance- The instance to wrap- Returns:
- The new ComponentInstance
-
getInstance
Description copied from interface:ComponentReturns a component instance for a pre-existing instance.- Specified by:
getInstancein interfaceComponent- Parameters:
instance- the actual object instance- Returns:
- a component instance
-
waitForComponentStart
public void waitForComponentStart()- Specified by:
waitForComponentStartin interfaceComponent
-
constructComponentInstance
protected BasicComponentInstance constructComponentInstance(ManagedReference instance, boolean invokePostConstruct) Construct the component instance. Upon return, the object instance should have injections and lifecycle invocations completed already.- Parameters:
instance- An instance to be wrapped, or null if a new instance should be created- Returns:
- the component instance
-
constructComponentInstance
protected BasicComponentInstance constructComponentInstance(ManagedReference instance, boolean invokePostConstruct, Map<Object, Object> context) Construct the component instance. Upon return, the object instance should have injections and lifecycle invocations completed already.- Parameters:
instance- An instance to be wrapped, or null if a new instance should be created- Returns:
- the component instance
-
componentInstanceCreated
Method that can be overridden to perform setup on the instance after it has been created- Parameters:
basicComponentInstance- The component instance
-
instantiateComponentInstance
protected BasicComponentInstance instantiateComponentInstance(org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method, org.jboss.invocation.Interceptor> methodInterceptors, Map<Object, Object> context) Responsible for instantiating theBasicComponentInstance. This method is *not* responsible for handling the post construct activities like injection and lifecycle invocation. That is handled byconstructComponentInstance(org.jboss.as.naming.ManagedReference, boolean).- Returns:
- the component instance
-
getComponentClass
Get the class of this bean component.- Specified by:
getComponentClassin interfaceComponent- Returns:
- the class
-
getComponentName
Get the name of this bean component.- Returns:
- the component name
-
getCreateServiceName
public org.jboss.msc.service.ServiceName getCreateServiceName() -
start
public void start()Start operation called when the Component is available. -
init
public void init() -
createInterceptors
protected void createInterceptors(org.jboss.invocation.InterceptorFactoryContext context) -
stop
public void stop()Stop operation called when the Component is no longer available. -
toString
-
getNamespaceContextSelector
- Specified by:
getNamespaceContextSelectorin interfaceComponent- Returns:
- The components namespace context selector, or null if it does not have one
-
serviceNameOf
public static org.jboss.msc.service.ServiceName serviceNameOf(org.jboss.msc.service.ServiceName deploymentUnitServiceName, String componentName)
-