Tabnine Logo
TpHeader.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jgroups.protocols.TpHeader
constructor

Best Java code snippets using org.jgroups.protocols.TpHeader.<init> (Showing top 7 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

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: 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<init>

Popular methods of TpHeader

  • getClusterName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • BoxLayout (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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