Package net.sf.cglib.proxy

Examples of net.sf.cglib.proxy.MethodInterceptor


    public boolean isProxy(Object proxy) {
        return interceptors.containsKey(proxy);
    }

    public AbstractName getProxyTarget(Object proxy) {
        MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.get(proxy);
        if (methodInterceptor == null) {
            return null;
        }
        return getAbstractName(methodInterceptor);
    }
View Full Code Here


    public void testSimpleProxied() throws Exception
    {
        Enhancer enh = new Enhancer();
        enh.setInterfaces(new Class[] { BeanInterface.class });
        enh.setCallback(new MethodInterceptor() {
            @Override
                public Object intercept(Object obj, Method method,
                                        Object[] args, MethodProxy proxy)
                    throws Throwable
                {
View Full Code Here

    Class<?> classTextColumn =
        classLoader.loadClass("com.google.gwt.user.cellview.client.TextColumn");
    // prepare Enhancer
    Enhancer enhancer = new Enhancer();
    enhancer.setSuperclass(classTextColumn);
    enhancer.setCallback(new MethodInterceptor() {
      public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
          throws Throwable {
        if (ReflectionUtils.getMethodSignature(method).equals("getValue(java.lang.Object)")) {
          return columnText;
        }
View Full Code Here

            }
        }
        e.setInterfaces(ifs);
       
        e.setSuperclass(delegate.getClass());
        e.setCallback(new MethodInterceptor() {
            public Object intercept(Object arg0, Method arg1, Object[] arg2,
                    MethodProxy arg3) throws Throwable {
                return c.invoke(arg0, arg1, arg2);
            }
        });
View Full Code Here

        if (superClass != null) {
            Enhancer enhancer = new Enhancer();
            enhancer.setClassLoader(loader);
            enhancer.setSuperclass(superClass);
            enhancer.setInterfaces(theInterfaces.toArray(new Class[]{}));
            enhancer.setCallback(new MethodInterceptor() {

                public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
                    throws Throwable {
                    return h.invoke(obj, method, args);
                }
View Full Code Here

    }

    protected Remote createRmiService(final Interface serviceInterface) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(UnicastRemoteObject.class);
        enhancer.setCallback(new MethodInterceptor() {
            public Object intercept(Object arg0, Method method, Object[] args, MethodProxy arg3) throws Throwable {
                try {
                    return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
                } catch (InvocationTargetException e) {
                    final Throwable cause = e.getCause();
View Full Code Here

    }

    private Remote createRmiService(final Interface serviceInterface) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(UnicastRemoteObject.class);
        enhancer.setCallback(new MethodInterceptor() {
            public Object intercept(Object arg0, Method method, Object[] args, MethodProxy arg3) throws Throwable {
                try {
                    return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
                } catch (InvocationTargetException e) {
                    final Throwable cause = e.getCause();
View Full Code Here

    public void destroyProxy(Object proxy) {
        if (proxy == null) {
            return;
        }

        MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.remove(proxy);
        if (methodInterceptor != null) {
            doDestroy(methodInterceptor);
        }
    }
View Full Code Here

    public boolean isProxy(Object proxy) {
        return interceptors.containsKey(proxy);
    }

    public AbstractName getProxyTarget(Object proxy) {
        MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.get(proxy);
        if (methodInterceptor == null) {
            return null;
        }
        return getAbstractName(methodInterceptor);
    }
View Full Code Here

    }

    protected Remote createRmiService(final Interface serviceInterface) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(UnicastRemoteObject.class);
        enhancer.setCallback(new MethodInterceptor() {
            public Object intercept(Object arg0, Method method, Object[] args, MethodProxy arg3) throws Throwable {
                return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
            }
        });
        Class targetJavaInterface = getTargetJavaClass(serviceInterface);
View Full Code Here

TOP

Related Classes of net.sf.cglib.proxy.MethodInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.