Tabnine Logo
NodeAffinity
Code IndexAdd Tabnine to your IDE (free)

How to use
NodeAffinity
in
org.jboss.ejb.client

Best Java code snippets using org.jboss.ejb.client.NodeAffinity (Showing top 20 results out of 315)

origin: wildfly/wildfly

Object writeReplace() {
  String s = uri.getScheme();
  if (s.equals("node")) {
    return new NodeAffinity(uri.getSchemeSpecificPart());
  } else if (s.equals("cluster")) {
    return new ClusterAffinity(uri.getSchemeSpecificPart());
  } else if (s.equals("local")) {
    return LOCAL;
  } else {
    // keep same object
    return this;
  }
}
origin: wildfly/wildfly

public boolean equals(final Object other) {
  return other instanceof NodeAffinity && equals((NodeAffinity) other);
}
origin: wildfly/wildfly

  marshaller.writeObject(strongAffinityUpdate);
} else {
  marshaller.writeObject(new NodeAffinity(channel.getConnection().getEndpoint().getName()));
  final String nodeName = weakAffinityUpdate.getNodeName();
  final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
  PackedInteger.writePackedInteger(os, bytes.length);
origin: wildfly/wildfly

final String nodeName = weakAffinityUpdate.getNodeName();
final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
PackedInteger.writePackedInteger(os, bytes.length);
origin: org.jboss.eap/wildfly-client-all

  marshaller.writeObject(strongAffinityUpdate);
} else {
  marshaller.writeObject(new NodeAffinity(channel.getConnection().getEndpoint().getName()));
  final String nodeName = weakAffinityUpdate.getNodeName();
  final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
  PackedInteger.writePackedInteger(os, bytes.length);
origin: wildfly/wildfly

  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());
          }
        }
      }
    }
  }
}
origin: wildfly/wildfly

@Override
public Affinity getStrictAffinity() {
  return new NodeAffinity(this.environment.getNodeName());
}
origin: wildfly/jboss-ejb-client

  marshaller.writeObject(strongAffinityUpdate);
} else {
  marshaller.writeObject(new NodeAffinity(channel.getConnection().getEndpoint().getName()));
  final String nodeName = weakAffinityUpdate.getNodeName();
  final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
  PackedInteger.writePackedInteger(os, bytes.length);
origin: wildfly/wildfly

  filterSpec = FilterSpec.equal(FILTER_ATTR_NODE, ((NodeAffinity) weakAffinity).getNodeName());
  return doFirstMatchDiscovery(context, filterSpec, null);
} else if (affinity instanceof NodeAffinity) {
  filterSpec = FilterSpec.equal(FILTER_ATTR_NODE, ((NodeAffinity) affinity).getNodeName());
  return doFirstMatchDiscovery(context, filterSpec, null);
} else if (affinity instanceof ClusterAffinity) {
    filterSpec = FilterSpec.all(
      FilterSpec.equal(FILTER_ATTR_CLUSTER, ((ClusterAffinity) affinity).getClusterName()),
      FilterSpec.equal(FILTER_ATTR_NODE, ((NodeAffinity) weakAffinity).getNodeName())
    );
    fallbackFilterSpec = FilterSpec.all(
origin: wildfly/wildfly

public boolean equals(final Affinity other) {
  return other instanceof NodeAffinity && equals((NodeAffinity) other);
}
origin: wildfly/wildfly

/**
 * Get the affinity specification corresponding to the given URI.
 *
 * @param uri the URI
 * @return the affinity specification (not {@code null})
 */
public static Affinity forUri(URI uri) {
  if (uri == null || ! uri.isAbsolute()) return NONE;
  final String scheme = uri.getScheme();
  assert scheme != null; // due to isAbsolute() check
  switch (scheme) {
    case "node": return new NodeAffinity(uri.getSchemeSpecificPart());
    case "cluster": return new ClusterAffinity(uri.getSchemeSpecificPart());
    case "local": return LOCAL;
    default: return new URIAffinity(uri);
  }
}
origin: wildfly/jboss-ejb-client

final String nodeName = weakAffinityUpdate.getNodeName();
final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
PackedInteger.writePackedInteger(os, bytes.length);
origin: org.jboss.eap/wildfly-client-all

public boolean equals(final Affinity other) {
  return other instanceof NodeAffinity && equals((NodeAffinity) other);
}
origin: wildfly/wildfly

ProtocolV3ObjectResolver(final Connection connection, final boolean preferUri) {
  final String remoteEndpointName = connection.getRemoteEndpointName();
  peerNodeAffinity = remoteEndpointName == null ? null : new NodeAffinity(remoteEndpointName);
  final String localEndpointName = connection.getEndpoint().getName();
  selfNodeAffinity = localEndpointName == null ? null : new NodeAffinity(localEndpointName);
  this.preferUri = preferUri;
  final URI peerURI = connection.getPeerURI();
  peerUriAffinity = peerURI == null ? null : (URIAffinity) Affinity.forUri(peerURI);
}
origin: org.jboss.eap/wildfly-client-all

final String nodeName = weakAffinityUpdate.getNodeName();
final byte[] bytes = nodeName.getBytes(StandardCharsets.UTF_8);
PackedInteger.writePackedInteger(os, bytes.length);
origin: org.jboss.eap/wildfly-client-all

public boolean equals(final Object other) {
  return other instanceof NodeAffinity && equals((NodeAffinity) other);
}
origin: wildfly/wildfly

ProtocolV1ObjectResolver(final Connection connection, final boolean preferUri) {
  final String remoteEndpointName = connection.getRemoteEndpointName();
  peerNodeAffinity = remoteEndpointName == null ? null : new NodeAffinity(remoteEndpointName);
  final String localEndpointName = connection.getEndpoint().getName();
  selfNodeAffinity = localEndpointName == null ? null : new NodeAffinity(localEndpointName);
  this.preferUri = preferUri;
  final URI peerURI = connection.getPeerURI();
  peerUriAffinity = peerURI == null ? null : (URIAffinity) Affinity.forUri(peerURI);
}
origin: org.jboss.eap/wildfly-client-all

  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());
          }
        }
      }
    }
  }
}
origin: wildfly/jboss-ejb-client

public boolean equals(final Object other) {
  return other instanceof NodeAffinity && equals((NodeAffinity) other);
}
origin: wildfly/wildfly

@Override
public Affinity getWeakAffinity(I id) {
  if (this.cache.getCacheConfiguration().clustering().cacheMode().isClustered()) {
    Node node = this.locatePrimaryOwner(id);
    Map.Entry<String, ?> entry = this.registry.getEntry(node);
    if (entry != null) {
      return new NodeAffinity(entry.getKey());
    }
  }
  return Affinity.NONE;
}
org.jboss.ejb.clientNodeAffinity

Javadoc

A single node affinity specification.

Most used methods

  • <init>
    Construct a new instance.
  • equals
  • getNodeName
    Get the associated node name.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Option (scala)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now