public void handleInvocation(final EJBClientInvocationContext context) throws Exception { if (context.getDestination() != null) { // already discovered! context.sendRequest(); return; } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } finally { if (problems != null) for (Throwable problem : problems) { context.addSuppressed(problem); } } }
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 Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { // set the weak affinity to the location of the session (in case it failed over) final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination)); } // if destination is null, then an interceptor set the location } } return result; }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { if (context.getDestination() != null) { // already discovered! context.sendRequest(); return; } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } finally { if (problems != null) for (Throwable problem : problems) { context.addSuppressed(problem); } } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { if (context.getDestination() != null) { // already discovered! context.sendRequest(); return; } List<Throwable> problems = executeDiscovery(context); if(WILDFLY_TESTSUITE_HACK && context.getDestination() == null) { Thread.sleep(2000); problems = executeDiscovery(context); } try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } finally { if (problems != null) for (Throwable problem : problems) { context.addSuppressed(problem); } } }
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 Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { // set the weak affinity to the location of the session (in case it failed over) final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination)); } // if destination is null, then an interceptor set the location } } return result; }
public Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { // set the weak affinity to the location of the session (in case it failed over) final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { context.setWeakAffinity(URIAffinity.forUri(destination)); } // if destination is null, then an interceptor set the location } } return result; }