throw new NoSuchMethodError("No valid constructor found on proxy class"); return new EJBProxyInformation<>(proxyClass, constructor, methodInfoMap, fallbackMap, methodLocatorMap, classCompressionLevel, classIdempotent, classAsync, classInterceptors);
static <T> EJBProxyInterceptorInformation<T> construct(Class<T> clazz, EJBClientContext clientContext) { final EJBProxyInformation<T> proxyInformation = EJBProxyInformation.forViewType(clazz); final Collection<EJBProxyInformation.ProxyMethodInfo> methods = proxyInformation.getMethods(); final String className = clazz.getName(); final InterceptorList list0 = EJBClientContext.defaultInterceptors; final InterceptorList list1 = clientContext.getGlobalInterceptors(); final InterceptorList list2 = clientContext.getClassPathInterceptors(); final InterceptorList list3 = clientContext.getConfiguredPerClassInterceptors().getOrDefault(className, EMPTY); final InterceptorList list5 = proxyInformation.getClassInterceptors(); final IdentityHashMap<Method, InterceptorList> interceptorsByMethod = new IdentityHashMap<>(methods.size()); final HashMap<InterceptorList, InterceptorList> cache = new HashMap<>(); cache.computeIfAbsent(list0, Function.identity()); final InterceptorList tailList = list3.combine(list2).combine(list1).combine(list0); cache.computeIfAbsent(tailList, Function.identity()); for (EJBProxyInformation.ProxyMethodInfo method : methods) { // compile interceptor information final InterceptorList list4 = clientContext.getConfiguredPerMethodInterceptors().getOrDefault(className, emptyMap()).getOrDefault(method.getMethodLocator(), EMPTY); final InterceptorList list6 = method.getInterceptors(); interceptorsByMethod.put(method.getMethod(), cache.computeIfAbsent(list6.combine(list5).combine(list4).combine(tailList), Function.identity())); } return new EJBProxyInterceptorInformation<T>(proxyInformation, interceptorsByMethod, cache.computeIfAbsent(list5.combine(tailList), Function.identity())); }
/** * Get the proxy class for this locator. * * @return the proxy class */ public Class<? extends T> getProxyClass() { return getProxyInformation().getProxyClass(); }
boolean isIdempotent(Method proxyMethod) { final ProxyMethodInfo proxyMethodInfo = getProxyMethodInfo(proxyMethod); return proxyMethodInfo != null && (classIdempotent || proxyMethodInfo.idempotent); }
/** * Get the proxy class constructor for this locator. A proxy class constructor accepts a single * argument of type {@link InvocationHandler}. * * @return the proxy constructor */ public Constructor<? extends T> getProxyConstructor() { return getProxyInformation().getProxyConstructor(); }
EJBProxyInformation<T> getProxyInformation() { final EJBProxyInformation<T> i = proxyInformation; return i != null ? i : (proxyInformation = EJBProxyInformation.forViewType(viewType)); }
boolean hasCompressionHint(Method proxyMethod) { final ProxyMethodInfo proxyMethodInfo = getProxyMethodInfo(proxyMethod); return proxyMethodInfo != null && proxyMethodInfo.compressionLevel != -1; }
/** * Get the proxy class constructor for this locator. A proxy class constructor accepts a single * argument of type {@link InvocationHandler}. * * @return the proxy constructor */ public Constructor<? extends T> getProxyConstructor() { return getProxyInformation().getProxyConstructor(); }
EJBProxyInformation<T> getProxyInformation() { final EJBProxyInformation<T> i = proxyInformation; return i != null ? i : (proxyInformation = EJBProxyInformation.forViewType(viewType)); }
static <T> EJBProxyInterceptorInformation<T> construct(Class<T> clazz, EJBClientContext clientContext) { final EJBProxyInformation<T> proxyInformation = EJBProxyInformation.forViewType(clazz); final Collection<EJBProxyInformation.ProxyMethodInfo> methods = proxyInformation.getMethods(); final String className = clazz.getName(); final InterceptorList list0 = EJBClientContext.defaultInterceptors; final InterceptorList list1 = clientContext.getGlobalInterceptors(); final InterceptorList list2 = clientContext.getClassPathInterceptors(); final InterceptorList list3 = clientContext.getConfiguredPerClassInterceptors().getOrDefault(className, EMPTY); final InterceptorList list5 = proxyInformation.getClassInterceptors(); final IdentityHashMap<Method, InterceptorList> interceptorsByMethod = new IdentityHashMap<>(methods.size()); final HashMap<InterceptorList, InterceptorList> cache = new HashMap<>(); cache.computeIfAbsent(list0, Function.identity()); final InterceptorList tailList = list3.combine(list2).combine(list1).combine(list0); cache.computeIfAbsent(tailList, Function.identity()); for (EJBProxyInformation.ProxyMethodInfo method : methods) { // compile interceptor information final InterceptorList list4 = clientContext.getConfiguredPerMethodInterceptors().getOrDefault(className, emptyMap()).getOrDefault(method.getMethodLocator(), EMPTY); final InterceptorList list6 = method.getInterceptors(); interceptorsByMethod.put(method.getMethod(), cache.computeIfAbsent(list6.combine(list5).combine(list4).combine(tailList), Function.identity())); } return new EJBProxyInterceptorInformation<T>(proxyInformation, interceptorsByMethod, cache.computeIfAbsent(list5.combine(tailList), Function.identity())); }
EJBProxyInformation.ProxyMethodInfo getProxyMethodInfo(EJBMethodLocator methodLocator) { return locatorRef.get().getProxyInformation().getProxyMethodInfo(methodLocator); }
/** * Get the proxy class constructor for this locator. A proxy class constructor accepts a single * argument of type {@link InvocationHandler}. * * @return the proxy constructor */ public Constructor<? extends T> getProxyConstructor() { return getProxyInformation().getProxyConstructor(); }
/** * Get the proxy class for this locator. * * @return the proxy class */ public Class<? extends T> getProxyClass() { return getProxyInformation().getProxyClass(); }
EJBProxyInformation<T> getProxyInformation() { final EJBProxyInformation<T> i = proxyInformation; return i != null ? i : (proxyInformation = EJBProxyInformation.forViewType(viewType)); }
throw new NoSuchMethodError("No valid constructor found on proxy class"); return new EJBProxyInformation<>(proxyClass, constructor, methodInfoMap, fallbackMap, methodLocatorMap, classCompressionLevel, classIdempotent, classAsync, classInterceptors);
static <T> EJBProxyInterceptorInformation<T> construct(Class<T> clazz, EJBClientContext clientContext) { final EJBProxyInformation<T> proxyInformation = EJBProxyInformation.forViewType(clazz); final Collection<EJBProxyInformation.ProxyMethodInfo> methods = proxyInformation.getMethods(); final String className = clazz.getName(); final InterceptorList list0 = EJBClientContext.defaultInterceptors; final InterceptorList list1 = clientContext.getGlobalInterceptors(); final InterceptorList list2 = clientContext.getClassPathInterceptors(); final InterceptorList list3 = clientContext.getConfiguredPerClassInterceptors().getOrDefault(className, EMPTY); final InterceptorList list5 = proxyInformation.getClassInterceptors(); final IdentityHashMap<Method, InterceptorList> interceptorsByMethod = new IdentityHashMap<>(methods.size()); final HashMap<InterceptorList, InterceptorList> cache = new HashMap<>(); cache.computeIfAbsent(list0, Function.identity()); final InterceptorList tailList = list3.combine(list2).combine(list1).combine(list0); cache.computeIfAbsent(tailList, Function.identity()); for (EJBProxyInformation.ProxyMethodInfo method : methods) { // compile interceptor information final InterceptorList list4 = clientContext.getConfiguredPerMethodInterceptors().getOrDefault(className, emptyMap()).getOrDefault(method.getMethodLocator(), EMPTY); final InterceptorList list6 = method.getInterceptors(); interceptorsByMethod.put(method.getMethod(), cache.computeIfAbsent(list6.combine(list5).combine(list4).combine(tailList), Function.identity())); } return new EJBProxyInterceptorInformation<T>(proxyInformation, interceptorsByMethod, cache.computeIfAbsent(list5.combine(tailList), Function.identity())); }
public Object invoke(final Object rawProxy, final Method method, final Object... args) throws Exception { final T proxy = locatorRef.get().getViewType().cast(rawProxy); final EJBProxyInformation.ProxyMethodInfo methodInfo = locatorRef.get().getProxyInformation().getProxyMethodInfo(method); return invoke(proxy, methodInfo, args); }
/** * Get the proxy class for this locator. * * @return the proxy class */ public Class<? extends T> getProxyClass() { return getProxyInformation().getProxyClass(); }
throw new NoSuchMethodError("No valid constructor found on proxy class"); return new EJBProxyInformation<>(proxyClass, constructor, methodInfoMap, fallbackMap, methodLocatorMap, classCompressionLevel, classIdempotent, classAsync, classInterceptors);
boolean isIdempotent(Method proxyMethod) { final ProxyMethodInfo proxyMethodInfo = getProxyMethodInfo(proxyMethod); return proxyMethodInfo != null && (classIdempotent || proxyMethodInfo.idempotent); }