Refine search
/** * Indicates whether the stack is empty. */ public static boolean empty() { return empty(interceptionContexts.get()); }
/** * This is called by client proxies. Calling a method on a client proxy means that we left the interception context of the calling bean. Therefore, * client proxies call this method to start a new interception context of the called (possibly intercepted) bean. If however there is not interception context * at the time the proxy is called (meaning the caller is not intercepted), there is no need to create new interception context. This is an optimization as the * first startInterceptorContext call is expensive. * * If this method returns a non-null value, the caller of this method is required to call {@link Stack#end()} on the returned value. */ public static Stack startIfNotEmpty() { Stack stack = getStack(); if (!stack.elements.isEmpty()) { stack.push(CombinedInterceptorAndDecoratorStackMethodHandler.NULL_INSTANCE); return stack; } else { // if RequestScopedCache is not active, remove now to prevent ThreadLocal leak stack.removeIfEmpty(); return null; } }
/** * Peeks the current top of the stack. * @return the current top of the stack * @throws EmptyStackException */ public static CombinedInterceptorAndDecoratorStackMethodHandler peek() { return peek(interceptionContexts.get()); }
private static CombinedInterceptorAndDecoratorStackMethodHandler pop(Stack stack) { if (stack == null) { throw new EmptyStackException(); } else { return stack.pop(); } }
@Override public Object proceed() throws Exception { final Stack stack = InterceptionDecorationContext.startIfNotOnTop(currentHandler); try { return proceedInternal(); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } finally { if (stack != null) { stack.end(); } } }
public boolean isDisabledHandler() { return this == InterceptionDecorationContext.peekIfNotEmpty(); }
@Override public Object invoke(Object o, Method method, Object[] objects) throws Throwable { startInterceptionDecorationContext(); try { return method.invoke(testBean1, objects); } catch (Throwable thw) { if (thw instanceof InvocationTargetException) { throw thw.getCause(); } else { throw thw; } } finally { InterceptionDecorationContext.endInterceptorContext(); } } });
private static CombinedInterceptorAndDecoratorStackMethodHandler pop(Stack stack) { if (stack == null) { throw new EmptyStackException(); } else { return stack.pop(); } }
@Override public Object proceed() throws Exception { final Stack stack = InterceptionDecorationContext.startIfNotOnTop(currentHandler); try { return proceedInternal(); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } finally { if (stack != null) { stack.end(); } } }
public boolean isDisabledHandler() { return this == InterceptionDecorationContext.peekIfNotEmpty(); }
/** * This is called by client proxies. Calling a method on a client proxy means that we left the interception context of the calling bean. Therefore, * client proxies call this method to start a new interception context of the called (possibly intercepted) bean. If however there is not interception context * at the time the proxy is called (meaning the caller is not intercepted), there is no need to create new interception context. This is an optimization as the * first startInterceptorContext call is expensive. * * If this method returns a non-null value, the caller of this method is required to call {@link Stack#end()} on the returned value. */ public static Stack startIfNotEmpty() { Stack stack = getStack(); if (!stack.elements.isEmpty()) { stack.push(CombinedInterceptorAndDecoratorStackMethodHandler.NULL_INSTANCE); return stack; } else { // if RequestScopedCache is not active, remove now to prevent ThreadLocal leak stack.removeIfEmpty(); return null; } }
private static CombinedInterceptorAndDecoratorStackMethodHandler pop(Stack stack) { if (stack == null) { throw new EmptyStackException(); } else { return stack.pop(); } }
@Override public Object proceed() throws Exception { final Stack stack = InterceptionDecorationContext.startIfNotOnTop(currentHandler); try { return proceedInternal(); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } finally { if (stack != null) { stack.end(); } } }
/** * Peeks the current top of the stack. * @return the current top of the stack * @throws EmptyStackException */ public static CombinedInterceptorAndDecoratorStackMethodHandler peek() { return peek(interceptionContexts.get()); }
/** * Indicates whether the stack is empty. */ public static boolean empty() { return empty(interceptionContexts.get()); }
public boolean isDisabledHandler() { return this == InterceptionDecorationContext.peekIfNotEmpty(); }
/** * This is called by client proxies. Calling a method on a client proxy means that we left the interception context of the calling bean. Therefore, * client proxies call this method to start a new interception context of the called (possibly intercepted) bean. If however there is not interception context * at the time the proxy is called (meaning the caller is not intercepted), there is no need to create new interception context. This is an optimization as the * first startInterceptorContext call is expensive. * * If this method returns a non-null value, the caller of this method is required to call {@link Stack#end()} on the returned value. */ public static Stack startIfNotEmpty() { Stack stack = getStack(); if (!stack.elements.isEmpty()) { stack.push(CombinedInterceptorAndDecoratorStackMethodHandler.NULL_INSTANCE); return stack; } else { // if RequestScopedCache is not active, remove now to prevent ThreadLocal leak stack.removeIfEmpty(); return null; } }
private static CombinedInterceptorAndDecoratorStackMethodHandler pop(Stack stack) { if (stack == null) { throw new EmptyStackException(); } else { return stack.pop(); } }
@Override public Object proceed() throws Exception { final Stack stack = InterceptionDecorationContext.startIfNotOnTop(currentHandler); try { return proceedInternal(); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } finally { if (stack != null) { stack.end(); } } }
/** * Peeks the current top of the stack. * @return the current top of the stack * @throws EmptyStackException */ public static CombinedInterceptorAndDecoratorStackMethodHandler peek() { return peek(interceptionContexts.get()); }