public Object invoke()

in provider/fastbin/src/main/java/org/apache/aries/rsa/provider/fastbin/tcp/ClientInvokerImpl.java [294:328]


        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            try {
                if(method.getDeclaringClass()==Object.class) {

                    if (args != null && args.length == 1 && "equals".equals(method.getName())) {
                        //special treatment for equals to make sure proxy.equals(proxy) -> true
                        Object arg = args[0];
                        if (arg == null) {
                            return false;
                        }
                        if (proxy == arg) {
                            return true;
                        }
                    }
                    //shortcut for hashcode, toString...
                    return method.invoke(this, args);
                }
                return request(this, address, service, classLoader, method, args);
            }
            catch (Throwable e) {
                if (e instanceof ExecutionException) {
                    ExecutionException executionException = (ExecutionException)e;
                    e = executionException.getCause();
                }
                if (e instanceof RuntimeException) {
                    throw e;
                }
                Class< ? >[] exceptionTypes = method.getExceptionTypes();
                for (Class< ? > exceptionType : exceptionTypes) {
                    if(exceptionType.isAssignableFrom(e.getClass()))
                        throw e;
                }
                throw new ServiceException(e.getMessage(), e);
            }
        }