/** * Creates a new invocation handler with supplier which provides a current injected value in proper scope. * * @param supplier provider of the value. */ private ThreadScopeBeanInstance(Supplier<T> supplier, Bean<T> bean, String contextId) { super(bean, new StringBeanIdentifier(((PassivationCapable) bean).getId()), contextId); this.supplier = supplier; }
public NormalScopedBeanInterceptorHandler(BeanManager beanManager, Bean<?> bean) { this.beanManager = beanManager; this.bean = bean; if (bean instanceof PassivationCapable) { beanPassivationId = ((PassivationCapable) bean).getId(); } }
/** * If the context is a passivating scope then we return * the passivationId of the Bean. Otherwise we use * the Bean directly. * @return the key to use in the context map */ public <T> Object getBeanKey(Contextual<T> bean) { return ((PassivationCapable) bean).getId(); }
public PassivationCapableThirdpartyBeanImpl(WebBeansContext webBeansContext, Bean<T> bean) { super(webBeansContext, bean); id = PassivationCapable.class.cast(bean).getId(); }
private DelegateBean(final Bean<T> delegate, final WebBeansContext wbc) { this.delegate = delegate; this.wbc = wbc; // ensure unique even if "shared" this.id = (PassivationCapable.class.isInstance(delegate) ? PassivationCapable.class.cast(delegate).getId() : delegate.toString()) + hashCode(); }
@Override public String getId() { return get().getId(); } }
@Override public String getId() { return get().getId(); } }
private <T> T get(FlowScopeMapHelper mapHelper, Contextual<T> contextual) { assertNotReleased(); if (!(contextual instanceof PassivationCapable)) { throw new IllegalArgumentException("FlowScoped bean " + contextual.toString() + " must be PassivationCapable, but is not."); } String passivationCapableId = ((PassivationCapable)contextual).getId(); return (T) mapHelper.getFlowScopedBeanMapForCurrentFlow().get(passivationCapableId); }
@Override public String getId() { return get().getId(); } }
public String getId() { if (delegate instanceof PassivationCapable) { return DefaultBean.class.getName() + "-" + ((PassivationCapable) delegate).getId(); } return DefaultBean.class.getName() + "-" + types.toString() + "-QUALIFIERS-" + delegate.getQualifiers().toString(); }
@Override public String getId() { return get().getId(); } }
@Override public String getId() { return get().getId(); } }
@Override public String getId() { return get().getId(); } }
@Override public String getId() { return get().getId(); } }
@Override public String getId() { return get().getId(); } }
public ProxyMethodHandler(String contextId, BeanInstance beanInstance, Bean<?> bean) { this.beanInstance = beanInstance; this.bean = bean; this.contextId = contextId; if (bean instanceof CommonBean<?>) { this.beanId = ((CommonBean<?>) bean).getIdentifier(); } else if (bean instanceof PassivationCapable) { this.beanId = new StringBeanIdentifier(((PassivationCapable) bean).getId()); } else { this.beanId = null; } }
public ProxyMethodHandler(String contextId, BeanInstance beanInstance, Bean<?> bean) { this.beanInstance = beanInstance; this.bean = bean; this.contextId = contextId; if (bean instanceof CommonBean<?>) { this.beanId = ((CommonBean<?>) bean).getIdentifier(); } else if (bean instanceof PassivationCapable) { this.beanId = new StringBeanIdentifier(((PassivationCapable) bean).getId()); } else { this.beanId = null; } }
public ProxyMethodHandler(String contextId, BeanInstance beanInstance, Bean<?> bean) { this.beanInstance = beanInstance; this.bean = bean; this.contextId = contextId; if (bean instanceof CommonBean<?>) { this.beanId = ((CommonBean<?>) bean).getIdentifier(); } else if (bean instanceof PassivationCapable) { this.beanId = new StringBeanIdentifier(((PassivationCapable) bean).getId()); } else { this.beanId = null; } }
public ProxyMethodHandler(String contextId, BeanInstance beanInstance, Bean<?> bean) { this.beanInstance = beanInstance; this.bean = bean; this.contextId = contextId; if (bean instanceof CommonBean<?>) { this.beanId = ((CommonBean<?>) bean).getIdentifier(); } else if (bean instanceof PassivationCapable) { this.beanId = new StringBeanIdentifier(((PassivationCapable) bean).getId()); } else { this.beanId = null; } }
public TransactionBeanEntry(Contextual<T> bean, T contextualInstance, CreationalContext<T> creationalContext) { if (bean instanceof PassivationCapable && !(bean instanceof Bean)) { bean = (Contextual<T>) BeanManagerProvider.getInstance().getBeanManager() .getPassivationCapableBean(((PassivationCapable) bean).getId()); } this.bean = bean; this.contextualInstance = contextualInstance; this.creationalContext = creationalContext; }