Class ViewConfiguration


  • public class ViewConfiguration
    extends Object
    A configuration of a component view.
    Author:
    David M. Lloyd, Stuart Douglas
    • Constructor Detail

      • ViewConfiguration

        public ViewConfiguration​(Class<?> viewClass,
                                 ComponentConfiguration componentConfiguration,
                                 org.jboss.msc.service.ServiceName viewServiceName,
                                 org.jboss.invocation.proxy.ProxyFactory<?> proxyFactory)
        Construct a new instance.
        Parameters:
        viewClass - the view class
        componentConfiguration - the associated component configuration
        viewServiceName - the service name of this view
        proxyFactory - the proxy factory to use to locally construct client proxy instances
    • Method Detail

      • getComponentConfiguration

        public ComponentConfiguration getComponentConfiguration()
        Get the component configuration for this view.
        Returns:
        the component configuration
      • getViewServiceName

        public org.jboss.msc.service.ServiceName getViewServiceName()
        Get the view service name for this view.
        Returns:
        the view service name
      • getViewInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getViewInterceptors​(Method method)
        Get the view interceptors for a method. These interceptors are run sequentially on the "server side" of an invocation. The interceptor factories are used every time a new view instance is constructed, called with a new factory context each time. The factory may return the same interceptor instance or a new interceptor instance as appropriate.
        Parameters:
        method - the method to look up
        Returns:
        the interceptors for this method
      • addViewInterceptor

        public void addViewInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                       int priority)
        Adds an interceptor factory to all methods of a view
        Parameters:
        interceptorFactory - The factory to add
        priority - The interceptor order
      • addViewInterceptor

        public void addViewInterceptor​(Method method,
                                       org.jboss.invocation.InterceptorFactory interceptorFactory,
                                       int priority)
        Adds a view interceptor to the given method
        Parameters:
        method - The method to add
        interceptorFactory - The interceptor factory
        priority - The priority
      • getClientInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getClientInterceptors​(Method method)
        Get the client interceptors for a method. These interceptors are run sequentially on the "client side" of an invocation. The interceptor factories are used every time a new client proxy instance is constructed, called with a new factory context each time. The factory may return the same interceptor instance or a new interceptor instance as appropriate.
        Parameters:
        method - the method to look up
        Returns:
        the interceptors for this method
      • addClientInterceptor

        public void addClientInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                         int priority)
        Adds a client interceptor factory to all methods of a view
        Parameters:
        interceptorFactory - The factory to add
        priority - The interceptor order
      • addClientInterceptor

        public void addClientInterceptor​(Method method,
                                         org.jboss.invocation.InterceptorFactory interceptorFactory,
                                         int priority)
        Adds a client interceptor to the given method
        Parameters:
        method - The method to add
        interceptorFactory - The interceptor factory
        priority - The priority
      • getClientPostConstructInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getClientPostConstructInterceptors()
        Get the post-construct interceptors for client proxy instances.

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

        Returns:
        the interceptors
      • addClientPostConstructInterceptor

        public void addClientPostConstructInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                                      int priority)
        Adds a client post construct interceptor
        Parameters:
        interceptorFactory - The interceptor
        priority - The interceptor order
      • getClientPreDestroyInterceptors

        public List<org.jboss.invocation.InterceptorFactory> getClientPreDestroyInterceptors()
        Get the pre-destroy interceptors for client proxy instances.

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

        Returns:
        the interceptors
      • addClientPreDestroyInterceptor

        public void addClientPreDestroyInterceptor​(org.jboss.invocation.InterceptorFactory interceptorFactory,
                                                   int priority)
        Adds a client pre-destroy interceptor
        Parameters:
        interceptorFactory - The interceptor
        priority - The interceptor order
      • getProxyFactory

        public org.jboss.invocation.proxy.ProxyFactory<?> getProxyFactory()
        Get the client proxy factory to use to construct proxy instances.
        Returns:
        the proxy factory
      • getBindingConfigurations

        public List<BindingConfiguration> getBindingConfigurations()
        Get the binding configurations for this view.
        Returns:
        the binding configurations
      • getViewClass

        public Class<?> getViewClass()
        Get the view class.
        Returns:
        the view class
      • getAsyncMethods

        public Set<Method> getAsyncMethods()
        Gets all async methods for the view
        Returns:
        The async methods
      • addAsyncMethod

        public void addAsyncMethod​(Method method)
        Marks a method on the view as asynchronous
        Parameters:
        method - The method
      • setViewInstanceFactory

        public void setViewInstanceFactory​(ViewInstanceFactory viewInstanceFactory)
        Parameters:
        viewInstanceFactory - The instance factory that is used to create the view instances
      • putPrivateData

        public <T> void putPrivateData​(Class<T> type,
                                       T data)
        Attaches arbitrary private data to this view instance
        Parameters:
        type - The type of data
        data - The data
      • getPrivateData

        public Map<Class<?>,​Object> getPrivateData()
        retrieves private data
      • getViewToComponentMethodMap

        public Map<Method,​Method> getViewToComponentMethodMap()