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
public class ComponentDescription extends Object implements ResourceInjectionTarget
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
Constructors Constructor Description ComponentDescription(String componentName, String componentClassName, EEModuleDescription moduleDescription, org.jboss.msc.service.ServiceName deploymentUnitServiceName)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassInterceptor(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.voidaddResourceInjection(ResourceInjectionConfiguration injection)ComponentConfigurationcreateConfiguration(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)Set<InterceptorDescription>getAllInterceptors()Returns a combined map of class and method level interceptorsStringgetApplicationName()Get the component's module's application name.StringgetBeanDeploymentArchiveId()List<BindingConfiguration>getBindingConfigurations()Get the binding configurations for this component.InterceptorDescriptiongetClassInterceptor(String interceptorClassName)Returns theInterceptorDescriptionfor the passedinterceptorClassName, if such a class interceptor exists for this component description.List<InterceptorDescription>getClassInterceptors()Get the list of interceptor classes applied directly to class.StringgetComponentClassName()Get the component instance class name.StringgetComponentName()Get the component name.Deque<ComponentConfigurator>getConfigurators()Get the configurators for this component.org.jboss.msc.service.ServiceNamegetContextServiceName()Get the context service name.org.jboss.msc.service.ServiceNamegetCreateServiceName()Get the service name of this components create serviceList<InterceptorDescription>getDefaultInterceptors()Set<org.jboss.msc.service.ServiceName>getDependencies()Get the dependency set.DeploymentDescriptorEnvironmentgetDeploymentDescriptorEnvironment()Map<org.jboss.invocation.proxy.MethodIdentifier,List<InterceptorDescription>>getMethodInterceptors()Get the method interceptor configurations.EEModuleDescriptiongetModuleDescription()StringgetModuleName()Get the component's module name.ComponentNamingModegetNamingMode()Get the naming mode of this component.Map<InjectionTarget,ResourceInjectionConfiguration>getResourceInjections(String className)org.jboss.msc.service.ServiceNamegetServiceName()Get the base service name for this component.org.jboss.msc.service.ServiceNamegetStartServiceName()Get the service name of this components start serviceSet<org.jboss.invocation.proxy.MethodIdentifier>getTimerMethods()Set<ViewDescription>getViews()Get the list of views which apply to this component.booleanisCDIInterceptorEnabled()If 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)booleanisExcludeDefaultInterceptors()booleanisExcludeDefaultInterceptors(org.jboss.invocation.proxy.MethodIdentifier method)booleanisIgnoreLifecycleInterceptors()booleanisIntercepted()booleanisOptional()booleanisPassivationApplicable()booleanisTimerServiceApplicable()booleanisTimerServiceRequired()static 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 Detail
-
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 Detail
-
createConfiguration
public ComponentConfiguration createConfiguration(org.jboss.as.server.deployment.reflect.ClassReflectionIndex classIndex, ClassLoader moduleClassLoader, org.jboss.modules.ModuleLoader moduleLoader)
-
getComponentName
public String 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
public String getComponentClassName()
Get the component instance class name.- Returns:
- the component class name
-
getModuleName
public String getModuleName()
Get the component's module name.- Returns:
- the module name
-
getApplicationName
public String getApplicationName()
Get the component's module's application name.- Returns:
- the application name
-
getClassInterceptors
public List<InterceptorDescription> getClassInterceptors()
Get the list of interceptor classes applied directly to class. These interceptors will have lifecycle methods invoked- Returns:
- the interceptor classes
-
setClassInterceptors
public void setClassInterceptors(List<InterceptorDescription> classInterceptors)
Override the class interceptors with a new set of interceptors- Parameters:
classInterceptors-
-
getDefaultInterceptors
public List<InterceptorDescription> getDefaultInterceptors()
- Returns:
- the components default interceptors
-
setDefaultInterceptors
public void setDefaultInterceptors(List<InterceptorDescription> defaultInterceptors)
-
getAllInterceptors
public Set<InterceptorDescription> 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
public void addClassInterceptor(InterceptorDescription description)
Add a class level interceptor.- Parameters:
description- the interceptor class description
-
getClassInterceptor
public InterceptorDescription getClassInterceptor(String interceptorClassName)
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
public void addInterceptorMethodOverride(String className, InterceptorClassDescription override)
Adds an interceptor class method override, merging it with existing overrides (if any)- Parameters:
className- The class nameoverride- The method override
-
getNamingMode
public ComponentNamingMode getNamingMode()
Get the naming mode of this component.- Returns:
- the naming mode
-
setNamingMode
public void setNamingMode(ComponentNamingMode namingMode)
Set the naming mode of this component. May not benull.- Parameters:
namingMode- the naming mode
-
getModuleDescription
public EEModuleDescription 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
public Set<org.jboss.msc.service.ServiceName> getDependencies()
Get the dependency set.- Returns:
- the dependency set
-
getDeploymentDescriptorEnvironment
public DeploymentDescriptorEnvironment getDeploymentDescriptorEnvironment()
-
setDeploymentDescriptorEnvironment
public void setDeploymentDescriptorEnvironment(DeploymentDescriptorEnvironment deploymentDescriptorEnvironment)
-
getBindingConfigurations
public List<BindingConfiguration> getBindingConfigurations()
Get the binding configurations for this component. This list contains bindings which are specific to the component.- Returns:
- the binding configurations
-
getViews
public Set<ViewDescription> 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
public Set<org.jboss.invocation.proxy.MethodIdentifier> getTimerMethods()
- Returns:
- The set of all method identifiers for the timeout methods
-
isPassivationApplicable
public boolean isPassivationApplicable()
-
getConfigurators
public Deque<ComponentConfigurator> 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
public String getBeanDeploymentArchiveId()
-
setBeanDeploymentArchiveId
public void setBeanDeploymentArchiveId(String beanDeploymentArchiveId)
-
addResourceInjection
public void addResourceInjection(ResourceInjectionConfiguration injection)
- Specified by:
addResourceInjectionin interfaceResourceInjectionTarget
-
getResourceInjections
public Map<InjectionTarget,ResourceInjectionConfiguration> getResourceInjections(String className)
-
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)
-
-