Invocation API 1.1.0.Final

org.jboss.invocation
Class MethodInterceptorFactory

java.lang.Object
  extended by org.jboss.invocation.MethodInterceptorFactory
All Implemented Interfaces:
InterceptorFactory

public final class MethodInterceptorFactory
extends Object
implements InterceptorFactory

An interceptor factory for interceptor objects which call a specific method via reflection. If this factory is called more than once in the same context, it will return the same interceptor instance.

Author:
David M. Lloyd

Constructor Summary
MethodInterceptorFactory(InterceptorInstanceFactory instanceFactory, Method interceptorMethod)
          Construct a new instance.
MethodInterceptorFactory(InterceptorInstanceFactory instanceFactory, Method interceptorMethod, boolean changeMethod)
          Construct a new instance.
 
Method Summary
 Interceptor create(InterceptorFactoryContext context)
          Create the interceptor instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodInterceptorFactory

public MethodInterceptorFactory(InterceptorInstanceFactory instanceFactory,
                                Method interceptorMethod,
                                boolean changeMethod)
Construct a new instance.

Parameters:
instanceFactory - the instance factory for the interceptor instance
interceptorMethod - the interceptor method
changeMethod - true to change the method on the context to equal the given method, false to leave it as-is

MethodInterceptorFactory

public MethodInterceptorFactory(InterceptorInstanceFactory instanceFactory,
                                Method interceptorMethod)
Construct a new instance.

Parameters:
instanceFactory - the instance factory for the interceptor instance
interceptorMethod - the interceptor method
Method Detail

create

public Interceptor create(InterceptorFactoryContext context)
Create the interceptor instance.

Specified by:
create in interface InterceptorFactory
Parameters:
context - the interceptor factory context
Returns:
the interceptor instance

Invocation API 1.1.0.Final

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.