com.github.dynamicextensionsalfresco.proxy.ServiceInvocationHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alfresco-integration Show documentation
Show all versions of alfresco-integration Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.proxy;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* AOP or JDK Proxy compliant wrapper for the service {@link Tracker}
*
* @author Laurent Van der Linden
*/
public class ServiceInvocationHandler implements MethodInterceptor, InvocationHandler {
private final Tracker tracker;
public ServiceInvocationHandler(Tracker tracker) {
this.tracker = tracker;
}
@Override
public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable {
if (method.getDeclaringClass().equals(FilterModel.class)) {
return method.invoke(tracker.getFilterModel(), args);
} else {
return tracker.invokeUsing(new ServiceInvoker
© 2015 - 2025 Weber Informatics LLC | Privacy Policy