<T, U> void addListener(AtomicReference<State> stateRef, BiConsumer<T, U> consumer, T p1, U p2) { Logs.REMOTING.tracef("Running callback %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } }
void activated() { try { Logs.REMOTING.tracef("Running callback (delayed) %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } finally { next.activated(); } } }
<T, U> void addListener(final AtomicReference<State> stateRef, final BiConsumer<T, U> consumer, final T p1, final U p2) { if (! stateRef.compareAndSet(this, new UnfinishedWithListenerState<T, U>(this,consumer, p1, p2))) { stateRef.get().addListener(stateRef, consumer, p1, p2); } Logs.REMOTING.tracef("Added callback (delayed) %s(%s, %s)", consumer, p1, p2); } }
private static void disassociateRemoteTxIfPossible(AbstractInvocationContext context) { AbstractTransaction transaction = context.getTransaction(); if (transaction instanceof RemoteTransaction) { RemoteTransaction remote = (RemoteTransaction) transaction; if (!remote.tryClearLocation()) { Logs.TXN.tracef("Could not disassociate remote transaction (already in-use or completed) from %s", remote.getLocation()); } } }
if (log.isTraceEnabled()) { StackTraceElement caller = (new Exception()).getStackTrace()[1]; log.tracef("Transitioning %s from %s to %s (%s)", this, oldState, newState, caller);
static boolean addBlackListedDestination(AbstractInvocationContext context, URI destination) { Assert.checkNotNullParam("context", context); if (destination != null) { Set<URI> set = context.getAttachment(BL_KEY); if (set == null) { final Set<URI> appearing = context.putAttachmentIfAbsent(BL_KEY, set = new HashSet<>()); if (appearing != null) { set = appearing; } } Logs.INVOCATION.tracef("Blacklisting destination (locator = %s, weak affinity = %s, missing target = %s)", context.getLocator(), context.getWeakAffinity(), destination); return set.add(destination); } else { return false; } }
private List<Throwable> doAnyDiscovery(AbstractInvocationContext context, final FilterSpec filterSpec, final EJBLocator<?> locator) { Logs.INVOCATION.tracef("Performing any discovery(locator = %s, weak affinity = %s, filter spec = %s)", context.getLocator(), context.getWeakAffinity(), filterSpec); final List<Throwable> problems; Logs.INVOCATION.tracef("Performed any discovery, no match"); return problems; location = entry.getKey(); nodeName = entry.getValue(); Logs.INVOCATION.tracef("Performed first-match discovery(target affinity(node) = %s, destination = %s)", nodeName, location); } else if (nodeless == 0) { throw Logs.INVOCATION.selectorReturnedUnknownNode(selector, nodeName); Logs.INVOCATION.tracef("Performed first-match discovery, nodes > 1, deployment selector used(target affinity(node) = %s, destination = %s)", nodeName, location); } else { throw Logs.INVOCATION.selectorReturnedUnknownNode(selector, location.toString()); Logs.INVOCATION.tracef("Performed first-match discovery, nodes > 1, URI selector used(target affinity(node) = %s, destination = %s)", nodeName, location);
private List<Throwable> doClusterDiscovery(AbstractInvocationContext context, final FilterSpec filterSpec) { Logs.INVOCATION.tracef("Performing cluster discovery(locator = %s, weak affinity = %s, filter spec = %s)", context.getLocator(), context.getWeakAffinity(), filterSpec); Map<String, URI> nodes = new HashMap<>(); final EJBClientContext clientContext = context.getClientContext(); Logs.INVOCATION.tracef("Performed cluster discovery, nodes is empty; trying an initial "); context.setDestination(uri); Logs.INVOCATION.tracef("Performed cluster discovery (target affinity = %s, destination = %s)", context.getTargetAffinity(), context.getDestination()); Logs.INVOCATION.tracef("Performing cluster discovery (connected nodes = %s, available nodes = %s)", connectedNodes, availableNodes); context.setTargetAffinity(new NodeAffinity(selectedNode)); Logs.INVOCATION.tracef("Performed cluster discovery (target affinity = %s, destination = %s)", context.getTargetAffinity(), context.getDestination());
final URI uri = connection.getDestination(); if (failedDestinations.contains(uri)) { Logs.INVOCATION.tracef("EJB discovery provider: attempting to connect to configured connection %s, skipping because marked as failed", uri); continue; Logs.INVOCATION.tracef("EJB discovery provider: attempting to connect to configured connection %s", uri); discoveryAttempt.connectAndDiscover(uri, null); if (! failedDestinations.contains(uri)) { maxConnections--; Logs.INVOCATION.tracef("EJB discovery provider: attempting to connect to cluster %s connection %s", clusterName, uri); discoveryAttempt.connectAndDiscover(uri, clusterName); ok = true; Logs.INVOCATION.tracef("EJB discovery provider: all connections marked failed, retrying ..."); for (EJBClientConnection connection : configuredConnections) { if (! connection.isForDiscovery()) { Logs.INVOCATION.tracef("EJB discovery provider: attempting to connect to connection %s", destination); discoveryAttempt.connectAndDiscover(destination, null);
void failed(Exception exception, Executor retryExecutor) { final Object lock = this.lock; synchronized (lock) { log.tracef("Invocation marked failed, state is currently: %s", state); switch (state) { case CONSUMING:
private List<Throwable> doFirstMatchDiscovery(AbstractInvocationContext context, final FilterSpec filterSpec, final FilterSpec fallbackFilterSpec) { Logs.INVOCATION.tracef("Performing first-match discovery(locator = %s, weak affinity = %s, filter spec = %s)", context.getLocator(), context.getWeakAffinity(), filterSpec); final List<Throwable> problems; final Set<URI> set = context.getAttachment(BL_KEY); Logs.INVOCATION.tracef("Performed first-match discovery(target affinity = %s, destination = %s)", context.getTargetAffinity(), context.getDestination()); return queue.getProblems(); Logs.INVOCATION.tracef("Performed first-match discovery, no match, falling back to cluster discovery"); return merge(problems, doClusterDiscovery(context, fallbackFilterSpec)); } else { Logs.INVOCATION.tracef("Performed first-match discovery, no match");
checkStateInvariants(); } else { log.tracef("Will not retry (requested = %s, remaining = %d)", retryRequested, remainingRetries); pendingFailure = () -> t; if (suppressedExceptions != null) {
final Affinity weakAffinity = context.getWeakAffinity(); Logs.INVOCATION.tracef("Calling executeDiscovery(locator = %s, weak affinity = %s)", locator, weakAffinity);
<T, U> void addListener(AtomicReference<State> stateRef, BiConsumer<T, U> consumer, T p1, U p2) { Logs.REMOTING.tracef("Running callback %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } }
<T, U> void addListener(AtomicReference<State> stateRef, BiConsumer<T, U> consumer, T p1, U p2) { Logs.REMOTING.tracef("Running callback %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } }
void activated() { try { Logs.REMOTING.tracef("Running callback (delayed) %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } finally { next.activated(); } } }
void activated() { try { Logs.REMOTING.tracef("Running callback (delayed) %s(%s, %s)", consumer, p1, p2); consumer.accept(p1, p2); } finally { next.activated(); } } }
<T, U> void addListener(final AtomicReference<State> stateRef, final BiConsumer<T, U> consumer, final T p1, final U p2) { if (! stateRef.compareAndSet(this, new UnfinishedWithListenerState<T, U>(this,consumer, p1, p2))) { stateRef.get().addListener(stateRef, consumer, p1, p2); } Logs.REMOTING.tracef("Added callback (delayed) %s(%s, %s)", consumer, p1, p2); } }
private static void disassociateRemoteTxIfPossible(AbstractInvocationContext context) { AbstractTransaction transaction = context.getTransaction(); if (transaction instanceof RemoteTransaction) { RemoteTransaction remote = (RemoteTransaction) transaction; if (!remote.tryClearLocation()) { Logs.TXN.tracef("Could not disassociate remote transaction (already in-use or completed) from %s", remote.getLocation()); } } }