Package org.jboss.as.ee.component
Class ViewConfiguration
- java.lang.Object
-
- org.jboss.as.ee.component.ViewConfiguration
-
public class ViewConfiguration extends Object
A configuration of a component view.- Author:
- David M. Lloyd, Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description ViewConfiguration(Class<?> viewClass, ComponentConfiguration componentConfiguration, org.jboss.msc.service.ServiceName viewServiceName, org.jboss.invocation.proxy.ProxyFactory<?> proxyFactory)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAsyncMethod(Method method)
Marks a method on the view as asynchronousvoid
addClientInterceptor(Method method, org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds a client interceptor to the given methodvoid
addClientInterceptor(org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds a client interceptor factory to all methods of a viewvoid
addClientPostConstructInterceptor(org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds a client post construct interceptorvoid
addClientPreDestroyInterceptor(org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds a client pre-destroy interceptorvoid
addViewInterceptor(Method method, org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds a view interceptor to the given methodvoid
addViewInterceptor(org.jboss.invocation.InterceptorFactory interceptorFactory, int priority)
Adds an interceptor factory to all methods of a viewSet<Method>
getAsyncMethods()
Gets all async methods for the viewList<BindingConfiguration>
getBindingConfigurations()
Get the binding configurations for this view.List<org.jboss.invocation.InterceptorFactory>
getClientInterceptors(Method method)
Get the client interceptors for a method.List<org.jboss.invocation.InterceptorFactory>
getClientPostConstructInterceptors()
Get the post-construct interceptors for client proxy instances.List<org.jboss.invocation.InterceptorFactory>
getClientPreDestroyInterceptors()
Get the pre-destroy interceptors for client proxy instances.ComponentConfiguration
getComponentConfiguration()
Get the component configuration for this view.List<DependencyConfigurator<ViewService>>
getDependencies()
Map<Class<?>,Object>
getPrivateData()
retrieves private dataorg.jboss.invocation.proxy.ProxyFactory<?>
getProxyFactory()
Get the client proxy factory to use to construct proxy instances.Class<?>
getViewClass()
Get the view class.ViewInstanceFactory
getViewInstanceFactory()
List<org.jboss.invocation.InterceptorFactory>
getViewInterceptors(Method method)
Get the view interceptors for a method.org.jboss.msc.service.ServiceName
getViewServiceName()
Get the view service name for this view.Map<Method,Method>
getViewToComponentMethodMap()
<T> void
putPrivateData(Class<T> type, T data)
Attaches arbitrary private data to this view instancevoid
setViewInstanceFactory(ViewInstanceFactory viewInstanceFactory)
-
-
-
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 classcomponentConfiguration
- the associated component configurationviewServiceName
- the service name of this viewproxyFactory
- 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 addpriority
- 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 addinterceptorFactory
- The interceptor factorypriority
- 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 addpriority
- 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 addinterceptorFactory
- The interceptor factorypriority
- 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 interceptorpriority
- 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 interceptorpriority
- 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
-
getViewInstanceFactory
public ViewInstanceFactory getViewInstanceFactory()
-
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 datadata
- The data
-
getDependencies
public List<DependencyConfigurator<ViewService>> getDependencies()
-
-