Examples of MessageEvent

  • jetbrains.communicator.core.transport.MessageEvent
    @author kir
  • net.gleamynode.netty.channel.MessageEvent
  • net.sourceforge.processdash.msg.MessageEvent
  • org.cspoker.common.api.chat.event.MessageEvent
  • org.directwebremoting.event.MessageEvent
    An MessageEvent is fired to a set of {@link MessageListener}s by the DWR {@link Hub}. @author Joe Walker [joe at getahead dot ltd dot uk]
  • org.eclipse.ecf.internal.provider.xmpp.events.MessageEvent
  • org.groovymud.engine.event.messages.MessageEvent
  • org.gwtoolbox.sample.ioc.client.event.MessageEvent
    @author Uri Boness
  • org.jboss.netty.channel.MessageEvent
    @author The Netty Project (netty-dev@lists.jboss.org) @author Trustin Lee (tlee@redhat.com) @version $Rev: 6 $, $Date: 2008-08-08 10:40:10 +0900 (Fri, 08 Aug 2008) $
  • org.jivesoftware.smackx.packet.MessageEvent
    Represents message events relating to the delivery, display, composition and cancellation of messages.

    There are four message events currently defined in this namespace:

    1. Offline
      Indicates that the message has been stored offline by the intended recipient's server. This event is triggered only if the intended recipient's server supports offline storage, has that support enabled, and the recipient is offline when the server receives the message for delivery.
    2. Delivered
      Indicates that the message has been delivered to the recipient. This signifies that the message has reached the recipient's XMPP client, but does not necessarily mean that the message has been displayed. This event is to be raised by the XMPP client.
    3. Displayed
      Once the message has been received by the recipient's XMPP client, it may be displayed to the user. This event indicates that the message has been displayed, and is to be raised by the XMPP client. Even if a message is displayed multiple times, this event should be raised only once.
    4. Composing
      In threaded chat conversations, this indicates that the recipient is composing a reply to a message. The event is to be raised by the recipient's XMPP client. A XMPP client is allowed to raise this event multiple times in response to the same request, providing the original event is cancelled first.
    @author Gaston Dombiak
  • org.netbeans.lib.cvsclient.event.MessageEvent
  • org.pircbotx.hooks.events.MessageEvent
  • org.rsbot.event.events.MessageEvent
    A message event.
  • robocode.MessageEvent
    A MessageEvent is sent to {@link TeamRobot#onMessageReceived(MessageEvent) onMessageReceived()} when a teammate sends a message to your robot.You can use the information contained in this event to determine what to do. @author Mathew A. Nelson (original)
  • rocks.xmpp.core.stanza.MessageEvent
    A message event is fired whenever a message is received or sent. @author Christian Schudt @see MessageListener

  • Examples of org.jboss.netty.channel.MessageEvent

                    future.setSuccess();
                    break;
                }
            }
            else if (e instanceof MessageEvent) {
                MessageEvent event = (MessageEvent) e;
                DefaultLocalChannel channel = (DefaultLocalChannel) event.getChannel();
                boolean offered = channel.writeBuffer.offer(event);
                assert offered;
                channel.flushWriteBuffer();
            }
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                case INTEREST_OPS:
                    OioDatagramWorker.setInterestOps(channel, future, ((Integer) value).intValue());
                    break;
                }
            } else if (e instanceof MessageEvent) {
                MessageEvent evt = (MessageEvent) e;
                OioDatagramWorker.write(
                        channel, future, evt.getMessage(), evt.getRemoteAddress());
            }
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                return true;
            }

            @Override
            public MessageEvent poll() {
                MessageEvent e = super.poll();
                if (e != null) {
                    int messageSize = ((ChannelBuffer) e.getMessage()).readableBytes();
                    int newWriteBufferSize = writeBufferSize.addAndGet(-messageSize);
                    int lowWaterMark = getConfig().getWriteBufferLowWaterMark();

                    if (newWriteBufferSize == 0 || newWriteBufferSize < lowWaterMark) {
                        if (newWriteBufferSize + messageSize >= lowWaterMark) {
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

        public void handleWritable(java.nio.channels.Channel channel) {
            BaseXnioChannel c = XnioChannelRegistry.getChannel(channel);
            int writtenBytes = 0;
            boolean open = true;
            boolean addOpWrite = false;
            MessageEvent evt;
            ChannelBuffer buf;
            int bufIdx;

            Queue<MessageEvent> writeBuffer = c.writeBuffer;
            synchronized (c.writeLock) {
                evt = c.currentWriteEvent;
                for (;;) {
                    if (evt == null) {
                        evt = writeBuffer.poll();
                        if (evt == null) {
                            c.currentWriteEvent = null;
                            break;
                        }

                        buf = (ChannelBuffer) evt.getMessage();
                        bufIdx = buf.readerIndex();
                    } else {
                        buf = (ChannelBuffer) evt.getMessage();
                        bufIdx = c.currentWriteIndex;
                    }

                    try {
                        final int writeSpinCount = c.getConfig().getWriteSpinCount();
                        boolean sent = false;
                        for (int i = writeSpinCount; i > 0; i --) {
                            if (channel instanceof GatheringByteChannel) {
                                int localWrittenBytes = buf.getBytes(
                                    bufIdx,
                                    (GatheringByteChannel) channel,
                                    buf.writerIndex() - bufIdx);

                                if (localWrittenBytes != 0) {
                                    bufIdx += localWrittenBytes;
                                    writtenBytes += localWrittenBytes;
                                    break;
                                }
                            } else if (channel instanceof MultipointWritableMessageChannel) {
                                ByteBuffer nioBuf = buf.toByteBuffer(bufIdx, buf.writerIndex() - bufIdx);
                                int nioBufSize = nioBuf.remaining();
                                SocketAddress remoteAddress = evt.getRemoteAddress();
                                if (remoteAddress == null) {
                                    remoteAddress = c.getRemoteAddress();
                                }
                                sent = ((MultipointWritableMessageChannel) channel).send(remoteAddress, nioBuf);
                                if (sent) {
                                    bufIdx += nioBufSize;
                                    writtenBytes += nioBufSize;
                                    break;
                                }
                            } else if (channel instanceof WritableMessageChannel) {
                                ByteBuffer nioBuf = buf.toByteBuffer(bufIdx, buf.writerIndex() - bufIdx);
                                int nioBufSize = nioBuf.remaining();
                                sent = ((WritableMessageChannel) channel).send(nioBuf);
                                if (sent) {
                                    bufIdx += nioBufSize;
                                    writtenBytes += nioBufSize;
                                    break;
                                }
                            } else {
                                throw new IllegalArgumentException("Unsupported channel type: " + channel.getClass().getName());
                            }
                        }

                        if (bufIdx == buf.writerIndex() || sent) {
                            // Successful write - proceed to the next message.
                            evt.getFuture().setSuccess();
                            evt = null;
                        } else {
                            // Not written fully - perhaps the kernel buffer is full.
                            c.currentWriteEvent = evt;
                            c.currentWriteIndex = bufIdx;
                            addOpWrite = true;
                            break;
                        }
                    } catch (AsynchronousCloseException e) {
                        // Doesn't need a user attention - ignore.
                    } catch (Throwable t) {
                        evt.getFuture().setFailure(t);
                        evt = null;
                        fireExceptionCaught(c, t);
                        if (t instanceof IOException) {
                            open = false;
                            c.closeNow(succeededFuture(c));
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                case INTEREST_OPS:
                    NioWorker.setInterestOps(channel, future, ((Integer) value).intValue());
                    break;
                }
            } else if (e instanceof MessageEvent) {
                MessageEvent event = (MessageEvent) e;
                NioSocketChannel channel = (NioSocketChannel) event.getChannel();
                channel.writeBuffer.offer(event);
                NioWorker.write(channel, true);
            }
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                case INTEREST_OPS:
                    NioWorker.setInterestOps(channel, future, ((Integer) value).intValue());
                    break;
                }
            } else if (e instanceof MessageEvent) {
                MessageEvent event = (MessageEvent) e;
                NioSocketChannel channel = (NioSocketChannel) event.getChannel();
                channel.writeBuffer.offer(event);
                NioWorker.write(channel, true);
            }
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

            if (!(evt instanceof MessageEvent)) {
                context.sendUpstream(evt);
                return;
            }

            MessageEvent e = (MessageEvent) evt;
            if (!(e.getMessage() instanceof ChannelBuffer)) {
                context.sendUpstream(evt);
                return;
            }

            fireMessageReceived(
                    context, e.getChannel(),
                    ((ChannelBuffer) e.getMessage()).toString(charsetName));
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

            boolean open = true;
            boolean addOpWrite = false;
            boolean removeOpWrite = false;

            MessageEvent evt;
            ChannelBuffer buf;
            int bufIdx;

            Queue<MessageEvent> writeBuffer = channel.writeBuffer;
            synchronized (channel.writeLock) {
                evt = channel.currentWriteEvent;
                for (;;) {
                    if (evt == null) {
                        evt = writeBuffer.poll();
                        if (evt == null) {
                            channel.currentWriteEvent = null;
                            removeOpWrite = true;
                            break;
                        }
                        buf = (ChannelBuffer) evt.getMessage();
                        bufIdx = buf.readerIndex();
                    } else {
                        buf = (ChannelBuffer) evt.getMessage();
                        bufIdx = channel.currentWriteIndex;
                    }

                    try {
                        for (int i = writeSpinCount; i > 0; i --) {
                            int localWrittenBytes = buf.getBytes(
                                bufIdx,
                                channel.socket,
                                buf.writerIndex() - bufIdx);

                            if (localWrittenBytes != 0) {
                                bufIdx += localWrittenBytes;
                                break;
                            }
                        }

                        if (bufIdx == buf.writerIndex()) {
                            // Successful write - proceed to the next message.
                            evt.getFuture().setSuccess();
                            evt = null;
                        } else {
                            // Not written fully - perhaps the kernel buffer is full.
                            channel.currentWriteEvent = evt;
                            channel.currentWriteIndex = bufIdx;
                            addOpWrite = true;
                            break;
                        }
                    } catch (AsynchronousCloseException e) {
                        // Doesn't need a user attention - ignore.
                    } catch (Throwable t) {
                        evt.getFuture().setFailure(t);
                        evt = null;
                        fireExceptionCaught(channel, t);
                        if (t instanceof IOException) {
                            open = false;
                            close(channel, channel.getSucceededFuture());
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                cause = new ClosedChannelException();
            }

            // Clean up the stale messages in the write buffer.
            synchronized (channel.writeLock) {
                MessageEvent evt = channel.currentWriteEvent;
                if (evt != null) {
                    channel.currentWriteEvent = null;
                    channel.currentWriteIndex = 0;
                    evt.getFuture().setFailure(cause);
                    fireExceptionCaught(channel, cause);
                }

                Queue<MessageEvent> writeBuffer = channel.writeBuffer;
                for (;;) {
                    evt = writeBuffer.poll();
                    if (evt == null) {
                        break;
                    }
                    evt.getFuture().setFailure(cause);
                    fireExceptionCaught(channel, cause);
                }
            }
        }
    View Full Code Here

    Examples of org.jboss.netty.channel.MessageEvent

                return true;
            }

            @Override
            public MessageEvent poll() {
                MessageEvent e = super.poll();
                if (e != null) {
                    int newWriteBufferSize = writeBufferSize.addAndGet(
                            -((ChannelBuffer) e.getMessage()).readableBytes());
                    if (newWriteBufferSize == 0 ||
                        newWriteBufferSize < getConfig().getWriteBufferLowWaterMark()) {
                        exceededHighWaterMark = true;
                    }
                }
    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.