Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.net
Class ServerSocketReader

    java.lang.Object
      org.jivesoftware.openfire.net.SocketReader
          org.jivesoftware.openfire.net.ServerSocketReader

All Implemented Interfaces:
  Runnable

    public class ServerSocketReader

extends SocketReader

A SocketReader specialized for server connections. This reader will be used when the open stream contains a jabber:server namespace. Server-to-server communication requires two TCP connections between the servers where one is used for sending packets whilst the other connection is used for receiving packets. The connection used for receiving packets will use a ServerSocketReader since the other connection will not receive packets.

The received packets will be routed using another thread to ensure that many received packets could be routed at the same time. To avoid creating new threads every time a packet is received each `ServerSocketReader` instance uses a `ThreadPoolExecutor`. By default the maximum number of threads that the executor may have is 50. However, this value may be modified by changing the property xmpp.server.processing.max.threads.

Author:
  Gaston Dombiak

Field Summary

Fields inherited from class org.jivesoftware.openfire.net.SocketReader
`connection, open, serverName, session`

Constructor Summary
`ServerSocketReader(PacketRouter router, RoutingTable routingTable, String serverName, Socket socket, SocketConnection connection, boolean useBlockingMode)`

Method Summary
`protected void` | `processIQ(IQ packet)` Processes the packet in another thread if the packet has not been rejected.
`protected void` | `processMessage(Message packet)` Processes the packet in another thread if the packet has not been rejected.
`protected void` | `processPresence(Presence packet)` Processes the packet in another thread if the packet has not been rejected.
`protected boolean` | `processUnknowPacket(org.dom4j.Element doc)` Remote servers may send subsequent db:result packets so we need to process them in order to validate new domains.
`protected void` | `shutdown()` Notification message indicating that the SocketReader is shutting down.

Methods inherited from class org.jivesoftware.openfire.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

### ServerSocketReader

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

Method Detail

### processIQ

    protected void processIQ(IQ packet)
                      throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

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

### processPresence

    protected void processPresence(Presence packet)
                            throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

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

### processMessage

    protected void processMessage(Message packet)
                           throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

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

### processUnknowPacket

    protected boolean processUnknowPacket(org.dom4j.Element doc)

  Remote servers may send subsequent db:result packets so we need to process them in order to validate new domains.

  Parameters:
    `doc` - the unknown DOM element that was received
  Returns:
    true if the packet is a db:result packet otherwise false.

### 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.