• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 2597 for trunk/components/blitz/src/ome/services/blitz/fire/SessionManagerI.java

Show
Ignore:
Timestamp:
07/05/08 22:16:06 (5 months ago)
Author:
jmoore
Message:

ticket:1018 - Fixing memory leak in solution

  • Added ome/services/messaging.xml to publish messages to child contexts
  • Fixed ordering issues SessionManagerI
  • Also:
    • Using ice_getCommunicator() if ic null in omero.client
    • Catching exceptions on session close in test.integration.library
Files:
1 modified

  • trunk/components/blitz/src/ome/services/blitz/fire/SessionManagerI.java (modified) (3 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/components/blitz/src/ome/services/blitz/fire/SessionManagerI.java

    r2596 r2597  
    128128                log.debug(String.format("Created session %s for user %s", 
    129129                        id.name, userId)); 
    130             } else { 
    131                 sessionToClientIds.get(s.getUuid()).add(session.clientId); 
    132                 if (log.isDebugEnabled()) { 
    133                     log.debug(String.format("Rejoined session %s for user %s", 
    134                             id.name, userId)); 
    135                 } 
    136  
    137             } 
     130            } 
     131            sessionToClientIds.get(s.getUuid()).add(session.clientId); 
     132            if (log.isDebugEnabled()) { 
     133                log.debug(String.format("Rejoined session %s for user %s", 
     134                        id.name, userId)); 
     135            } 
     136 
    138137            return Glacier2.SessionPrxHelper.uncheckedCast(_prx); 
    139138 
    140139        } catch (Exception t) { 
     140 
     141            if (t instanceof ApiUsageException) { 
     142                ApiUsageException aue = (ApiUsageException) t; 
     143                throw new CannotCreateSessionException(aue.message); 
     144            } 
     145 
    141146            ConvertToBlitzExceptionMessage convert = new ConvertToBlitzExceptionMessage( 
    142147                    this, t); 
    … …  
    150155            if (convert.to instanceof CannotCreateSessionException) { 
    151156                throw (CannotCreateSessionException) convert.to; 
    152             } else if (convert.to instanceof ApiUsageException) { 
    153                 ApiUsageException aue = (ApiUsageException) convert.to; 
    154                 throw new CannotCreateSessionException(aue.message); 
    155157            } 
    156158 
    … …  
    207209     *            {@link Ice.ObjectAdapter} 
    208210     */ 
    209     private void reapSessions(Ice.Current cantUseThisCurrent) { 
     211    public void reapSessions(Ice.Current cantUseThisCurrent) { 
    210212        Ice.ObjectAdapter adapter = cantUseThisCurrent.adapter; 
    211213        synchronized (sessionsForReaping) { 
    212             List<String> ids = new ArrayList<String>(sessionsForReaping); 
    213             for (String id : ids) { 
    214                 for (String clientId : sessionToClientIds.get(id)) { 
     214            List<String> sessionIds = new ArrayList<String>(sessionsForReaping); 
     215            for (String sessionId : sessionIds) { 
     216                Set<String> clientIds = sessionToClientIds.keySet(); 
     217                for (String clientId : clientIds) { 
    215218                    try { 
    216219                        Ice.Identity iid = ServiceFactoryI.sessionId(clientId, 
    217                                 id); 
     220                                sessionId); 
    218221                        Ice.Object obj = adapter.find(iid); 
    219222                        if (obj == null) { 
    220                             log.debug(id + " already removed."); 
     223                            log.debug(Ice.Util.identityToString(iid) 
     224                                    + " already removed."); 
    221225                        } else { 
    222226                            ServiceFactoryI sf = (ServiceFactoryI) obj; 
    223227                            sf.doDestroy(adapter); 
    224228                        } 
    225                         sessionsForReaping.remove(id); 
    226229                    } catch (Exception e) { 
    227                         log.error("Error reaping session " + id 
     230                        log.error("Error reaping session " + sessionId 
    228231                                + " from client " + clientId, e); 
    229232                    } 
    230233                } 
     234                sessionToClientIds.remove(sessionId); 
     235                sessionsForReaping.remove(sessionId); 
    231236            } 
    232237        } 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/