private Stack(ThreadLocal<Stack> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<CombinedInterceptorAndDecoratorStackMethodHandler>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack<T>> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<T>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<CombinedInterceptorAndDecoratorStackMethodHandler>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<CombinedInterceptorAndDecoratorStackMethodHandler>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack<T>> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<T>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack<T>> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<T>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack<T>> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<T>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<CombinedInterceptorAndDecoratorStackMethodHandler>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<CombinedInterceptorAndDecoratorStackMethodHandler>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
private Stack(ThreadLocal<Stack<T>> interceptionContexts) { this.interceptionContexts = interceptionContexts; this.elements = new ArrayDeque<T>(); /* * Setting / removing of a thread-local is much more expensive compared to get. Therefore, * if RequestScopedCache is active we register the thread-local for removal at the end of the * request. This yields possitive results only if the number of intercepted invocations is large. * If it is not, the performance characteristics are similar to explicitly removing the thread-local * once the stack gets empty. */ this.removeWhenEmpty = !RequestScopedCache.addItemIfActive(this); this.valid = true; }
@Override T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.get(bean, manager, ctx); if (RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; } }
@Override T getIfExists(Bean<T> bean, BeanManagerImpl manager) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.getIfExists(bean, manager); if (cached != null && RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; }
@Override T getIfExists(Bean<T> bean, BeanManagerImpl manager) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.getIfExists(bean, manager); if (cached != null && RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; }
@Override T getIfExists(Bean<T> bean, BeanManagerImpl manager) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.getIfExists(bean, manager); if (cached != null && RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; }
@Override T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.get(bean, manager, ctx); if (RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; } }
@Override T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.get(bean, manager, ctx); if (RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; } }
@Override T getIfExists(Bean<T> bean, BeanManagerImpl manager) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.getIfExists(bean, manager); if (cached != null && RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; }
@Override T getIfExists(Bean<T> bean, BeanManagerImpl manager) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.getIfExists(bean, manager); if (cached != null && RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; }
@Override T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.get(bean, manager, ctx); if (RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; } }
@Override T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) { T cached = cache.get(); if (cached != null) { return cached; } cached = super.get(bean, manager, ctx); if (RequestScopedCache.addItemIfActive(cache)) { cache.set(cached); } return cached; } }