public void invokeInterceptors(Packet packet, Session session, boolean read, boolean processed)
            throws PacketRejectedException
    {
        // Invoke the global interceptors for this packet
        invokeInterceptors( globalInterceptors, packet, session, read, processed );

        // Invoke the interceptors that are related to the address of the session
        if (usersInterceptors.isEmpty()) {
            // Do nothing
            return;
        }
        String username = session != null ? session.getAddress().getNode() : null;
        if (username != null && server.isLocal(session.getAddress())) {
            Collection<PacketInterceptor> userInterceptors = usersInterceptors.get(username);
            invokeInterceptors( userInterceptors, packet, session, read, processed );
        }
    }
Invokes all currently-installed interceptors on the specified packet.
All global interceptors will be invoked as well as interceptors that
are related to the address of the session that received or is sending
the packet.<p>

Interceptors are executed before and after processing an incoming packet
and sending a packet to a user. This means that interceptors are able to alter or
reject packets before they are processed further. If possible, interceptors
should perform their work in a short time so that overall performance is not
compromised.

@param packet the packet that has been read or is about to be sent.
@param session the session that received the packet or that the packet
     will be sent to.
@param read true indicates that the packet was read. When false, the packet
     is being sent to a user.
@param processed true if the packet has already processed (incoming or outgoing).
     If the packet hasn't already been processed, this flag will be false.
@throws PacketRejectedException if the packet should be prevented from being processed.
xmppserver/src/main/java/org/jivesoftware/openfire/interceptor/InterceptorManager.java