final int methodType = getMethodType(type, methodName, methodParamTypes); final EJBMethodLocator methodLocator = new EJBMethodLocator(methodName, parameterTypeNames); final ProxyMethodInfo proxyMethodInfo = new ProxyMethodInfo(methodType, compressionLevel, compressRequest, compressResponse, idempotent, transactionPolicy, method, methodLocator, b.toString(), clientAsync, interceptors); methodInfoMap.put(method, proxyMethodInfo); fallbackMap.put(method, proxyMethodInfo);
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())); }
Object invoke(final Object proxy, final EJBProxyInformation.ProxyMethodInfo methodInfo, final Object... args) throws Exception { final Method method = methodInfo.getMethod(); switch (methodInfo.getMethodType()) { case EJBProxyInformation.MT_EQUALS: case EJBProxyInformation.MT_IS_IDENTICAL: { assert methodInfo.getMethodType() == EJBProxyInformation.MT_BUSINESS; final EJBClientContext clientContext = EJBClientContext.getCurrent(); if (! async && ! methodInfo.isClientAsync()) {
Object invoke(final Object proxy, final EJBProxyInformation.ProxyMethodInfo methodInfo, final Object... args) throws Exception { final Method method = methodInfo.getMethod(); switch (methodInfo.getMethodType()) { case EJBProxyInformation.MT_EQUALS: case EJBProxyInformation.MT_IS_IDENTICAL: { assert methodInfo.getMethodType() == EJBProxyInformation.MT_BUSINESS; final EJBClientContext clientContext = EJBClientContext.getCurrent(); if (! async && ! methodInfo.isClientAsync()) {
final int methodType = getMethodType(type, methodName, methodParamTypes); final EJBMethodLocator methodLocator = new EJBMethodLocator(methodName, parameterTypeNames); final ProxyMethodInfo proxyMethodInfo = new ProxyMethodInfo(methodType, compressionLevel, compressRequest, compressResponse, idempotent, transactionPolicy, method, methodLocator, b.toString(), clientAsync, interceptors); methodInfoMap.put(method, proxyMethodInfo); fallbackMap.put(method, proxyMethodInfo);
final int methodType = getMethodType(type, methodName, methodParamTypes); final EJBMethodLocator methodLocator = new EJBMethodLocator(methodName, parameterTypeNames); final ProxyMethodInfo proxyMethodInfo = new ProxyMethodInfo(methodType, compressionLevel, compressRequest, compressResponse, idempotent, transactionPolicy, method, methodLocator, b.toString(), clientAsync, interceptors); methodInfoMap.put(method, proxyMethodInfo); fallbackMap.put(method, proxyMethodInfo);
Object invoke(final Object proxy, final EJBProxyInformation.ProxyMethodInfo methodInfo, final Object... args) throws Exception { final Method method = methodInfo.getMethod(); switch (methodInfo.getMethodType()) { case EJBProxyInformation.MT_EQUALS: case EJBProxyInformation.MT_IS_IDENTICAL: { assert methodInfo.getMethodType() == EJBProxyInformation.MT_BUSINESS; final EJBClientContext clientContext = EJBClientContext.getCurrent(); if (! async && ! methodInfo.isClientAsync()) {
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())); }
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())); }
/** * Determine whether the request is expected to be compressed. * * @return {@code true} if the request is expected to be compressed, {@code false} otherwise */ public boolean isCompressRequest() { return methodInfo.isCompressRequest(); }
/** * Get the EJB method locator. * * @return the EJB method locator */ public EJBMethodLocator getMethodLocator() { return methodInfo.getMethodLocator(); }
/** * Determine whether the method is marked client-asynchronous, meaning that invocation should be asynchronous regardless * of whether the server-side method is asynchronous. * * @return {@code true} if the method is marked client-asynchronous, {@code false} otherwise */ public boolean isClientAsync() { return invocationHandler.isAsyncHandler() || methodInfo.isClientAsync(); }
/** * Determine whether the method has an explicit transaction policy set. * * @return the transaction policy, if any, or {@code null} if none was explicitly set */ public ClientTransactionPolicy getTransactionPolicy() { return methodInfo.getTransactionPolicy(); }
/** * Get the compression hint level. If no compression hint is given, -1 is returned. * * @return the compression hint level, or -1 for no compression hint */ public int getCompressionLevel() { return methodInfo.getCompressionLevel(); }
/** * Determine whether the request is expected to be compressed. * * @return {@code true} if the request is expected to be compressed, {@code false} otherwise */ public boolean isCompressRequest() { return methodInfo.isCompressRequest(); }
/** * Get the invoked proxy method. * * @return the invoked method */ public Method getInvokedMethod() { return methodInfo.getMethod(); }
/** * Get the method type signature string, used to identify the method. * * @return the method signature string */ public String getMethodSignatureString() { return methodInfo.getSignature(); }
/** * Determine whether the method is marked client-asynchronous, meaning that invocation should be asynchronous regardless * of whether the server-side method is asynchronous. * * @return {@code true} if the method is marked client-asynchronous, {@code false} otherwise */ public boolean isClientAsync() { return invocationHandler.isAsyncHandler() || methodInfo.isClientAsync(); }
/** * Get the compression hint level. If no compression hint is given, -1 is returned. * * @return the compression hint level, or -1 for no compression hint */ public int getCompressionLevel() { return methodInfo.getCompressionLevel(); }
/** * Get the method type signature string, used to identify the method. * * @return the method signature string */ public String getMethodSignatureString() { return methodInfo.getSignature(); }