public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { if (context.getDestination() != null) { // already discovered! return context.proceed(); } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } SessionID sessionID; try { sessionID = context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw withSuppressed(e, problems); } catch (Exception t) { throw withSuppressed(t, problems); } setupSessionAffinities(context); return sessionID; }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, false); try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } throw e; } finally { context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); } } return context.proceed(); }
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(); } } }
context.setLocator(locator.withNewAffinity(targetAffinity)); } else { final URI destination = context.getDestination(); if (destination != null) { context.setLocator(locator.withNewAffinity(URIAffinity.forUri(destination))); context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination));
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 AuthenticationContextConfigurationClient client = CLIENT;
/** * 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 { if (context.getDestination() != null) { // already discovered! return context.proceed(); } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } SessionID sessionID; try { sessionID = context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw withSuppressed(e, problems); } catch (Exception t) { throw withSuppressed(t, problems); } setupSessionAffinities(context); return sessionID; }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { if (context.getDestination() != null) { // already discovered! return context.proceed(); } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } SessionID sessionID; try { sessionID = context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw withSuppressed(e, problems); } catch (Exception t) { throw withSuppressed(t, problems); } setupSessionAffinities(context); return sessionID; }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, false); try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } throw e; } finally { context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); } } return context.proceed(); }
public SessionID handleSessionCreation(final EJBSessionCreationInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, false); try { return context.proceed(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } throw e; } finally { context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); } } return context.proceed(); }
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"); } }
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(); } } }
context.setLocator(locator.withNewAffinity(targetAffinity)); } else { final URI destination = context.getDestination(); if (destination != null) { context.setLocator(locator.withNewAffinity(URIAffinity.forUri(destination))); context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination));
context.setLocator(locator.withNewAffinity(targetAffinity)); } else { final URI destination = context.getDestination(); if (destination != null) { context.setLocator(locator.withNewAffinity(URIAffinity.forUri(destination))); context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination));
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 AuthenticationContextConfigurationClient client = CLIENT;
/** * 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 --; } }
/** * 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 --; } }