Package org.jgroups

Examples of org.jgroups.Header


    private static String print(Message msg, Map<String, Header> hdrs) {
        StringBuilder sb=new StringBuilder();
        int hdrs_size=0;
        for(Map.Entry<String,Header> entry: hdrs.entrySet()) {
            String name=entry.getKey();
            Header hdr=entry.getValue();
            int size=hdr.size();
            hdrs_size+=size;
            sb.append(name).append(": ").append(" ").append(size).append(" bytes\n");
        }
        sb.append("headers=").append(hdrs_size).append(", total msg size=").append(msg.size());
        sb.append(", msg payload=").append(msg.getLength()).append("\n");
View Full Code Here


    }


    public static void testPutHeaderIfAbsent() {
        Headers hdrs=createHeaders(3);
        Header hdr=hdrs.putHeaderIfAbsent(FRAG, new MyHeader());
        assert hdr == h2;
        assert hdr == hdrs.getHeader(FRAG);
        assert hdrs.size() == 3;
        assert hdrs.capacity() == 3;
View Full Code Here

                ids[i]=id;
                hdrs[i]=hdr;
                return null;
            }
            if(ids[i] == id) {
                Header retval=hdrs[i];
                if(replace_if_present) {
                    hdrs[i]=hdr;
                }
                return retval;
            }
View Full Code Here

        int hdrs_size=0;
        for(Map.Entry<Short,Header> entry: hdrs.entrySet()) {

            Class clazz=ClassConfigurator.getProtocol(entry.getKey());
            String name=clazz != null? clazz.getSimpleName() : null;
            Header hdr=entry.getValue();
            int size=hdr.size();
            hdrs_size+=size;
            sb.append(name).append(": ").append(" ").append(size).append(" bytes\n");
        }
        sb.append("headers=").append(hdrs_size).append(", total msg size=").append(msg.size());
        sb.append(", msg payload=").append(msg.getLength()).append("\n");
View Full Code Here

            destroyInterpreter();
    }


    public Object up(Event evt) {
        Header  h;
        Message msg;
        int     type;

        if(evt.getType() == Event.MSG) {
            msg=(Message)evt.getArg();
View Full Code Here

    /** We have no down handler thread */
    public void startDownHandler() {
    }

    public void up(Event evt) {
        Header  h;
        Message msg;
        int     type;

        if(evt.getType() == Event.MSG) {
            msg=(Message)evt.getArg();
View Full Code Here

                data[i]=key;
                data[i+1]=hdr;
                return null;
            }
            if(data[i].equals(key)) {
                Header retval=(Header)data[i+1];
                if(replace_if_present) {
                    data[i+1]=hdr;
                }
                return retval;
            }
View Full Code Here

                data[i]=key;
                data[i+1]=hdr;
                return null;
            }
            if(data[i].equals(key)) {
                Header retval=(Header)data[i+1];
                if(replace_if_present) {
                    data[i+1]=hdr;
                }
                return retval;
            }
View Full Code Here

    private static String print(Message msg, Map<String, Header> hdrs) {
        StringBuilder sb=new StringBuilder();
        int hdrs_size=0;
        for(Map.Entry<String,Header> entry: hdrs.entrySet()) {
            String name=entry.getKey();
            Header hdr=entry.getValue();
            int size=hdr.size();
            hdrs_size+=size;
            sb.append(name).append(": ").append(" ").append(size).append(" bytes\n");
        }
        sb.append("headers=").append(hdrs_size).append(", total msg size=").append(msg.size());
        sb.append(", msg payload=").append(msg.getLength()).append("\n");
View Full Code Here

                ids[i]=id;
                hdrs[i]=hdr;
                return null;
            }
            if(ids[i] == id) {
                Header retval=hdrs[i];
                if(replace_if_present) {
                    hdrs[i]=hdr;
                }
                return retval;
            }
View Full Code Here

TOP

Related Classes of org.jgroups.Header

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.