public T getInstance() { if (!Container.isSet(contextId)) { throw ContextLogger.LOG.contextualReferenceNotValidAfterShutdown(bean, contextId); } T existingInstance = ContextualInstance.getIfExists(bean, manager); if (existingInstance != null) { return existingInstance; } WeldCreationalContext<T> creationalContext; WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get(); if (previousCreationalContext == null) { creationalContext = new CreationalContextImpl<T>(bean); } else { creationalContext = previousCreationalContext.getCreationalContext(bean); } currentCreationalContext.set(creationalContext); // Ensure that there is no injection point associated final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE); try { return ContextualInstance.get(bean, manager, creationalContext); } finally { stack.pop(); if (previousCreationalContext == null) { currentCreationalContext.remove(); } else { currentCreationalContext.set(previousCreationalContext); } } }
public T getInstance() { if (!Container.isSet(contextId)) { throw ContextLogger.LOG.contextualReferenceNotValidAfterShutdown(bean, contextId); } T existingInstance = ContextualInstance.getIfExists(bean, manager); if (existingInstance != null) { return existingInstance; } WeldCreationalContext<T> creationalContext; WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get(); if (previousCreationalContext == null) { creationalContext = new CreationalContextImpl<T>(bean); } else { creationalContext = previousCreationalContext.getCreationalContext(bean); } currentCreationalContext.set(creationalContext); // Ensure that there is no injection point associated final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE); try { return ContextualInstance.get(bean, manager, creationalContext); } finally { stack.pop(); if (previousCreationalContext == null) { currentCreationalContext.remove(); } else { currentCreationalContext.set(previousCreationalContext); } } }
public T getInstance() { if (!Container.isSet(contextId)) { throw ContextLogger.LOG.contextualReferenceNotValidAfterShutdown(bean, contextId); } T existingInstance = ContextualInstance.getIfExists(bean, manager); if (existingInstance != null) { return existingInstance; } WeldCreationalContext<T> creationalContext; WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get(); if (previousCreationalContext == null) { creationalContext = new CreationalContextImpl<T>(bean); } else { creationalContext = previousCreationalContext.getCreationalContext(bean); } currentCreationalContext.set(creationalContext); // Ensure that there is no injection point associated final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE); try { return ContextualInstance.get(bean, manager, creationalContext); } finally { stack.pop(); if (previousCreationalContext == null) { currentCreationalContext.remove(); } else { currentCreationalContext.set(previousCreationalContext); } } }
public T getInstance() { if (!Container.isSet(contextId)) { throw ContextLogger.LOG.contextualReferenceNotValidAfterShutdown(bean, contextId); } T existingInstance = ContextualInstance.getIfExists(bean, manager); if (existingInstance != null) { return existingInstance; } WeldCreationalContext<T> creationalContext; WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get(); if (previousCreationalContext == null) { creationalContext = new CreationalContextImpl<T>(bean); } else { creationalContext = previousCreationalContext.getCreationalContext(bean); } currentCreationalContext.set(creationalContext); // Ensure that there is no injection point associated final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE); try { return ContextualInstance.get(bean, manager, creationalContext); } finally { stack.pop(); if (previousCreationalContext == null) { currentCreationalContext.remove(); } else { currentCreationalContext.set(previousCreationalContext); } } }
public T getInstance() { if (!Container.isSet(contextId)) { throw ContextLogger.LOG.contextualReferenceNotValidAfterShutdown(bean, contextId); } T existingInstance = ContextualInstance.getIfExists(bean, manager); if (existingInstance != null) { return existingInstance; } WeldCreationalContext<T> creationalContext; WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get(); if (previousCreationalContext == null) { creationalContext = new CreationalContextImpl<T>(bean); } else { creationalContext = previousCreationalContext.getCreationalContext(bean); } currentCreationalContext.set(creationalContext); // Ensure that there is no injection point associated final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE); try { return ContextualInstance.get(bean, manager, creationalContext); } finally { stack.pop(); if (previousCreationalContext == null) { currentCreationalContext.remove(); } else { currentCreationalContext.set(previousCreationalContext); } } }