public static byte[] streamableToByteBuffer(Streamable obj) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); obj.writeTo(out); return Arrays.copyOf(out.buffer(), out.position()); }
public static byte[] streamableToByteBuffer(Streamable obj) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); obj.writeTo(out); return Arrays.copyOf(out.buffer(), out.position()); }
public static byte[] collectionToByteBuffer(Collection<Address> c) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); Util.writeAddresses(c,out); return Arrays.copyOf(out.buffer(), out.position()); }
public static byte[] collectionToByteBuffer(Collection<Address> c) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); Util.writeAddresses(c,out); return Arrays.copyOf(out.buffer(), out.position()); }
public static byte[] streamableToByteBuffer(Streamable obj) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); obj.writeTo(out); return Arrays.copyOf(out.buffer(), out.position()); }
public static byte[] collectionToByteBuffer(Collection<Address> c) throws Exception { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); Util.writeAddresses(c,out); return Arrays.copyOf(out.buffer(), out.position()); }
protected synchronized void writeRequest(GossipData req) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(req.size()); req.writeTo(out); client.send(remote, out.buffer(), 0, out.position()); }
protected synchronized void writeRequest(GossipData req) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(req.size()); req.writeTo(out); client.send(remote, out.buffer(), 0, out.position()); }
protected synchronized void writeRequest(GossipData req) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(req.size()); req.writeTo(out); client.send(remote, out.buffer(), 0, out.position()); }
protected void sendToMember(Address dest, GossipData request) { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.size()); 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); } }
protected void sendToMember(Address dest, GossipData request) { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.size()); 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); } }
protected void sendToMember(Address dest, GossipData request) { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.size()); 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); } }
protected static Buffer streamableToBuffer(byte req_or_rsp, byte type, Streamable obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(100); out.writeByte(req_or_rsp); out.writeByte(type); obj.writeTo(out); return new Buffer(out.buffer(), 0, out.position()); }
protected static Buffer streamableToBuffer(byte req_or_rsp, byte type, Streamable obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(100); out.writeByte(req_or_rsp); out.writeByte(type); obj.writeTo(out); return new Buffer(out.buffer(), 0, out.position()); }
protected static Buffer streamableToBuffer(byte req_or_rsp, byte type, Streamable obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(100); out.writeByte(req_or_rsp); out.writeByte(type); obj.writeTo(out); return new Buffer(out.buffer(), 0, out.position()); }
protected void sendMessageList(final Address dest, final Address src, final byte[] cluster_name, final List<Message> list) { try { Util.writeMessageList(dest, src, cluster_name, list, output, dest == null, transport.getId()); // flushes output stream when done transport.doSend(transport.isSingleton()? new AsciiString(cluster_name) : null, output.buffer(), 0, output.position(), dest); } catch(SocketException sock_ex) { log.debug(Util.getMessage("FailureSendingMsgBundle"),transport.localAddress(),sock_ex); } catch(Throwable e) { log.error(Util.getMessage("FailureSendingMsgBundle"), transport.localAddress(), e); } }
protected void sendMessageList(final Address dest, final Address src, final byte[] cluster_name, final List<Message> list) { try { Util.writeMessageList(dest, src, cluster_name, list, output, dest == null, transport.getId()); // flushes output stream when done transport.doSend(transport.isSingleton()? new AsciiString(cluster_name) : null, output.buffer(), 0, output.position(), dest); } catch(SocketException sock_ex) { log.debug(Util.getMessage("FailureSendingMsgBundle"),transport.localAddress(),sock_ex); } catch(Throwable e) { log.error(Util.getMessage("FailureSendingMsgBundle"), transport.localAddress(), e); } }