Commit 19d41e6f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Optimization. JM-476

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3142 b35dd754-fafc-0310-a699-88a17e54d16e
parent 465c457c
......@@ -214,21 +214,25 @@ public class InterceptorManager {
throws PacketRejectedException
{
// Invoke the global interceptors for this packet
for (PacketInterceptor interceptor : globalInterceptors) {
try {
interceptor.interceptPacket(packet, session, read, processed);
}
catch (PacketRejectedException e) {
if (processed) {
Log.error("Post interceptor cannot reject packet.", e);
// Checking if collection is empty to prevent creating an iterator of
// a CopyOnWriteArrayList that is an expensive operation
if (!globalInterceptors.isEmpty()) {
for (PacketInterceptor interceptor : globalInterceptors) {
try {
interceptor.interceptPacket(packet, session, read, processed);
}
else {
// Throw this exception since we don't really want to catch it
throw e;
catch (PacketRejectedException e) {
if (processed) {
Log.error("Post interceptor cannot reject packet.", e);
}
else {
// Throw this exception since we don't really want to catch it
throw e;
}
}
catch (Exception e) {
Log.error("Error in interceptor", e);
}
}
catch (Exception e) {
Log.error("Error in interceptor", e);
}
}
// Invoke the interceptors that are related to the address of the session
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment