Package org.jgroups

Examples of org.jgroups.Message.removeHeader()


     * @param evt
     */
    public void up(Event evt) {
        if(evt.getType() == Event.MSG) {
            Message msg=(Message)evt.getArg();
            CompressHeader hdr=(CompressHeader)msg.removeHeader(name);
            if(hdr != null) {
                byte[] compressed_payload=msg.getRawBuffer();
                if(compressed_payload != null && compressed_payload.length > 0) {
                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
View Full Code Here


            respondToStateRequester();
            return;

         case Event.MSG :
            Message msg = (Message) evt.getArg();
            StateHeader hdr = (StateHeader) msg.removeHeader(getName());
            if (hdr != null)
            {
               switch (hdr.type)
               {
                  case StateHeader.STATE_REQ :
View Full Code Here

                if(log.isInfoEnabled()) log.info("receiver window for " + sender + " is " + win);

            // Try to remove as many message as possible and send them up the stack
            while((tmpmsg=win.remove()) != null) {
                tmpmsg.removeHeader(getName()); // need to remove header again, so upper protocols don't get confused
                passUp(new Event(Event.MSG, tmpmsg));
            }

            // Garbage collect messages if singleton member (because then we won't receive any gossips, triggering
            // garbage collection)
View Full Code Here

        Message m;
        PbcastHeader hdr;

        for(Enumeration e=xmit_msgs.elements(); e.hasMoreElements();) {
            m=(Message) e.nextElement();
            hdr=(PbcastHeader) m.removeHeader(getName());
            if(hdr == null) {
                log.warn("header is null, ignoring message");
            }
            else {
                if(log.isInfoEnabled()) log.info("received #" + hdr.seqno + ", type=" +
View Full Code Here

   {
      switch (evt.getType())
      {        
         case Event.MSG :
            Message msg = (Message) evt.getArg();
            FlushHeader fh = (FlushHeader) msg.removeHeader(getName());
            if (fh != null && fh.type == FlushHeader.FLUSH_BYPASS)
            {
               break;
            }
            else
View Full Code Here

      Message msg = null;
      switch (evt.getType())
      {
         case Event.MSG :
            msg = (Message) evt.getArg();
            FlushHeader fh = (FlushHeader) msg.removeHeader(getName());
            if (fh != null)
            {
               flushPhase.lock();
               if (fh.type == FlushHeader.START_FLUSH)
               {                            
View Full Code Here

                                                  Util.printEvent(evt));
                    return// don't pass up
                }

                if(m.getHeader(getName()) instanceof PbcastHeader)
                    hdr=(PbcastHeader) m.removeHeader(getName());
                else {
                    sender=m.getSrc();

                        if(log.isErrorEnabled()) log.error("PbcastHeader expected, but received header of type " +
                                                   m.getHeader(getName()).getClass().getName() + " from " + sender +
View Full Code Here

   {
      switch (evt.getType())
      {        
         case Event.MSG :
            Message msg = (Message) evt.getArg();
            FlushHeader fh = (FlushHeader) msg.removeHeader(getName());
            if (fh != null && fh.type == FlushHeader.FLUSH_BYPASS)
            {
               break;
            }
            else
View Full Code Here

      Message msg = null;
      switch (evt.getType())
      {
         case Event.MSG :
            msg = (Message) evt.getArg();
            FlushHeader fh = (FlushHeader) msg.removeHeader(getName());
            if (fh != null)
            {
               flushPhase.lock();
               if (fh.type == FlushHeader.START_FLUSH)
               {                            
View Full Code Here

            respondToStateRequester();
            return;

         case Event.MSG :
            Message msg = (Message) evt.getArg();
            StateHeader hdr = (StateHeader) msg.removeHeader(getName());
            if (hdr != null)
            {
               switch (hdr.type)
               {
                  case StateHeader.STATE_REQ :
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.