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)); }
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)); }