public void handleInvocation(final EJBClientInvocationContext context) throws Exception { context.sendRequest(); }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, true); try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); context.removeAttachment(APPLICATION); throw e; } } else { context.sendRequest(); } }
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 { final NamingProvider namingProvider = context.getProxyAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider != null) { // make sure the naming provider is available to invocations context.putAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY, namingProvider); } if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { context.putAttachment(SKIP_MISSING_TARGET, Boolean.TRUE); context.sendRequest(); } else { if (setDestination(context, namingProvider)) try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { final ClientTransactionPolicy transactionPolicy = context.getTransactionPolicy(); AbstractTransaction transaction = context.getTransaction(); // Always prefer the context TX, as the caller TX might be wrong // (e.g. retries happen in worker thread, not caller thread) if (transaction == null) { transaction = transactionManager.getTransaction(); } setupStickinessIfRequired(context, transactionPolicy.propagate(), transaction); if (transactionPolicy.failIfTransactionAbsent()) { if (transaction == null) { throw Logs.TXN.txNotActiveForThread(); } } if (transactionPolicy.failIfTransactionPresent()) { if (transaction != null) { throw Logs.TXN.txAlreadyAssociatedWithThread(); } } if (transactionPolicy.propagate()) { context.setTransaction(transaction); } // Hide any caller TX from other interceptors Transaction old = transactionManager.suspend(); try { context.sendRequest(); } finally { transactionManager.resume(old); } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { context.sendRequest(); }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { context.sendRequest(); }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, true); try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); context.removeAttachment(APPLICATION); throw e; } } else { context.sendRequest(); } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { ConcurrentMap<Application, URI> applications = context.getAttachment(APPLICATIONS); if (applications != null) { URI destination = context.getDestination(); Application registered = updateOrFollowApplication(context, applications, true); try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { if (registered != null) { // Clear sticky association only if this path registered it applications.remove(registered, destination); } context.removeAttachment(APPLICATIONS); context.removeAttachment(PREFERRED_DESTINATIONS); context.removeAttachment(APPLICATION); throw e; } } else { context.sendRequest(); } }
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 void handleInvocation(final EJBClientInvocationContext context) throws Exception { final NamingProvider namingProvider = context.getProxyAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider != null) { // make sure the naming provider is available to invocations context.putAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY, namingProvider); } if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { context.putAttachment(SKIP_MISSING_TARGET, Boolean.TRUE); context.sendRequest(); } else { if (setDestination(context, namingProvider)) try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { final NamingProvider namingProvider = context.getProxyAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider != null) { // make sure the naming provider is available to invocations context.putAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY, namingProvider); } if (namingProvider == null || context.getDestination() != null || context.getLocator().getAffinity() != Affinity.NONE) { context.putAttachment(SKIP_MISSING_TARGET, Boolean.TRUE); context.sendRequest(); } else { if (setDestination(context, namingProvider)) try { context.sendRequest(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } else { throw Logs.INVOCATION.noMoreDestinations(); } } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { final ClientTransactionPolicy transactionPolicy = context.getTransactionPolicy(); AbstractTransaction transaction = context.getTransaction(); // Always prefer the context TX, as the caller TX might be wrong // (e.g. retries happen in worker thread, not caller thread) if (transaction == null) { transaction = transactionManager.getTransaction(); } setupStickinessIfRequired(context, transactionPolicy.propagate(), transaction); if (transactionPolicy.failIfTransactionAbsent()) { if (transaction == null) { throw Logs.TXN.txNotActiveForThread(); } } if (transactionPolicy.failIfTransactionPresent()) { if (transaction != null) { throw Logs.TXN.txAlreadyAssociatedWithThread(); } } if (transactionPolicy.propagate()) { context.setTransaction(transaction); } // Hide any caller TX from other interceptors Transaction old = transactionManager.suspend(); try { context.sendRequest(); } finally { transactionManager.resume(old); } }
public void handleInvocation(final EJBClientInvocationContext context) throws Exception { final ClientTransactionPolicy transactionPolicy = context.getTransactionPolicy(); AbstractTransaction transaction = context.getTransaction(); // Always prefer the context TX, as the caller TX might be wrong // (e.g. retries happen in worker thread, not caller thread) if (transaction == null) { transaction = transactionManager.getTransaction(); } setupStickinessIfRequired(context, transactionPolicy.propagate(), transaction); if (transactionPolicy.failIfTransactionAbsent()) { if (transaction == null) { throw Logs.TXN.txNotActiveForThread(); } } if (transactionPolicy.failIfTransactionPresent()) { if (transaction != null) { throw Logs.TXN.txAlreadyAssociatedWithThread(); } } if (transactionPolicy.propagate()) { context.setTransaction(transaction); } // Hide any caller TX from other interceptors Transaction old = transactionManager.suspend(); try { context.sendRequest(); } finally { transactionManager.resume(old); } }