static boolean isBlackListed(AbstractInvocationContext context, URI destination) { final Set<URI> blacklist = context.getAttachment(BL_KEY); return blacklist != null && blacklist.contains(destination); }
@SuppressWarnings("Java8CollectionRemoveIf") private Map<String, URI> tryFilterToPreferredNodes(AbstractInvocationContext context, Map<String, URI> nodes) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return nodes; } HashSet<URI> preferred = new HashSet<>(attachment); Map<String, URI> result = null; for (Map.Entry<String, URI> check : nodes.entrySet()) { if (preferred.contains(check.getValue())) { if (result == null) { result = new HashMap<>(attachment.size()); } result.put(check.getKey(), check.getValue()); } } return result == null ? nodes : result; }
private static List<URI> findPreferredURIs(AbstractInvocationContext context, List<URI> uris) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return null; } HashSet<URI> preferred = new HashSet<>(attachment); List<URI> result = null; for (URI check : uris) { if (preferred.contains(check) && !isBlackListed(context, check)) { if (result == null) { result = new ArrayList<>(preferred.size()); } result.add(check); } } return result; }
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; } }
final List<Throwable> problems; final Set<URI> blacklist = context.getAttachment(BL_KEY); final Map<URI, String> nodes = new HashMap<>(); final Map<String, URI> uris = new HashMap<>();
final EJBClientContext clientContext = context.getClientContext(); final List<Throwable> problems; final Set<URI> set = context.getAttachment(BL_KEY); try (final ServicesQueue queue = discover(filterSpec)) { ServiceURL serviceURL; final NamingProvider namingProvider = context.getAttachment(Keys.NAMING_PROVIDER_ATTACHMENT_KEY); if (namingProvider != null) { NamingEJBClientInterceptor.setNamingDestination(context, namingProvider);
private void removeNode(final AbstractInvocationContext context) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity instanceof NodeAffinity) { final RemoteEJBReceiver ejbReceiver = context.getClientContext().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (ejbReceiver != null) { final EJBClientChannel ejbClientChannel = context.getAttachment(RemoteEJBReceiver.EJBCC_KEY); if (ejbClientChannel != null) { final NodeInformation nodeInformation = ejbReceiver.getDiscoveredNodeRegistry().getNodeInformation(((NodeAffinity) targetAffinity).getNodeName()); if (nodeInformation != null) { nodeInformation.removeModule(ejbClientChannel, context.getLocator().getIdentifier().getModuleIdentifier()); } } } } } }
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); try (final ServicesQueue queue = discover(filterSpec)) { ServiceURL serviceURL;
static boolean isBlackListed(AbstractInvocationContext context, URI destination) { final Set<URI> blacklist = context.getAttachment(BL_KEY); return blacklist != null && blacklist.contains(destination); }
static boolean isBlackListed(AbstractInvocationContext context, URI destination) { final Set<URI> blacklist = context.getAttachment(BL_KEY); return blacklist != null && blacklist.contains(destination); }
@SuppressWarnings("Java8CollectionRemoveIf") private Map<String, URI> tryFilterToPreferredNodes(AbstractInvocationContext context, Map<String, URI> nodes) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return nodes; } HashSet<URI> preferred = new HashSet<>(attachment); Map<String, URI> result = null; for (Map.Entry<String, URI> check : nodes.entrySet()) { if (preferred.contains(check.getValue())) { if (result == null) { result = new HashMap<>(attachment.size()); } result.put(check.getKey(), check.getValue()); } } return result == null ? nodes : result; }
@SuppressWarnings("Java8CollectionRemoveIf") private Map<String, URI> tryFilterToPreferredNodes(AbstractInvocationContext context, Map<String, URI> nodes) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return nodes; } HashSet<URI> preferred = new HashSet<>(attachment); Map<String, URI> result = null; for (Map.Entry<String, URI> check : nodes.entrySet()) { if (preferred.contains(check.getValue())) { if (result == null) { result = new HashMap<>(attachment.size()); } result.put(check.getKey(), check.getValue()); } } return result == null ? nodes : result; }
private static List<URI> findPreferredURIs(AbstractInvocationContext context, List<URI> uris) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return null; } HashSet<URI> preferred = new HashSet<>(attachment); List<URI> result = null; for (URI check : uris) { if (preferred.contains(check) && !isBlackListed(context, check)) { if (result == null) { result = new ArrayList<>(preferred.size()); } result.add(check); } } return result; }
private static List<URI> findPreferredURIs(AbstractInvocationContext context, List<URI> uris) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return null; } HashSet<URI> preferred = new HashSet<>(attachment); List<URI> result = null; for (URI check : uris) { if (preferred.contains(check) && !isBlackListed(context, check)) { if (result == null) { result = new ArrayList<>(preferred.size()); } result.add(check); } } return result; }
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; } }
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 void removeNode(final AbstractInvocationContext context) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity instanceof NodeAffinity) { final RemoteEJBReceiver ejbReceiver = context.getClientContext().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (ejbReceiver != null) { final EJBClientChannel ejbClientChannel = context.getAttachment(RemoteEJBReceiver.EJBCC_KEY); if (ejbClientChannel != null) { final NodeInformation nodeInformation = ejbReceiver.getDiscoveredNodeRegistry().getNodeInformation(((NodeAffinity) targetAffinity).getNodeName()); if (nodeInformation != null) { nodeInformation.removeModule(ejbClientChannel, context.getLocator().getIdentifier().getModuleIdentifier()); } } } } } }
private void removeNode(final AbstractInvocationContext context) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity instanceof NodeAffinity) { final RemoteEJBReceiver ejbReceiver = context.getClientContext().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (ejbReceiver != null) { final EJBClientChannel ejbClientChannel = context.getAttachment(RemoteEJBReceiver.EJBCC_KEY); if (ejbClientChannel != null) { final NodeInformation nodeInformation = ejbReceiver.getDiscoveredNodeRegistry().getNodeInformation(((NodeAffinity) targetAffinity).getNodeName()); if (nodeInformation != null) { nodeInformation.removeModule(ejbClientChannel, context.getLocator().getIdentifier().getModuleIdentifier()); } } } } } }
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); try (final ServicesQueue queue = discover(filterSpec)) { ServiceURL serviceURL;
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); try (final ServicesQueue queue = discover(filterSpec)) { ServiceURL serviceURL;