- Timestamp:
- 07/05/08 22:16:06 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/blitz/src/ome/services/blitz/fire/SessionManagerI.java
r2596 r2597 128 128 log.debug(String.format("Created session %s for user %s", 129 129 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 138 137 return Glacier2.SessionPrxHelper.uncheckedCast(_prx); 139 138 140 139 } catch (Exception t) { 140 141 if (t instanceof ApiUsageException) { 142 ApiUsageException aue = (ApiUsageException) t; 143 throw new CannotCreateSessionException(aue.message); 144 } 145 141 146 ConvertToBlitzExceptionMessage convert = new ConvertToBlitzExceptionMessage( 142 147 this, t); … … 150 155 if (convert.to instanceof CannotCreateSessionException) { 151 156 throw (CannotCreateSessionException) convert.to; 152 } else if (convert.to instanceof ApiUsageException) {153 ApiUsageException aue = (ApiUsageException) convert.to;154 throw new CannotCreateSessionException(aue.message);155 157 } 156 158 … … 207 209 * {@link Ice.ObjectAdapter} 208 210 */ 209 p rivatevoid reapSessions(Ice.Current cantUseThisCurrent) {211 public void reapSessions(Ice.Current cantUseThisCurrent) { 210 212 Ice.ObjectAdapter adapter = cantUseThisCurrent.adapter; 211 213 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) { 215 218 try { 216 219 Ice.Identity iid = ServiceFactoryI.sessionId(clientId, 217 id);220 sessionId); 218 221 Ice.Object obj = adapter.find(iid); 219 222 if (obj == null) { 220 log.debug(id + " already removed."); 223 log.debug(Ice.Util.identityToString(iid) 224 + " already removed."); 221 225 } else { 222 226 ServiceFactoryI sf = (ServiceFactoryI) obj; 223 227 sf.doDestroy(adapter); 224 228 } 225 sessionsForReaping.remove(id);226 229 } catch (Exception e) { 227 log.error("Error reaping session " + id230 log.error("Error reaping session " + sessionId 228 231 + " from client " + clientId, e); 229 232 } 230 233 } 234 sessionToClientIds.remove(sessionId); 235 sessionsForReaping.remove(sessionId); 231 236 } 232 237 }
