Package org.jboss.invocation
Class Interceptors
- java.lang.Object
-
- org.jboss.invocation.Interceptors
-
public final class Interceptors extends Object
Interceptor utility and factory methods.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InterceptorgetChainedInterceptor(Collection<Interceptor> instances)Get a chained interceptor which passes the invocation through the given interceptors.static InterceptorgetChainedInterceptor(Interceptor... instances)Get a chained interceptor which passes the invocation through the given interceptors.static InterceptorFactorygetChainedInterceptorFactory(Collection<InterceptorFactory> instances)Get a chained interceptor which passes the invocation through the given interceptors.static InterceptorFactorygetChainedInterceptorFactory(InterceptorFactory... instances)Get a chained interceptor factory which builds a chained interceptor using the given factories.static InterceptorgetInitialInterceptor()Get an interceptor that is always invoked first.static InterceptorFactorygetInitialInterceptorFactory()Get the interceptor factory for the initial interceptor.static InterceptorgetInvokingInterceptor()Get an invoking interceptor which always terminates.static InterceptorFactorygetInvokingInterceptorFactory()Get a factory which returns the invoking interceptor.static InterceptorgetTerminalInterceptor()Get an interceptor which always returnsnull.static InterceptorFactorygetTerminalInterceptorFactory()Get a factory which returns the terminal interceptor.static InterceptorgetWeavedInterceptor(Interceptor... interceptors)static Exceptionrethrow(Throwable throwable)
-
-
-
Method Detail
-
getInitialInterceptor
public static Interceptor getInitialInterceptor()
Get an interceptor that is always invoked first. This interceptor is responsible for correctly handling any initialization and cleanup for the interceptor chain. For example, this interceptor is responsible for handling undeclared checked exceptions.- Returns:
- the interceptor
-
getInitialInterceptorFactory
public static InterceptorFactory getInitialInterceptorFactory()
Get the interceptor factory for the initial interceptor.- Returns:
- the factory
-
getTerminalInterceptor
public static Interceptor getTerminalInterceptor()
Get an interceptor which always returnsnull.- Returns:
- the interceptor
-
getTerminalInterceptorFactory
public static InterceptorFactory getTerminalInterceptorFactory()
Get a factory which returns the terminal interceptor.- Returns:
- the factory
-
getInvokingInterceptor
public static Interceptor getInvokingInterceptor()
Get an invoking interceptor which always terminates. If the invoked method isnull, this interceptor returnsnull, making it suitable for terminating lifecycle interceptor chains as well as invocation interceptor chains.- Returns:
- the interceptor
-
getInvokingInterceptorFactory
public static InterceptorFactory getInvokingInterceptorFactory()
Get a factory which returns the invoking interceptor.- Returns:
- the factory
-
getChainedInterceptor
public static Interceptor getChainedInterceptor(Interceptor... instances)
Get a chained interceptor which passes the invocation through the given interceptors.- Parameters:
instances- the interceptors to pass through- Returns:
- the chained interceptor
-
getChainedInterceptor
public static Interceptor getChainedInterceptor(Collection<Interceptor> instances)
Get a chained interceptor which passes the invocation through the given interceptors.- Parameters:
instances- the interceptors to pass through- Returns:
- the chained interceptor
-
getChainedInterceptorFactory
public static InterceptorFactory getChainedInterceptorFactory(InterceptorFactory... instances)
Get a chained interceptor factory which builds a chained interceptor using the given factories.- Parameters:
instances- the interceptor factories to use- Returns:
- the chained interceptor factory
-
getChainedInterceptorFactory
public static InterceptorFactory getChainedInterceptorFactory(Collection<InterceptorFactory> instances)
Get a chained interceptor which passes the invocation through the given interceptors.- Parameters:
instances- the interceptors to pass through- Returns:
- the chained interceptor
-
getWeavedInterceptor
public static Interceptor getWeavedInterceptor(Interceptor... interceptors)
-
-