Refine search
private static <T> void destroy(ContextualInstance<T> beanInstance) { beanInstance.getContextual().destroy(beanInstance.getInstance(), beanInstance.getCreationalContext()); }
throw ContextLogger.LOG.contextualIsNull(); return beanInstance.getInstance(); } else if (creationalContext != null) { LockedBean lock = null; beanInstance = beanStore.get(id); if (beanInstance != null) { return beanInstance.getInstance(); T instance = contextual.create(creationalContext); if (instance != null) { beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
public void release(Contextual<T> contextual, T instance) { synchronized (dependentInstances) { for (ContextualInstance<?> dependentInstance : dependentInstances) { // do not destroy contextual again, since it's just being destroyed if (contextual == null || !(dependentInstance.getContextual().equals(contextual))) { destroy(dependentInstance); } } } if (resourceReferences != null) { for (ResourceReference<?> reference : resourceReferences) { reference.release(); } } }
@Override public <T> void put(BeanIdentifier id, ContextualInstance<T> instance) { beanStore.put(id, instance); // moved due to WELD-892 if (isAttached()) { setAttribute(namingScheme.prefix(id), instance); } ContextLogger.LOG.contextualInstanceAdded(instance.getContextual(), id, this); }
/** * Destroys dependent instance * * @param instance * @return true if the instance was destroyed, false otherwise */ public boolean destroyDependentInstance(T instance) { synchronized (dependentInstances) { for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) { ContextualInstance<?> contextualInstance = iterator.next(); if (contextualInstance.getInstance() == instance) { iterator.remove(); destroy(contextualInstance); return true; } } } return false; }
throw ContextLogger.LOG.contextualIsNull(); return beanInstance.getInstance(); } else if (creationalContext != null) { LockedBean lock = null; beanInstance = beanStore.get(id); if (beanInstance != null) { return beanInstance.getInstance(); T instance = contextual.create(creationalContext); if (instance != null) { beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
public void release(Contextual<T> contextual, T instance) { synchronized (dependentInstances) { for (ContextualInstance<?> dependentInstance : dependentInstances) { // do not destroy contextual again, since it's just being destroyed if (contextual == null || !(dependentInstance.getContextual().equals(contextual))) { destroy(dependentInstance); } } } if (resourceReferences != null) { for (ResourceReference<?> reference : resourceReferences) { reference.release(); } } }
@Override public <T> void put(BeanIdentifier id, ContextualInstance<T> instance) { beanStore.put(id, instance); // moved due to WELD-892 if (isAttached()) { setAttribute(namingScheme.prefix(id), instance); } ContextLogger.LOG.contextualInstanceAdded(instance.getContextual(), id, this); }
/** * Destroys dependent instance * * @param instance * @return true if the instance was destroyed, false otherwise */ public boolean destroyDependentInstance(T instance) { synchronized (dependentInstances) { for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) { ContextualInstance<?> contextualInstance = iterator.next(); if (contextualInstance.getInstance() == instance) { iterator.remove(); destroy(contextualInstance); return true; } } } return false; }
private static <T> void destroy(ContextualInstance<T> beanInstance) { beanInstance.getContextual().destroy(beanInstance.getInstance(), beanInstance.getCreationalContext()); }
throw ContextLogger.LOG.contextualIsNull(); return beanInstance.getInstance(); } else if (creationalContext != null) { LockedBean lock = null; beanInstance = beanStore.get(id); if (beanInstance != null) { return beanInstance.getInstance(); T instance = contextual.create(creationalContext); if (instance != null) { beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
public void release(Contextual<T> contextual, T instance) { synchronized (dependentInstances) { for (ContextualInstance<?> dependentInstance : dependentInstances) { // do not destroy contextual again, since it's just being destroyed if (contextual == null || !(dependentInstance.getContextual().equals(contextual))) { destroy(dependentInstance); } } } if (resourceReferences != null) { for (ResourceReference<?> reference : resourceReferences) { reference.release(); } } }
@Override public <T> void put(BeanIdentifier id, ContextualInstance<T> instance) { beanStore.put(id, instance); // moved due to WELD-892 if (isAttached()) { setAttribute(namingScheme.prefix(id), instance); } ContextLogger.LOG.contextualInstanceAdded(instance.getContextual(), id, this); }
/** * Destroys dependent instance * * @param instance * @return true if the instance was destroyed, false otherwise */ public boolean destroyDependentInstance(T instance) { synchronized (dependentInstances) { for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) { ContextualInstance<?> contextualInstance = iterator.next(); if (contextualInstance.getInstance() == instance) { iterator.remove(); destroy(contextualInstance); return true; } } } return false; }
private static <T> void destroy(ContextualInstance<T> beanInstance) { beanInstance.getContextual().destroy(beanInstance.getInstance(), beanInstance.getCreationalContext()); }
throw ContextLogger.LOG.contextualIsNull(); return beanInstance.getInstance(); } else if (creationalContext != null) { LockedBean lock = null; beanInstance = beanStore.get(id); if (beanInstance != null) { return beanInstance.getInstance(); T instance = contextual.create(creationalContext); if (instance != null) { beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
public void release(Contextual<T> contextual, T instance) { synchronized (dependentInstances) { for (ContextualInstance<?> dependentInstance : dependentInstances) { // do not destroy contextual again, since it's just being destroyed if (contextual == null || !(dependentInstance.getContextual().equals(contextual))) { destroy(dependentInstance); } } } if (resourceReferences != null) { for (ResourceReference<?> reference : resourceReferences) { reference.release(); } } }
@Override public <T> void put(BeanIdentifier id, ContextualInstance<T> instance) { beanStore.put(id, instance); // moved due to WELD-892 if (isAttached()) { setAttribute(namingScheme.prefix(id), instance); } ContextLogger.LOG.contextualInstanceAdded(instance.getContextual(), id, this); }
/** * Destroys dependent instance * * @param instance * @return true if the instance was destroyed, false otherwise */ public boolean destroyDependentInstance(T instance) { synchronized (dependentInstances) { for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) { ContextualInstance<?> contextualInstance = iterator.next(); if (contextualInstance.getInstance() == instance) { iterator.remove(); destroy(contextualInstance); return true; } } } return false; }
private <T> void destroyContextualInstance(ContextualInstance<T> instance) { instance.getContextual().destroy(instance.getInstance(), instance.getCreationalContext()); ContextLogger.LOG.contextualInstanceRemoved(instance, this); }