org.nanocontainer.aop.dynaop.MethodInterceptorAdapter Maven / Gradle / Ivy
/*****************************************************************************
* Copyright (c) PicoContainer Organization. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD *
* style license a copy of which has been included with this distribution in *
* the LICENSE.txt file. *
* *
* Idea by Rachel Davies, Original code by various *
*****************************************************************************/
package org.nanocontainer.aop.dynaop;
import dynaop.Interceptor;
import dynaop.Invocation;
import org.aopalliance.intercept.MethodInterceptor;
/**
* Adapts a org.aopalliance.intercept.MethodInterceptor
to the
* dynaop.Interceptor
interface.
*
* @author Stephen Molitor
* @version $Revision: 3144 $
*/
class MethodInterceptorAdapter implements Interceptor {
private final MethodInterceptor delegate;
/**
* Creates a new MethodInterceptorAdapter
that will delegate
* to the given org.aopalliance.intercept.MethodInterceptor
.
*
* @param delegate the
* org.aopalliance.intercept.MethodInterceptor
to
* delegate to.
*/
MethodInterceptorAdapter(MethodInterceptor delegate) {
this.delegate = delegate;
}
public Object intercept(Invocation invocation) throws Throwable {
return delegate.invoke(new InvocationAdapter(invocation));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy