Class OutgoingSessionPromise

  • All Implemented Interfaces:
    ChannelHandler<org.xmpp.packet.Packet>, RoutableChannelHandler

    public class OutgoingSessionPromise
    extends Object
    implements RoutableChannelHandler
    An OutgoingSessionPromise provides an asynchronic way for sending packets to remote servers. When looking for a route to a remote server that does not have an existing connection, a session promise is returned. This class will queue packets and process them in another thread. The processing thread will use a pool of thread that will actually do the hard work. The threads in the pool will try to connect to remote servers and deliver the packets. If an error occurred while establishing the connection or sending the packet an error will be returned to the sender of the packet.
    Gaston Dombiak
    • Method Detail

      • shutdown

        public void shutdown()
        Shuts down the thread that consumes the queued packets and also stops the pool of threads that actually send the packets to the remote servers.
      • getAddress

        public org.xmpp.packet.JID getAddress()
        Description copied from interface: RoutableChannelHandler
        Returns the XMPP address. The address is used by services like the core server packet router to determine if a packet should be sent to the handler. Handlers that are working on behalf of the server should use the generic server hostname address (e.g.
        Specified by:
        getAddress in interface RoutableChannelHandler
        the XMPP address.
      • process

        public void process​(org.xmpp.packet.Packet packet)
        Description copied from interface: ChannelHandler
        Process an XMPP packet.
        Specified by:
        process in interface ChannelHandler<org.xmpp.packet.Packet>
        packet - a packet to process.