KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > idprovider > impl > ObjectIDProviderImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.idprovider.impl;
5
6 import com.tc.object.ObjectID;
7 import com.tc.object.idprovider.api.ObjectIDProvider;
8 import com.tc.util.sequence.Sequence;
9
10 public class ObjectIDProviderImpl implements ObjectIDProvider {
11
12   private final Sequence sequence;
13   
14   public ObjectIDProviderImpl(Sequence sequence) {
15     this.sequence = sequence;
16   }
17
18   public synchronized ObjectID next() {
19     return new ObjectID(sequence.next());
20   }
21 }
Popular Tags