void setSessionID(final SessionID sessionID) { final AtomicReference<EJBLocator<T>> locatorRef = this.locatorRef; EJBLocator<T> oldVal, newVal; do { oldVal = locatorRef.get(); if (oldVal.isStateful()) { if (oldVal.asStateful().getSessionId().equals(sessionID)) { // harmless/idempotent return; } throw Logs.MAIN.ejbIsAlreadyStateful(); } newVal = oldVal.withSession(sessionID); } while (! locatorRef.compareAndSet(oldVal, newVal)); }
private void updateAffinities(InvocationRequest invocationRequest, Map<String, Object> attachments, EJBLocator<?> ejbLocator, ComponentView componentView) { Affinity legacyAffinity = null; Affinity weakAffinity = null; Affinity clusterAffinity = getClusterAffinity(); if (ejbLocator.isStateful() && componentView.getComponent() instanceof StatefulSessionComponent) { final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) componentView.getComponent(); weakAffinity = legacyAffinity = getWeakAffinity(statefulSessionComponent, ejbLocator.asStateful()); } else if (componentView.getComponent() instanceof StatelessSessionComponent) { // V3 and less used cluster affinity as a weak affinity for SLSBs legacyAffinity = clusterAffinity; } // Always use the cluster as the strong affinity, if there is one if (clusterAffinity != null) { invocationRequest.updateStrongAffinity(clusterAffinity); } if (weakAffinity != null && !weakAffinity.equals(Affinity.NONE)) { invocationRequest.updateWeakAffinity(weakAffinity); } if (legacyAffinity != null && !legacyAffinity.equals(Affinity.NONE)) { attachments.put(Affinity.WEAK_AFFINITY_CONTEXT_KEY, legacyAffinity); } }
interceptorContext.putPrivateData(SessionID.class, ejbLocator.asStateful().getSessionId());
interceptorContext.putPrivateData(SessionID.class, locator.asStateful().getSessionId()); } else if (locator instanceof EntityEJBLocator) { throw EjbLogger.ROOT_LOGGER.ejbNotFoundInDeployment(locator);
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));
void setSessionID(final SessionID sessionID) { final AtomicReference<EJBLocator<T>> locatorRef = this.locatorRef; EJBLocator<T> oldVal, newVal; do { oldVal = locatorRef.get(); if (oldVal.isStateful()) { if (oldVal.asStateful().getSessionId().equals(sessionID)) { // harmless/idempotent return; } throw Logs.MAIN.ejbIsAlreadyStateful(); } newVal = oldVal.withSession(sessionID); } while (! locatorRef.compareAndSet(oldVal, newVal)); }
void setSessionID(final SessionID sessionID) { final AtomicReference<EJBLocator<T>> locatorRef = this.locatorRef; EJBLocator<T> oldVal, newVal; do { oldVal = locatorRef.get(); if (oldVal.isStateful()) { if (oldVal.asStateful().getSessionId().equals(sessionID)) { // harmless/idempotent return; } throw Logs.MAIN.ejbIsAlreadyStateful(); } newVal = oldVal.withSession(sessionID); } while (! locatorRef.compareAndSet(oldVal, newVal)); }
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));