Class ComponentConfiguration


  • public class ComponentConfiguration
    extends Object
    The construction parameter set passed in to an abstract component.

    Interceptors

    NOTE: References in this file to Interceptors refer to the Jakarta Interceptors unless otherwise noted. The interceptor factories provided herein are assembled from the component's EE module class as well as the EE module classes of the declared interceptor classes for this component by way of a configurator.
    Author:
    David M. Lloyd
    • Constructor Detail

      • ComponentConfiguration

        public ComponentConfiguration​(ComponentDescription componentDescription,
                                      org.jboss.as.server.deployment.reflect.ClassReflectionIndex classIndex,
                                      ClassLoader moduleClassLoader,
                                      org.jboss.modules.ModuleLoader moduleLoader)
    • Method Detail

      • getComponentDescription

        public ComponentDescription getComponentDescription()
        Get the component description.
        Returns:
        the component description
      • getComponentClass

        public Class<?> getComponentClass()
        Get the component class.
        Returns:
        the component class
      • getComponentName

        public String getComponentName()
        Get the component name.
        Returns:
        the component name
      • getDefinedComponentMethods

        public Set<Method> getDefinedComponentMethods()
        Get the set of currently known component methods. This is an identity set.
        Returns:
        the set of methods
      • getComponentInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getComponentInterceptors​(Method method)
        Gets the interceptor list for a given method. This should not be called until all interceptors have been added.
        Parameters:
        method - the component method
        Returns:
        the deque
      • getAroundTimeoutInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getAroundTimeoutInterceptors​(Method method)
        Gets the around timeout interceptor list for a given method. This should not be called until all interceptors have been added.
        Parameters:
        method - the component method
        Returns:
        the deque
      • addComponentInterceptor

        public void addComponentInterceptor​(org.jboss.invocation.InterceptorFactory factory,
                                            int priority,
                                            boolean publicOnly)
        Adds an interceptor factory to every method on the component.
        Parameters:
        factory - The interceptor factory to add
        priority - The interceptors relative order
        publicOnly - If true then then interceptor is only added to public methods
      • addComponentInterceptors

        public void addComponentInterceptors​(List<org.jboss.invocation.InterceptorFactory> factory,
                                             int priority,
                                             boolean publicOnly)
        Adds an interceptor factory to every method on the component.
        Parameters:
        factory - The interceptor factory to add
        priority - The interceptors relative order
        publicOnly - If true then then interceptor is only added to public methods
      • addComponentInterceptor

        public void addComponentInterceptor​(Method method,
                                            org.jboss.invocation.InterceptorFactory factory,
                                            int priority)
        Adds an interceptor factory to a given method. The method parameter *must* be retrived from either the DeploymentReflectionIndex or from getDefinedComponentMethods(), as the methods are stored in an identity hash map
        Parameters:
        method - The method to add the interceptor to
        factory - The interceptor factory to add
        priority - The interceptors relative order
      • addComponentInterceptors

        public void addComponentInterceptors​(Method method,
                                             List<org.jboss.invocation.InterceptorFactory> factory,
                                             int priority)
        Adds an interceptor factory to a given method. The method parameter *must* be retrived from either the DeploymentReflectionIndex or from getDefinedComponentMethods(), as the methods are stored in an identity hash map
        Parameters:
        method - The method to add the interceptor to
        factory - The interceptor factory to add
        priority - The interceptors relative order
      • addTimeoutViewInterceptor

        public void addTimeoutViewInterceptor​(org.jboss.invocation.InterceptorFactory factory,
                                              int priority)
        Adds a timeout interceptor factory to every method on the component.
        Parameters:
        factory - The interceptor factory to add
        priority - The interceptors relative order
      • addTimeoutViewInterceptor

        public void addTimeoutViewInterceptor​(Method method,
                                              org.jboss.invocation.InterceptorFactory factory,
                                              int priority)
        Adds a timeout interceptor factory to every method on the component.
        Parameters:
        method - The method to add it to
        factory - The interceptor factory to add
        priority - The interceptors relative order
      • getCreateDependencies

        public List<DependencyConfigurator<? extends org.jboss.msc.service.Service<Component>>> getCreateDependencies()
        Get the create dependencies list.
        Returns:
        the create dependencies list
      • getViews

        public List<ViewConfiguration> getViews()
        Get the list of views for this component.
        Returns:
        the list of views
      • getAroundConstructInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getAroundConstructInterceptors()
        Get the around-construct interceptors.

        This method should only be called after all interceptors have been added

        Returns:
        the sorted interceptors
      • addAroundConstructInterceptors

        public void addAroundConstructInterceptors​(List<org.jboss.invocation.InterceptorFactory> factories,
                                                   int priority)
        Adds an around-construct interceptor
        Parameters:
        factories - The interceptors to add
        priority - The priority
      • addAroundConstructInterceptor

        public void addAroundConstructInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                                  int priority)
        Adds an around-construct interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • getPostConstructInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getPostConstructInterceptors()
        Get the post-construct interceptors.

        This method should only be called after all interceptors have been added

        Returns:
        the sorted interceptors
      • addPostConstructInterceptors

        public void addPostConstructInterceptors​(List<org.jboss.invocation.InterceptorFactory> interceptorFactory,
                                                 int priority)
        Adds a post construct interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • addPostConstructInterceptor

        public void addPostConstructInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                                int priority)
        Adds a post construct interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • getPreDestroyInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getPreDestroyInterceptors()
        Get the pre-destroy interceptors.

        This method should only be called after all interceptors have been added

        Returns:
        the sorted interceptor
      • addPreDestroyInterceptors

        public void addPreDestroyInterceptors​(List<org.jboss.invocation.InterceptorFactory> factories,
                                              int priority)
        Adds a pre destroy interceptor
        Parameters:
        factories - The interceptor factory to add
        priority - The factories priority
      • addPreDestroyInterceptor

        public void addPreDestroyInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                             int priority)
        Adds a pre destroy interceptor
        Parameters:
        interceptorFactory - The interceptor factory to add
        priority - The factories priority
      • getPrePassivateInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getPrePassivateInterceptors()
        Get the pre-passivate interceptors.

        This method should only be called after all interceptors have been added

        Returns:
        the sorted interceptors
      • addPrePassivateInterceptors

        public void addPrePassivateInterceptors​(List<org.jboss.invocation.InterceptorFactory> factories,
                                                int priority)
        Adds a pre passivate interceptor
        Parameters:
        factories - The interceptor to add
        priority - The priority
      • addPrePassivateInterceptor

        public void addPrePassivateInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                               int priority)
        Adds a pre passivate interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • getPostActivateInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getPostActivateInterceptors()
        Get the post-activate interceptors.

        This method should only be called after all interceptors have been added

        Returns:
        the sorted interceptors
      • addPostActivateInterceptors

        public void addPostActivateInterceptors​(List<org.jboss.invocation.InterceptorFactory> interceptorFactory,
                                                int priority)
        Adds a post activate interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • addPostActivateInterceptor

        public void addPostActivateInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                               int priority)
        Adds a post activate interceptor
        Parameters:
        interceptorFactory - The interceptor to add
        priority - The priority
      • getApplicationName

        public String getApplicationName()
        Get the application name.
        Returns:
        the application name
      • getModuleName

        public String getModuleName()
        Get the module name.
        Returns:
        the module name
      • getInstanceFactory

        public ComponentFactory getInstanceFactory()
        Get the instance factory for this component.
        Returns:
        the instance factory
      • setInstanceFactory

        public void setInstanceFactory​(ComponentFactory instanceFactory)
        Set the instance factory for this component.
        Parameters:
        instanceFactory - the instance factory
      • getClassIndex

        public org.jboss.as.server.deployment.reflect.ClassReflectionIndex getClassIndex()
      • getComponentCreateServiceFactory

        public ComponentCreateServiceFactory getComponentCreateServiceFactory()
        Get the component create service factory for this component.
        Returns:
        the component create service factory
      • setComponentCreateServiceFactory

        public void setComponentCreateServiceFactory​(ComponentCreateServiceFactory componentCreateServiceFactory)
        Set the component create service factory for this component.
        Parameters:
        componentCreateServiceFactory - the component create service factory
      • getNamespaceContextInterceptorFactory

        public org.jboss.invocation.InterceptorFactory getNamespaceContextInterceptorFactory()
      • setNamespaceContextInterceptorFactory

        public void setNamespaceContextInterceptorFactory​(org.jboss.invocation.InterceptorFactory interceptorFactory)
      • getModuleClassLoader

        public ClassLoader getModuleClassLoader()
      • getModuleLoader

        public org.jboss.modules.ModuleLoader getModuleLoader()
      • getNamespaceContextSelector

        public NamespaceContextSelector getNamespaceContextSelector()
        Returns:
        The components namespace context selector, if any
      • setNamespaceContextSelector

        public void setNamespaceContextSelector​(NamespaceContextSelector namespaceContextSelector)
      • getInterceptorContextKeys

        public Set<Object> getInterceptorContextKeys()
      • addLifecycleMethod

        public void addLifecycleMethod​(Method method)
        Adds a lifecycle method to the lifecycle methods set
        Parameters:
        method - The lifecycle method
      • getLifecycleMethods

        public Set<Method> getLifecycleMethods()
        Returns a set of all lifecycle methods defined on the bean
        Returns:
        All lifecycle methods defined on the component class and its superclasses