Package org.jboss.as.ee.component
Class ComponentDescription
java.lang.Object
org.jboss.as.ee.component.ComponentDescription
- All Implemented Interfaces:
ResourceInjectionTarget
- Direct Known Subclasses:
ManagedBeanComponentDescription
A description of a generic Jakarta EE component. The description is pre-classloading so it references everything by name.
- Author:
- David M. Lloyd, Richard Opalka
-
Constructor Summary
ConstructorsConstructorDescriptionComponentDescription(String componentName, String componentClassName, EEModuleDescription moduleDescription, org.jboss.msc.service.ServiceName deploymentUnitServiceName) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassInterceptor(InterceptorDescription description) Add a class level interceptor.voidaddDependency(org.jboss.msc.service.ServiceName serviceName) Add a dependency to this component.voidaddInterceptorMethodOverride(String className, InterceptorClassDescription override) Adds an interceptor class method override, merging it with existing overrides (if any)voidaddMethodInterceptor(org.jboss.invocation.proxy.MethodIdentifier method, InterceptorDescription description) Add a method interceptor class name.voidcreateConfiguration(org.jboss.as.server.deployment.reflect.ClassReflectionIndex classIndex, ClassLoader moduleClassLoader, org.jboss.modules.ModuleLoader moduleLoader) voidexcludeClassInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) voidexcludeDefaultInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) Returns a combined map of class and method level interceptorsGet the component's module's application name.Get the binding configurations for this component.getClassInterceptor(String interceptorClassName) Returns theInterceptorDescriptionfor the passedinterceptorClassName, if such a class interceptor exists for this component description.Get the list of interceptor classes applied directly to class.Get the component instance class name.Get the component name.Get the configurators for this component.org.jboss.msc.service.ServiceNameGet the context service name.org.jboss.msc.service.ServiceNameGet the service name of this components create serviceSet<org.jboss.msc.service.ServiceName>Get the dependency set.Map<org.jboss.invocation.proxy.MethodIdentifier,List<InterceptorDescription>> Get the method interceptor configurations.Get the component's module name.Get the naming mode of this component.getResourceInjections(String className) org.jboss.msc.service.ServiceNameGet the base service name for this component.org.jboss.msc.service.ServiceNameGet the service name of this components start serviceSet<org.jboss.invocation.proxy.MethodIdentifier>getViews()Get the list of views which apply to this component.booleanIf this method returns true then Weld will directly create the component instance, which will apply interceptors and decorators via sub classing.booleanisExcludeClassInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) booleanbooleanisExcludeDefaultInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) booleanbooleanbooleanbooleanbooleanbooleanstatic InterceptorClassDescriptionmergeInterceptorConfig(Class<?> clazz, EEModuleClassDescription classDescription, ComponentDescription description, boolean metadataComplete) voidsetBeanDeploymentArchiveId(String beanDeploymentArchiveId) voidsetClassInterceptors(List<InterceptorDescription> classInterceptors) Override the class interceptors with a new set of interceptorsvoidsetContextServiceName(org.jboss.msc.service.ServiceName contextServiceName) Set context service name.voidsetDefaultInterceptors(List<InterceptorDescription> defaultInterceptors) voidsetDeploymentDescriptorEnvironment(DeploymentDescriptorEnvironment deploymentDescriptorEnvironment) voidsetExcludeDefaultInterceptors(boolean excludeDefaultInterceptors) voidsetIgnoreLifecycleInterceptors(boolean ignoreLifecycleInterceptors) If this component should ignore lifecycle interceptors.voidsetMethodInterceptors(org.jboss.invocation.proxy.MethodIdentifier identifier, List<InterceptorDescription> interceptorDescriptions) Sets the method level interceptors for a method, and marks it as exclude class and default level interceptors.voidsetNamingMode(ComponentNamingMode namingMode) Set the naming mode of this component.
-
Constructor Details
-
ComponentDescription
public ComponentDescription(String componentName, String componentClassName, EEModuleDescription moduleDescription, org.jboss.msc.service.ServiceName deploymentUnitServiceName) Construct a new instance.- Parameters:
componentName- the component namecomponentClassName- the component instance class namemoduleDescription- the EE module descriptiondeploymentUnitServiceName- the service name of the DU containing this component
-
-
Method Details
-
createConfiguration
public ComponentConfiguration createConfiguration(org.jboss.as.server.deployment.reflect.ClassReflectionIndex classIndex, ClassLoader moduleClassLoader, org.jboss.modules.ModuleLoader moduleLoader) -
getComponentName
Get the component name.- Returns:
- the component name
-
setContextServiceName
public void setContextServiceName(org.jboss.msc.service.ServiceName contextServiceName) Set context service name.- Parameters:
contextServiceName-
-
getContextServiceName
public org.jboss.msc.service.ServiceName getContextServiceName()Get the context service name.- Returns:
- the context service name
-
getServiceName
public org.jboss.msc.service.ServiceName getServiceName()Get the base service name for this component.- Returns:
- the base service name
-
getStartServiceName
public org.jboss.msc.service.ServiceName getStartServiceName()Get the service name of this components start service- Returns:
- The start service name
-
getCreateServiceName
public org.jboss.msc.service.ServiceName getCreateServiceName()Get the service name of this components create service- Returns:
- The create service name
-
getComponentClassName
Get the component instance class name.- Returns:
- the component class name
-
getModuleName
Get the component's module name.- Returns:
- the module name
-
getApplicationName
Get the component's module's application name.- Returns:
- the application name
-
getClassInterceptors
Get the list of interceptor classes applied directly to class. These interceptors will have lifecycle methods invoked- Returns:
- the interceptor classes
-
setClassInterceptors
Override the class interceptors with a new set of interceptors- Parameters:
classInterceptors-
-
getDefaultInterceptors
- Returns:
- the components default interceptors
-
setDefaultInterceptors
-
getAllInterceptors
Returns a combined map of class and method level interceptors- Returns:
- all interceptors on the class
-
isExcludeDefaultInterceptors
public boolean isExcludeDefaultInterceptors()- Returns:
trueif theExcludeDefaultInterceptorsannotation was applied to the class
-
setExcludeDefaultInterceptors
public void setExcludeDefaultInterceptors(boolean excludeDefaultInterceptors) -
isIgnoreLifecycleInterceptors
public boolean isIgnoreLifecycleInterceptors() -
setIgnoreLifecycleInterceptors
public void setIgnoreLifecycleInterceptors(boolean ignoreLifecycleInterceptors) If this component should ignore lifecycle interceptors. This should generally only be set when they are going to be handled by an external framework such as Weld. -
excludeDefaultInterceptors
public void excludeDefaultInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) - Parameters:
method- The method that has been annotated@ExcludeDefaultInterceptors
-
isExcludeDefaultInterceptors
public boolean isExcludeDefaultInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) -
excludeClassInterceptors
public void excludeClassInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) - Parameters:
method- The method that has been annotated@ExcludeClassInterceptors
-
isExcludeClassInterceptors
public boolean isExcludeClassInterceptors(org.jboss.invocation.proxy.MethodIdentifier method) -
addClassInterceptor
Add a class level interceptor.- Parameters:
description- the interceptor class description
-
getClassInterceptor
Returns theInterceptorDescriptionfor the passedinterceptorClassName, if such a class interceptor exists for this component description. Else returns null.- Parameters:
interceptorClassName- The fully qualified interceptor class name- Returns:
-
getMethodInterceptors
public Map<org.jboss.invocation.proxy.MethodIdentifier,List<InterceptorDescription>> getMethodInterceptors()Get the method interceptor configurations. The key is the method identifier, the value is the set of class names of interceptors to configure on that method.- Returns:
- the method interceptor configurations
-
addMethodInterceptor
public void addMethodInterceptor(org.jboss.invocation.proxy.MethodIdentifier method, InterceptorDescription description) Add a method interceptor class name.- Parameters:
method- the methoddescription- the interceptor descriptor
-
setMethodInterceptors
public void setMethodInterceptors(org.jboss.invocation.proxy.MethodIdentifier identifier, List<InterceptorDescription> interceptorDescriptions) Sets the method level interceptors for a method, and marks it as exclude class and default level interceptors. This is used to set the final interceptor order after it has been modifier by the deployment descriptor- Parameters:
identifier- the method identifierinterceptorDescriptions- The interceptors
-
addInterceptorMethodOverride
Adds an interceptor class method override, merging it with existing overrides (if any)- Parameters:
className- The class nameoverride- The method override
-
getNamingMode
Get the naming mode of this component.- Returns:
- the naming mode
-
setNamingMode
Set the naming mode of this component. May not benull.- Parameters:
namingMode- the naming mode
-
getModuleDescription
- Returns:
- The module description for the component
-
addDependency
public void addDependency(org.jboss.msc.service.ServiceName serviceName) Add a dependency to this component. If the same dependency is added multiple times, only the first will take effect.- Parameters:
serviceName- the service name of the dependency
-
getDependencies
Get the dependency set.- Returns:
- the dependency set
-
getDeploymentDescriptorEnvironment
-
setDeploymentDescriptorEnvironment
public void setDeploymentDescriptorEnvironment(DeploymentDescriptorEnvironment deploymentDescriptorEnvironment) -
getBindingConfigurations
Get the binding configurations for this component. This list contains bindings which are specific to the component.- Returns:
- the binding configurations
-
getViews
Get the list of views which apply to this component.- Returns:
- the list of views
-
isTimerServiceApplicable
public boolean isTimerServiceApplicable()- Returns:
- true If this component type is eligible for a timer service
-
isTimerServiceRequired
public boolean isTimerServiceRequired()- Returns:
trueif this component has timeout methods and is eligible for a 'real' timer service
-
getTimerMethods
- Returns:
- The set of all method identifiers for the timeout methods
-
isPassivationApplicable
public boolean isPassivationApplicable() -
getConfigurators
Get the configurators for this component.- Returns:
- the configurators
-
isIntercepted
public boolean isIntercepted() -
isOptional
public boolean isOptional()- Returns:
trueif errors should be ignored when installing this component
-
getBeanDeploymentArchiveId
-
setBeanDeploymentArchiveId
-
addResourceInjection
- Specified by:
addResourceInjectionin interfaceResourceInjectionTarget
-
getResourceInjections
-
isCDIInterceptorEnabled
public boolean isCDIInterceptorEnabled()If this method returns true then Weld will directly create the component instance, which will apply interceptors and decorators via sub classing. For most components this is not necessary. Also not that even though Jakarta Enterprise Beans's are intercepted, their interceptor is done through a different method that integrates with the existing Jakarta Enterprise Beans interceptor chain -
mergeInterceptorConfig
public static InterceptorClassDescription mergeInterceptorConfig(Class<?> clazz, EEModuleClassDescription classDescription, ComponentDescription description, boolean metadataComplete)
-