Tabnine Logo
GossipData.writeTo
Code IndexAdd Tabnine to your IDE (free)

How to use
writeTo
method
in
org.jgroups.stack.GossipData

Best Java code snippets using org.jgroups.stack.GossipData.writeTo (Showing top 16 results out of 315)

origin: wildfly/wildfly

protected synchronized void writeRequest(GossipData req) throws Exception {
  int size=req.serializedSize();
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(size+5);
  req.writeTo(out);
  client.send(remote, out.buffer(), 0, out.position());
}
origin: wildfly/wildfly

protected void handleGetMembersRequest(Address sender, DataInput in) {
  GossipData req=readRequest(in, GossipType.GET_MBRS);
  if(req == null)
    return;
  GossipData rsp=new GossipData(GossipType.GET_MBRS_RSP, req.getGroup(), null);
  Map<Address,Entry> members=address_mappings.get(req.getGroup());
  if(members != null) {
    for(Map.Entry<Address,Entry> entry : members.entrySet()) {
      Address logical_addr=entry.getKey();
      PhysicalAddress phys_addr=entry.getValue().phys_addr;
      String logical_name=entry.getValue().logical_name;
      PingData data=new PingData(logical_addr, true, logical_name, phys_addr);
      rsp.addPingData(data);
    }
  }
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(rsp.serializedSize());
  try {
    rsp.writeTo(out);
    server.send(sender, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending %d to %s: %s", GossipType.GET_MBRS_RSP, sender, ex);
  }
}
origin: wildfly/wildfly

protected void sendToMember(Address dest, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
    server.send(dest, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending unicast message to %s: %s", dest, ex);
  }
}
origin: wildfly/wildfly

protected void sendToAllMembersInGroup(Set<Map.Entry<Address,Entry>> dests, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
  }
  catch(Exception ex) {
    log.error("failed marshalling gossip data %s: %s; dropping request", request, ex);
    return;
  }
  for(Map.Entry<Address,Entry> entry: dests) {
    Entry e=entry.getValue();
    if(e == null /* || e.phys_addr == null */)
      continue;
    try {
      server.send(e.client_addr, out.buffer(), 0, out.position());
    }
    catch(Exception ex) {
      log.error("failed sending message to %s (%s): %s", e.logical_name, e.phys_addr, ex);
    }
  }
}
origin: wildfly/wildfly

request.writeTo(out);
route(request.group, request.addr, out.buffer(), 0, out.position());
origin: org.jgroups/com.springsource.org.jgroups

gossip_req.writeTo(out);
out.flush();
origin: org.jgroups/com.springsource.org.jgroups

gossip_req.writeTo(out);
out.flush();
origin: org.jgroups/com.springsource.org.jgroups

output = new DataOutputStream(sock.getOutputStream());
GossipData req = new GossipData(GossipRouter.CONNECT, groupname, getLocalAddress(),null);
req.writeTo(output);
output.flush();
input = new DataInputStream(sock.getInputStream());
origin: org.jgroups/com.springsource.org.jgroups

gossip_req.writeTo(out);
out.flush();
origin: org.jboss.eap/wildfly-client-all

protected synchronized void writeRequest(GossipData req) throws Exception {
  int size=req.serializedSize();
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(size+5);
  req.writeTo(out);
  client.send(remote, out.buffer(), 0, out.position());
}
origin: org.jboss.eap/wildfly-client-all

protected void handleGetMembersRequest(Address sender, DataInput in) {
  GossipData req=readRequest(in, GossipType.GET_MBRS);
  if(req == null)
    return;
  GossipData rsp=new GossipData(GossipType.GET_MBRS_RSP, req.getGroup(), null);
  Map<Address,Entry> members=address_mappings.get(req.getGroup());
  if(members != null) {
    for(Map.Entry<Address,Entry> entry : members.entrySet()) {
      Address logical_addr=entry.getKey();
      PhysicalAddress phys_addr=entry.getValue().phys_addr;
      String logical_name=entry.getValue().logical_name;
      PingData data=new PingData(logical_addr, true, logical_name, phys_addr);
      rsp.addPingData(data);
    }
  }
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(rsp.serializedSize());
  try {
    rsp.writeTo(out);
    server.send(sender, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending %d to %s: %s", GossipType.GET_MBRS_RSP, sender, ex);
  }
}
origin: org.jgroups/com.springsource.org.jgroups

public synchronized void disconnect() {
  if(isConnected()){
    try{
      GossipData req = new GossipData(GossipRouter.DISCONNECT, groupname, local_addr,null);
      req.writeTo(output);
      output.flush();
    }catch(Exception e){
    }finally{
      Util.close(output);
      Util.close(input);
      Util.close(sock);
      Util.close(my_sock);
      sock = null;                
      connectionStateChanged(STATUS_DISCONNECTED);
    }
  }
}
origin: org.jboss.eap/wildfly-client-all

protected void sendToMember(Address dest, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
    server.send(dest, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending unicast message to %s: %s", dest, ex);
  }
}
origin: org.jboss.eap/wildfly-client-all

protected void sendToAllMembersInGroup(Set<Map.Entry<Address,Entry>> dests, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
  }
  catch(Exception ex) {
    log.error("failed marshalling gossip data %s: %s; dropping request", request, ex);
    return;
  }
  for(Map.Entry<Address,Entry> entry: dests) {
    Entry e=entry.getValue();
    if(e == null /* || e.phys_addr == null */)
      continue;
    try {
      server.send(e.client_addr, out.buffer(), 0, out.position());
    }
    catch(Exception ex) {
      log.error("failed sending message to %s (%s): %s", e.logical_name, e.phys_addr, ex);
    }
  }
}
origin: org.jgroups/com.springsource.org.jgroups

output=new DataOutputStream(sock.getOutputStream());
GossipData rsp=new GossipData(GossipRouter.GET_RSP, group, null, mbrs);
rsp.writeTo(output);
Util.close(input);
Util.close(output);
  log.trace("ROUTER_GET(" + group + ") --> " + ret);
rsp=new GossipData(GossipRouter.GET_RSP, group, null, ret);
rsp.writeTo(output);
Util.close(input);
Util.close(output);
origin: org.jboss.eap/wildfly-client-all

request.writeTo(out);
route(request.group, request.addr, out.buffer(), 0, out.position());
org.jgroups.stackGossipDatawriteTo

Popular methods of GossipData

  • <init>
  • getAddress
  • getGroup
  • getType
  • readFrom
  • addPingData
  • getBuffer
  • getLogicalName
  • getPhysicalAddress
  • getPingData
  • getSender
  • serializedSize
  • getSender,
  • serializedSize,
  • setSender

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • CodeWhisperer alternatives
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