Ignore:
Timestamp:
12/11/17 12:16:27 (7 years ago)
Author:
pharms
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/proxy/ExchangeListenerManager.java

    r1991 r2246  
    213213        ensureListener(request).onFinish(status); 
    214214        Console.traceln(Level.FINEST, "removing exchange listener for " + request); 
    215         listeners.remove(request); 
     215        synchronized (this) { 
     216            listeners.remove(request); 
     217        } 
    216218    } 
    217219 
     
    222224     */ 
    223225    private ExchangeListener ensureListener(HttpServletRequest request) { 
    224         ExchangeListener listener = listeners.get(request); 
    225          
    226         if (listener == null) { 
    227             synchronized (this) { 
    228                 listener = listeners.get(request); 
    229                 if (listener == null) { 
    230                     Console.traceln(Level.FINEST, "creating exchange listener for " + request); 
    231                     listener = new ExchangeListener(exchangeHandler, idGenerator);  
    232                     listeners.put(request, listener); 
    233                 } 
     226        synchronized (this) { 
     227            ExchangeListener listener = listeners.get(request); 
     228         
     229            if (listener == null) { 
     230                Console.traceln(Level.FINEST, "creating exchange listener for " + request); 
     231                listener = new ExchangeListener(exchangeHandler, idGenerator);  
     232                listeners.put(request, listener); 
    234233            } 
    235         } 
    236  
    237         return listener; 
     234 
     235            return listener; 
     236        } 
    238237    } 
    239238 
Note: See TracChangeset for help on using the changeset viewer.