Package org.jgroups

Examples of org.jgroups.Message.removeHeader()


        Message msg;
        int     type;

        if(evt.getType() == Event.MSG) {
            msg=(Message)evt.getArg();
            h=msg.removeHeader(name);
            if(h != null && h instanceof BshHeader) {
                type=((BshHeader)h).type;
                switch(type) {
                    case BshHeader.REQ:
                        handleRequest(msg.getSrc(), msg.getBuffer());
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

                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

     * @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

       if(log.isInfoEnabled()) log.info("local address is " + local_addr);
      break;

        case Event.MSG:
            msg=(Message)evt.getArg();
            partHead=(PartitionerHeader) msg.removeHeader(getName());
            if (partHead.type == PartitionerHeader.COMMAND) {
    num = (Integer) partHead.Destinations.get(local_addr);
    if (num == null) return;
     if(log.isInfoEnabled()) log.info("new partition = " + num);
    my_partition =num.intValue();
View Full Code Here

     * @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

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.