Examples of AsyncLoadException


Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

            public Object doAsyncLoad() {
                try {
                    return temp.proceed();
                } catch (Throwable e) {
                    throw new AsyncLoadException("AsyncLoadInterceptor invoke error!", e);
                }
            }
        }, invocation.getMethod().getReturnType()); // 这里指定了返回目标class

    }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

                return getOriginalClass();
            } else if ("_getOriginalResult".equals(method.getName())) {
                return getOriginalResut();
            }

            throw new AsyncLoadException("method[" + method.getName() + "] is not support!");
        }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

        AsyncLoadUtils.notNull(callback, "callback is null!");

        Type type = callback.getClass().getGenericInterfaces()[0];
        if (!(type instanceof ParameterizedType)) {
            // 用户不指定AsyncLoadCallBack的泛型信息
            throw new AsyncLoadException("you should specify AsyncLoadCallBack<R> for R type, ie: AsyncLoadCallBack<OfferModel>");
        }
        Class returnClass = (Class) getGenericClass((ParameterizedType) type, 0);

        AsyncLoadConfig copy = config.cloneConfig();
        copy.setDefaultTimeout(timeout);
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

        AsyncLoadUtils.notNull(callback, "callback is null!");

        Type type = callback.getClass().getGenericInterfaces()[0];
        if (!(type instanceof ParameterizedType)) {
            // 用户不指定AsyncLoadCallBack的泛型信息
            throw new AsyncLoadException("you should specify AsyncLoadCallBack<R> for R type, ie: AsyncLoadCallBack<OfferModel>");
        }
        Class returnClass = (Class) getGenericClass((ParameterizedType) type, 0);
        return execute(callback, returnClass, config);
    }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

        AsyncLoadUtils.notNull(config, "config should not be null");
        AsyncLoadUtils.notNull(executor, "executor should not be null");

        if (Modifier.isFinal(targetClass.getModifiers())) { // 目前暂不支持final类型的处理,以后可以考虑使用jdk
                                                            // proxy
            throw new AsyncLoadException("Enhance proxy not support final class :" + targetClass.getName());
        }

        if (!Modifier.isPublic(targetClass.getModifiers())) {
            // 处理如果是非public属性,则不进行代理,强制访问会出现IllegalAccessException,比如一些内部类或者匿名类不允许直接访问
            throw new AsyncLoadException("Enhance proxy not support private/protected class :" + targetClass.getName());
        }
    }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

        public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
            if ("_getOriginalClass".equals(method.getName())) {
                return getOriginalClass();
            }
            throw new AsyncLoadException("method[" + method.getName() + "] is not support!");
        }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

                    public Object call() throws Exception {
                        try {
                            return finMethod.invoke(finObj, finArgs);// 需要直接委托对应的finObj(service)进行处理
                        } catch (Throwable e) {
                            throw new AsyncLoadException("future invoke error!", e);
                        }
                    }

                    public AsyncLoadConfig getConfig() {
                        return config;
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

        Pattern[] destination = new Pattern[source.length];
        for (int i = 0; i < source.length; i++) {
            try {
                destination[i] = compiler.compile(source[i], Perl5Compiler.READ_ONLY_MASK);
            } catch (MalformedPatternException ex) {
                throw new AsyncLoadException(ex.getMessage());
            }
        }
        return destination;
    }
View Full Code Here

Examples of com.alibaba.asyncload.impl.exceptions.AsyncLoadException

            } else {
                return future.get(timeout, TimeUnit.MILLISECONDS);
            }
        } catch (TimeoutException e) {
            future.cancel(true);
            throw new AsyncLoadException(e);
        } catch (InterruptedException e) {
            throw new AsyncLoadException(e);
        } catch (Exception e) {
            throw new AsyncLoadException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.