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

How to use
TpHeader
in
org.jgroups.protocols

Best Java code snippets using org.jgroups.protocols.TpHeader (Showing top 9 results out of 315)

origin: wildfly/wildfly

public static List<Message> readMessageList(DataInput in, short transport_id) throws Exception {
  List<Message> list=new LinkedList<>();
  Address dest=Util.readAddress(in);
  Address src=Util.readAddress(in);
  // AsciiString cluster_name=Bits.readAsciiString(in); // not used here
  short length=in.readShort();
  byte[] cluster_name=length >= 0? new byte[length] : null;
  if(cluster_name != null)
    in.readFully(cluster_name, 0, cluster_name.length);
  int len=in.readInt();
  for(int i=0; i < len; i++) {
    Message msg=new Message(false);
    msg.readFrom(in);
    msg.setDest(dest);
    if(msg.getSrc() == null)
      msg.setSrc(src);
    // Now add a TpHeader back on, was not marshalled. Every message references the *same* TpHeader, saving memory !
    msg.putHeader(transport_id, new TpHeader(cluster_name));
    list.add(msg);
  }
  return list;
}
origin: wildfly/wildfly

  protected byte[] getClusterName() {
    TpHeader hdr=msg.getHeader(tp_id);
    return hdr.getClusterName();
  }
}
origin: wildfly/wildfly

public void up(MessageBatch batch) {
  // let unicast message batches pass
  if(batch.dest() != null
   && (batch.mode() == MessageBatch.Mode.OOB && batch.mode() == MessageBatch.Mode.INTERNAL)
   || holes.contains(batch.sender())) {
    up_prot.up(batch);
    return;
  }
  if(barrier_closed.get()) {
    final Map<Address,Message> map=batch.dest() == null? mcast_queue : ucast_queue;
    map.put(batch.sender(), batch.last().putHeader(transport.getId(),new TpHeader(batch.clusterName())));
    return; // queue the last message of the batch and drop the batch
  }
  Thread current_thread=Thread.currentThread();
  in_flight_threads.put(current_thread, NULL);
  try {
    up_prot.up(batch);
  }
  finally {
    unblock(current_thread);
  }
}
origin: org.jboss.eap/wildfly-client-all

  protected byte[] getClusterName() {
    TpHeader hdr=msg.getHeader(tp_id);
    return hdr.getClusterName();
  }
}
origin: wildfly/wildfly

case Event.CONNECT_WITH_STATE_TRANSFER_USE_FLUSH:
  cluster_name=new AsciiString((String)evt.getArg());
  header=new TpHeader(cluster_name);
origin: org.jboss.eap/wildfly-client-all

public static List<Message> readMessageList(DataInput in, short transport_id) throws Exception {
  List<Message> list=new LinkedList<>();
  Address dest=Util.readAddress(in);
  Address src=Util.readAddress(in);
  // AsciiString cluster_name=Bits.readAsciiString(in); // not used here
  short length=in.readShort();
  byte[] cluster_name=length >= 0? new byte[length] : null;
  if(cluster_name != null)
    in.readFully(cluster_name, 0, cluster_name.length);
  int len=in.readInt();
  for(int i=0; i < len; i++) {
    Message msg=new Message(false);
    msg.readFrom(in);
    msg.setDest(dest);
    if(msg.getSrc() == null)
      msg.setSrc(src);
    // Now add a TpHeader back on, was not marshalled. Every message references the *same* TpHeader, saving memory !
    msg.putHeader(transport_id, new TpHeader(cluster_name));
    list.add(msg);
  }
  return list;
}
origin: org.jgroups/com.springsource.org.jgroups

protected Object handleDownEvent(Event evt) {
  switch(evt.getType()) {
  case Event.TMP_VIEW:
  case Event.VIEW_CHANGE:
    synchronized(members) {
      view=(View)evt.getArg();
      members.clear();
      Vector<Address> tmpvec=view.getMembers();
      members.addAll(tmpvec);
    }
    break;
  case Event.CONNECT:
    channel_name=(String)evt.getArg();
    header=new TpHeader(channel_name);
    setThreadNames();
    return null;
  case Event.DISCONNECT:
    unsetThreadNames();
    break;
  case Event.CONFIG:
    if(log.isDebugEnabled()) log.debug("received CONFIG event: " + evt.getArg());
    handleConfigEvent((HashMap)evt.getArg());
    break;
  }
  return null;
}
origin: org.jboss.eap/wildfly-client-all

public void up(MessageBatch batch) {
  // let unicast message batches pass
  if(batch.dest() != null
   && (batch.mode() == MessageBatch.Mode.OOB && batch.mode() == MessageBatch.Mode.INTERNAL)
   || holes.contains(batch.sender())) {
    up_prot.up(batch);
    return;
  }
  if(barrier_closed.get()) {
    final Map<Address,Message> map=batch.dest() == null? mcast_queue : ucast_queue;
    map.put(batch.sender(), batch.last().putHeader(transport.getId(),new TpHeader(batch.clusterName())));
    return; // queue the last message of the batch and drop the batch
  }
  Thread current_thread=Thread.currentThread();
  in_flight_threads.put(current_thread, NULL);
  try {
    up_prot.up(batch);
  }
  finally {
    unblock(current_thread);
  }
}
origin: org.jboss.eap/wildfly-client-all

case Event.CONNECT_WITH_STATE_TRANSFER_USE_FLUSH:
  cluster_name=new AsciiString((String)evt.getArg());
  header=new TpHeader(cluster_name);
org.jgroups.protocolsTpHeader

Javadoc

Generic transport header, used by TP.

Most used methods

  • <init>
  • getClusterName

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JComboBox (javax.swing)
  • Top Vim plugins
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