/** * Processes the packet in another thread if the packet has not been rejected. * * @param packet the received packet. */ protected void processPresence(final Presence packet) throws UnauthorizedException { try { packetReceived(packet); // Process the packet in another thread threadPool.execute( new Runnable() { public void run() { try { ServerSocketReader.super.processPresence(packet); } catch (UnauthorizedException e) { Log.error("Error processing packet", e); } } }); } catch (PacketRejectedException e) { Log.debug("Presence rejected: " + packet.toXML(), e); } }