org.nanocontainer.aop.dynaop.InvocationAdapter 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.Invocation;
import org.aopalliance.intercept.MethodInvocation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
/**
* Adapts a dynaop.Invocation
object to the
* org.nanocontainer.nanoaop.MethodInvocation
interface.
*
* @author Stephen Molitor
* @version $Revision: 3144 $
*/
class InvocationAdapter implements MethodInvocation {
private final Invocation delegate;
/**
* Creates a new InvocationAdapter
that delegates to the
* given dynaop.Invocation
.
*
* @param delegate the dynaop.Invocation
object to delegate
* to.
*/
InvocationAdapter(Invocation delegate) {
this.delegate = delegate;
}
public Method getMethod() {
return delegate.getMethod();
}
public Object[] getArguments() {
return delegate.getArguments();
}
public AccessibleObject getStaticPart() {
return delegate.getMethod();
}
public Object getThis() {
return delegate.getProxy().getProxyContext().unwrap();
}
public Object proceed() throws Throwable {
return delegate.proceed();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy