|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.wildfire.net.SocketReader
public abstract class SocketReader
A SocketReader creates the appropriate Session
based on the defined namespace in the
stream element and will then keep reading and routing the received packets.
Field Summary | |
---|---|
protected SocketConnection |
connection
Reference to the physical connection. |
protected boolean |
open
|
protected String |
serverName
Server name for which we are attending clients. |
protected Session |
session
Session associated with the socket reader. |
Constructor Summary | |
---|---|
SocketReader(PacketRouter router,
RoutingTable routingTable,
String serverName,
Socket socket,
SocketConnection connection,
boolean useBlockingMode)
Creates a dedicated reader for a socket. |
Method Summary | |
---|---|
protected void |
createSession()
Uses the XPP to grab the opening stream tag and create an active session object. |
protected void |
process(org.dom4j.Element doc)
|
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. |
void |
run()
A dedicated thread loop for reading the stream and sending incoming packets to the appropriate router. |
protected void |
shutdown()
Notification message indicating that the SocketReader is shutting down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Session session
protected SocketConnection connection
protected String serverName
protected boolean open
Constructor Detail |
---|
public SocketReader(PacketRouter router, RoutingTable routingTable, String serverName, Socket socket, SocketConnection connection, boolean useBlockingMode)
router
- the router for sending packets that were read.routingTable
- the table that keeps routes to registered services.serverName
- the name of the server this socket is working for.socket
- the socket to read from.connection
- the connection being read.useBlockingMode
- true means that the server will use a thread per connection.Method Detail |
---|
public void run()
run
in interface Runnable
protected void process(org.dom4j.Element doc) throws Exception
Exception
protected void processIQ(IQ packet) throws UnauthorizedException
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.
packet
- the received packet.
UnauthorizedException
protected void processPresence(Presence packet) throws UnauthorizedException
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.
packet
- the received packet.
UnauthorizedException
protected void processMessage(Message packet) throws UnauthorizedException
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.
packet
- the received packet.
UnauthorizedException
protected void createSession() throws UnauthorizedException, org.xmlpull.v1.XmlPullParserException, IOException
UnauthorizedException
org.xmlpull.v1.XmlPullParserException
IOException
protected void shutdown()
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |