final Affinity affinity = context.getLocator().getAffinity();
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { final NamingProvider namingProvider = context.getAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { return context.proceed(); } else { if (setDestination(context, namingProvider)) try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
/** * 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 --; } }
protected SessionID createSession(final EJBReceiverSessionCreationContext receiverContext) throws Exception { final StatelessEJBLocator<?> statelessLocator = receiverContext.getClientInvocationContext().getLocator().asStateless(); final EjbDeploymentInformation ejbInfo = findBean(statelessLocator); final EJBComponent component = ejbInfo.getEjbComponent(); if (!(component instanceof StatefulSessionComponent)) { throw EjbLogger.ROOT_LOGGER.notStatefulSessionBean(statelessLocator.getAppName(), statelessLocator.getModuleName(), statelessLocator.getDistinctName(), statelessLocator.getBeanName()); } component.waitForComponentStart(); return ((StatefulSessionComponent) component).createSession(); }
protected SessionID createSession(final EJBReceiverSessionCreationContext receiverContext) throws Exception { final EJBLocator<?> locator = receiverContext.getClientInvocationContext().getLocator(); URI uri = receiverContext.getClientInvocationContext().getDestination(); final AuthenticationContext context = receiverContext.getAuthenticationContext();
final EJBLocator<?> locator = context.getLocator(); if (locator.getAffinity() == Affinity.NONE) {
final Affinity affinity = context.getLocator().getAffinity();
final Affinity affinity = context.getLocator().getAffinity();
/** * 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 --; } }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { final NamingProvider namingProvider = context.getAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { return context.proceed(); } else { if (setDestination(context, namingProvider)) try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
/** * 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 --; } }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { final NamingProvider namingProvider = context.getAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { return context.proceed(); } else { if (setDestination(context, namingProvider)) try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
protected SessionID createSession(final EJBReceiverSessionCreationContext receiverContext) throws Exception { final EJBLocator<?> locator = receiverContext.getClientInvocationContext().getLocator(); URI uri = receiverContext.getClientInvocationContext().getDestination(); final AuthenticationContext context = receiverContext.getAuthenticationContext();
protected SessionID createSession(final EJBReceiverSessionCreationContext receiverContext) throws Exception { final EJBLocator<?> locator = receiverContext.getClientInvocationContext().getLocator(); URI uri = receiverContext.getClientInvocationContext().getDestination(); final AuthenticationContext context = receiverContext.getAuthenticationContext();
final EJBLocator<?> locator = context.getLocator(); if (locator.getAffinity() == Affinity.NONE) {
final EJBLocator<?> locator = context.getLocator(); if (locator.getAffinity() == Affinity.NONE) {