Package org.jgroups.util

Examples of org.jgroups.util.Buffer


      boolean rsvp = command instanceof StateRequestCommand || command instanceof StateResponseCommand
            || command instanceof CacheTopologyControlCommand
            || isRsvpCommand(command);

      Response retval;
      Buffer buf;
      buf = marshallCall(marshaller, command);
      retval = card.sendMessage(constructMessage(buf, destination, oob, rsvp, false),
                                new RequestOptions(mode, timeout));

      // we only bother parsing responses if we are not in ASYNC mode.
View Full Code Here


      /// HACK ALERT!  Used for ISPN-1789.  Enable RSVP if the command is a cache topology control command.
      boolean rsvp = command instanceof CacheTopologyControlCommand
            || isRsvpCommand(command);

      RspList<Object> retval = null;
      Buffer buf;
      if (totalOrder && distribution) {
         buf = marshallCall(marshaller, command);
         Message message = constructMessage(buf, null, oob, rsvp, totalOrder);

         AnycastAddress address = new AnycastAddress(dests);
View Full Code Here

   }

   @Override
   public BackupResponse backupRemotely(Collection<XSiteBackup> backups, ReplicableCommand rpcCommand) throws Exception {
      log.tracef("About to send to backups %s, command %s", backups, rpcCommand);
      Buffer buf = CommandAwareRpcDispatcher.marshallCall(dispatcher.getMarshaller(), rpcCommand);
      Map<XSiteBackup, Future<Object>> syncBackupCalls = new HashMap<XSiteBackup, Future<Object>>(backups.size());
      for (XSiteBackup xsb : backups) {
         SiteMaster recipient = new SiteMaster(xsb.getSiteName());
         if (xsb.isSync()) {
            RequestOptions sync = new RequestOptions(org.jgroups.blocks.ResponseMode.GET_ALL, xsb.getTimeout());
View Full Code Here

      if (recipient != null) msg.setDest(recipient);
      return msg;
   }

   static Buffer marshallCall(Marshaller marshaller, ReplicableCommand command) {
      Buffer buf;
      try {
         buf = marshaller.objectToBuffer(command);
      } catch (Exception e) {
         throw new RuntimeException("Failure to marshal argument(s)", e);
      }
View Full Code Here

      boolean rsvp = command instanceof StateRequestCommand || command instanceof StateResponseCommand
            || command instanceof CacheTopologyControlCommand
            || isRsvpCommand(command);

      Response retval;
      Buffer buf;
      buf = marshallCall(marshaller, command);
      retval = card.sendMessage(constructMessage(buf, destination, oob, mode, rsvp, false),
                                new RequestOptions(mode, timeout));

      // we only bother parsing responses if we are not in ASYNC mode.
View Full Code Here

      /// HACK ALERT!  Used for ISPN-1789.  Enable RSVP if the command is a cache topology control command.
      boolean rsvp = command instanceof CacheTopologyControlCommand
            || isRsvpCommand(command);

      RspList<Object> retval = null;
      Buffer buf;
      if (totalOrder && distribution) {
         buf = marshallCall(marshaller, command);
         Message message = constructMessage(buf, null, oob, mode, rsvp, totalOrder);

         AnycastAddress address = new AnycastAddress(dests);
View Full Code Here

        receiver=null;
        super.stop();
    }

    void sendMcastDiscoveryRequest(Message msg) {
        Buffer           buf;
        DatagramPacket   packet;
        DataOutputStream out=null;

        try {
            if(msg.getSrc() == null)
                msg.setSrc(local_addr);
            out_stream.reset();
            out=new DataOutputStream(out_stream);
            msg.writeTo(out);
            out.flush(); // flushes contents to out_stream
            buf=new Buffer(out_stream.getRawBuffer(), 0, out_stream.size());
            packet=new DatagramPacket(buf.getBuf(), buf.getOffset(), buf.getLength(), mcast_addr, mcast_port);
            if(mcast_send_sockets != null) {
                MulticastSocket s;
                for(int i=0; i < mcast_send_sockets.length; i++) {
                    s=mcast_send_sockets[i];
                    try {
View Full Code Here

   }

   @Override
   public BackupResponse backupRemotely(Collection<XSiteBackup> backups, ReplicableCommand rpcCommand) throws Exception {
      log.tracef("About to send to backups %s, command %s", backups, rpcCommand);
      Buffer buf = CommandAwareRpcDispatcher.marshallCall(dispatcher.getMarshaller(), rpcCommand);
      Map<XSiteBackup, Future<Object>> syncBackupCalls = new HashMap<XSiteBackup, Future<Object>>(backups.size());
      for (XSiteBackup xsb : backups) {
         SiteMaster recipient = new SiteMaster(xsb.getSiteName());
         if (xsb.isSync()) {
            RequestOptions sync = new RequestOptions(org.jgroups.blocks.ResponseMode.GET_ALL, xsb.getTimeout());
View Full Code Here

   }

   // implement the basic contract set in RPCDispatcher.AbstractMarshaller
   public byte[] objectToByteBuffer(Object obj) throws Exception
   {
      Buffer b = objectToBuffer(obj);
      byte[] bytes = new byte[b.getLength()];
      System.arraycopy(b.getBuf(), b.getOffset(), bytes, 0, b.getLength());
      return bytes;
   }
View Full Code Here

         this.filter = filter;
      }

      public RspList call() throws Exception
      {
         Buffer buf;
         try
         {
            buf = req_marshaller.objectToBuffer(command);
         }
         catch (Exception e)
View Full Code Here

TOP

Related Classes of org.jgroups.util.Buffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.