Code example for AtomicLong

0
 *  
 * @author Justin Deoliveira, OpenGeo 
 */ 
public class ScriptSession { 
 
    static AtomicLong IDGEN = new AtomicLong();
 
    long id;
    String extension;
    ScriptEngine engine;
 
    ScriptSession(ScriptEngine engine, String extension) {
        this.engine = engine;
        this.extension = extension;
        this.id = IDGEN.getAndIncrement();
    } 
 
    public long getId() { 
        return id;
    }