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

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • Kernel (java.awt.image)
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • PhpStorm for WordPress
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