public boolean cancel(final boolean mayInterruptIfRunning) { final Object lock = EJBClientInvocationContext.this.lock; assert !holdsLock(lock); synchronized (lock) { if (state == State.DONE) { // cannot cancel now; also resultProducer is gone return pendingFailure == CANCELLED_PRODUCER; } else if (! state.isWaiting()) { // cannot cancel now return resultProducer == CANCELLED; } else { if (resultProducer == CANCELLED) { return true; } // at this point the task is running and we are allowed to interrupt it. So set // the cancel request flag and a fall out to send the request cancelRequested = true; } } final EJBReceiver receiver = getReceiver(); final boolean result = receiver != null && receiver.cancelInvocation(receiverInvocationContext, mayInterruptIfRunning); if (! result) { synchronized (lock) { if (resultProducer == CANCELLED || state == State.DONE && pendingFailure == CANCELLED_PRODUCER) { return true; } } } return result; }
/** * Proceed with the next interceptor in the chain, calling the resolved receiver in the end. * * @return the session ID (not {@code null}) * @throws Exception if the EJB session creation failed for some reason */ public SessionID proceed() throws Exception { final int idx = interceptorChainIndex++; try { final EJBClientInterceptorInformation[] chain = interceptorList.getInformation(); if (idx > chain.length) { throw Assert.unreachableCode(); } if (chain.length == idx) { final URI destination = getDestination(); final EJBReceiver receiver = getClientContext().resolveReceiver(destination, getLocator()); setReceiver(receiver); final SessionID sessionID = receiver.createSession(new EJBReceiverSessionCreationContext(this, authenticationContext)); if (sessionID == null) { throw Logs.INVOCATION.nullSessionID(receiver, getLocator().asStateless()); } retry = false; return sessionID; } else { return chain[idx].getInterceptorInstance().handleSessionCreation(this); } } finally { interceptorChainIndex --; } }
InetSocketAddress sourceAddress = receiver.getSourceAddress(new InetSocketAddress(uri.getHost(), uri.getPort())); InetAddress inetAddress; if (sourceAddress != null) {
if (transportProvider != null) { availableNodes.add(nodeName); if (transportProvider.isConnected(uri)) { connectedNodes.add(nodeName);
receiver.processInvocation(receiverInvocationContext); } catch (Throwable t) { synchronized (lock) {
if (transportProvider != null) { availableNodes.add(nodeName); if (transportProvider.isConnected(uri)) { connectedNodes.add(nodeName);
receiver.processInvocation(receiverInvocationContext); } catch (Throwable t) { synchronized (lock) {
public boolean cancel(final boolean mayInterruptIfRunning) { final Object lock = EJBClientInvocationContext.this.lock; assert !holdsLock(lock); synchronized (lock) { if (state == State.DONE) { // cannot cancel now; also resultProducer is gone return pendingFailure == CANCELLED_PRODUCER; } else if (! state.isWaiting()) { // cannot cancel now return resultProducer == CANCELLED; } else { if (resultProducer == CANCELLED) { return true; } // at this point the task is running and we are allowed to interrupt it. So set // the cancel request flag and a fall out to send the request cancelRequested = true; } } final EJBReceiver receiver = getReceiver(); final boolean result = receiver != null && receiver.cancelInvocation(receiverInvocationContext, mayInterruptIfRunning); if (! result) { synchronized (lock) { if (resultProducer == CANCELLED || state == State.DONE && pendingFailure == CANCELLED_PRODUCER) { return true; } } } return result; }
/** * Proceed with the next interceptor in the chain, calling the resolved receiver in the end. * * @return the session ID (not {@code null}) * @throws Exception if the EJB session creation failed for some reason */ public SessionID proceed() throws Exception { final int idx = interceptorChainIndex++; try { final EJBClientInterceptorInformation[] chain = interceptorList.getInformation(); if (idx > chain.length) { throw Assert.unreachableCode(); } if (chain.length == idx) { final URI destination = getDestination(); final EJBReceiver receiver = getClientContext().resolveReceiver(destination, getLocator()); setReceiver(receiver); final SessionID sessionID = receiver.createSession(new EJBReceiverSessionCreationContext(this, authenticationContext)); if (sessionID == null) { throw Logs.INVOCATION.nullSessionID(receiver, getLocator().asStateless()); } retry = false; return sessionID; } else { return chain[idx].getInterceptorInstance().handleSessionCreation(this); } } finally { interceptorChainIndex --; } }
InetSocketAddress sourceAddress = receiver.getSourceAddress(new InetSocketAddress(uri.getHost(), uri.getPort())); InetAddress inetAddress; if (sourceAddress != null) {
if (transportProvider != null) { availableNodes.add(nodeName); if (transportProvider.isConnected(uri)) { connectedNodes.add(nodeName);
receiver.processInvocation(receiverInvocationContext); } catch (Throwable t) { synchronized (lock) {
public boolean cancel(final boolean mayInterruptIfRunning) { final Object lock = EJBClientInvocationContext.this.lock; assert !holdsLock(lock); synchronized (lock) { if (state == State.DONE) { // cannot cancel now; also resultProducer is gone return pendingFailure == CANCELLED_PRODUCER; } else if (! state.isWaiting()) { // cannot cancel now return resultProducer == CANCELLED; } else { if (resultProducer == CANCELLED) { return true; } // at this point the task is running and we are allowed to interrupt it. So set // the cancel request flag and a fall out to send the request cancelRequested = true; } } final EJBReceiver receiver = getReceiver(); final boolean result = receiver != null && receiver.cancelInvocation(receiverInvocationContext, mayInterruptIfRunning); if (! result) { synchronized (lock) { if (resultProducer == CANCELLED || state == State.DONE && pendingFailure == CANCELLED_PRODUCER) { return true; } } } return result; }
/** * Proceed with the next interceptor in the chain, calling the resolved receiver in the end. * * @return the session ID (not {@code null}) * @throws Exception if the EJB session creation failed for some reason */ public SessionID proceed() throws Exception { final int idx = interceptorChainIndex++; try { final EJBClientInterceptorInformation[] chain = interceptorList.getInformation(); if (idx > chain.length) { throw Assert.unreachableCode(); } if (chain.length == idx) { final URI destination = getDestination(); final EJBReceiver receiver = getClientContext().resolveReceiver(destination, getLocator()); setReceiver(receiver); final SessionID sessionID = receiver.createSession(new EJBReceiverSessionCreationContext(this, authenticationContext)); if (sessionID == null) { throw Logs.INVOCATION.nullSessionID(receiver, getLocator().asStateless()); } retry = false; return sessionID; } else { return chain[idx].getInterceptorInstance().handleSessionCreation(this); } } finally { interceptorChainIndex --; } }
InetSocketAddress sourceAddress = receiver.getSourceAddress(new InetSocketAddress(uri.getHost(), uri.getPort())); InetAddress inetAddress; if (sourceAddress != null) {