• 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 2592 for trunk/components/server/src/ome/services/sessions/SessionContextImpl.java

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

ticket:1018 - Initial version of OmeroSessions reference counting

Implementation is incomplete in the blitz case since there are two
possible "closers" - the user and the glacier session, which must
be taken into account.

Files:
1 modified

  • trunk/components/server/src/ome/services/sessions/SessionContextImpl.java (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/components/server/src/ome/services/sessions/SessionContextImpl.java

    r2125 r2592  
    1111import java.util.Collections; 
    1212import java.util.List; 
     13import java.util.concurrent.atomic.AtomicInteger; 
    1314 
    1415import ome.model.meta.Session; 
    1516 
    1617public class SessionContextImpl implements SessionContext { 
     18 
     19    private final AtomicInteger refCount = new AtomicInteger(0); 
    1720    private final Session session; 
    1821    private final List<Long> leaderOfGroups; 
    … …  
    2831                mGroups)); 
    2932        this.roles = Collections.unmodifiableList(new ArrayList(roles)); 
     33    } 
     34 
     35    public int refCount() { 
     36        return refCount.get(); 
     37    } 
     38 
     39    public int increment() { 
     40        return refCount.incrementAndGet(); 
     41    } 
     42 
     43    public int decrement() { 
     44        return refCount.decrementAndGet(); 
    3045    } 
    3146 

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/