Package org.jboss.errai.bus.client

Examples of org.jboss.errai.bus.client.Message


                if (a instanceof JSONObject) {
                    final JSONObject eMap = (JSONObject) a;
                    final String subject = eMap.keySet().iterator().next();

                    list.add(new Message() {
                        public String getSubject() {
                            return subject;
                        }

                        public Object getMessage() {
View Full Code Here


        this.queue = new LinkedBlockingQueue<Message>(queueSize);
    }

    public Payload poll(boolean wait) {
        try {
            Message m;
            if (wait) {
                if (pollActive) {
                    throw new RuntimeException("concurrent polling not allowed!");
                }
                pollActive = true;
View Full Code Here

            httpServletResponse.addHeader("Payload-Size", String.valueOf(messages.size()));
            httpServletResponse.setContentType("application/io");
            OutputStream stream = httpServletResponse.getOutputStream();

            Iterator<Message> iter = messages.iterator();
            Message m;

            stream.write('[');
            while (iter.hasNext()) {
                writeToOutputStream(stream, iter.next());
                if (iter.hasNext()) {
                    stream.write(',');
                }
            }
            stream.write(']');

            stream.close();
        }
        catch (final Throwable t) {

            httpServletResponse.setHeader("Cache-Control", "no-cache");
            httpServletResponse.addHeader("Payload-Size", "1");
            httpServletResponse.setContentType("application/io");
            OutputStream stream = httpServletResponse.getOutputStream();

            stream.write('[');

            writeToOutputStream(stream, new Message() {
                public String getSubject() {
                     return "ClientBusErrors";
                }

                public Object getMessage() {
View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.client.Message

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.