Wildfire 3.1.1 Javadoc

org.jivesoftware.wildfire.net
Class ConnectionMultiplexerSocketReader

java.lang.Object
  extended by org.jivesoftware.wildfire.net.SocketReader
      extended by org.jivesoftware.wildfire.net.ConnectionMultiplexerSocketReader
All Implemented Interfaces:
Runnable

public class ConnectionMultiplexerSocketReader
extends SocketReader

A SocketReader specialized for connection manager connections. Connection managers may have one or more connections to the server. Each connection will have its own instance of this class. Each connection will send packets, sent from clients connected to the connection manager, to the server. Moreover, the server will use any of the available connections to the connection manager to send packets to connected clients through the connection manager.

Each socket reader has its own thread pool to process many packets in parallel. The thread pool by default will use 10 core threads, a queue of 50 elements and a max number of 100 threads. The pool will use the 10 core threads in parallel and queue packets. When the queue is full then more threads will be created until the max number is reached. Any created thread that exceeds the core number of threads will be killed when idle for 1 minute. The thread pool configuration can be modified by setting the system properties:

Each Connection Manager has its own domain. Each connection from the same connection manager uses a different resource. Unlike any other session, connection manager sessions are not present in the routing table. This means that connection managers are not reachable entities. In other words, entities cannot send packets to connection managers but clients being hosted by them. The main reason behind this design decision is that connection managers are private components of the server so they can only be contacted by the server. Connection Manager sessions are present in SessionManager but not in RoutingTable.

Author:
Gaston Dombiak

Field Summary
 
Fields inherited from class org.jivesoftware.wildfire.net.SocketReader
connection, open, serverName, session
 
Constructor Summary
ConnectionMultiplexerSocketReader(PacketRouter router, RoutingTable routingTable, String serverName, Socket socket, SocketConnection connection, boolean useBlockingMode)
           
 
Method Summary
protected  void processIQ(IQ packet)
          Process the received IQ packet.
protected  void processMessage(Message packet)
          Process the received Message packet.
protected  void processPresence(Presence packet)
          Process the received Presence packet.
protected  void shutdown()
          Notification message indicating that the SocketReader is shutting down.
 
Methods inherited from class org.jivesoftware.wildfire.net.SocketReader
createSession, process, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionMultiplexerSocketReader

public ConnectionMultiplexerSocketReader(PacketRouter router,
                                         RoutingTable routingTable,
                                         String serverName,
                                         Socket socket,
                                         SocketConnection connection,
                                         boolean useBlockingMode)
Method Detail

processIQ

protected void processIQ(IQ packet)
                  throws UnauthorizedException
Description copied from class: SocketReader
Process the received IQ packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processIQ in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

processMessage

protected void processMessage(Message packet)
                       throws UnauthorizedException
Description copied from class: SocketReader
Process the received Message packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processMessage in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

processPresence

protected void processPresence(Presence packet)
                        throws UnauthorizedException
Description copied from class: SocketReader
Process the received Presence packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processPresence in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

shutdown

protected void shutdown()
Description copied from class: SocketReader
Notification message indicating that the SocketReader is shutting down. The thread will stop reading and processing new requests. Subclasses may want to redefine this message for releasing any resource they might need.

Overrides:
shutdown in class SocketReader

Wildfire 3.1.1 Javadoc

Copyright © 2003-2006 Jive Software.