01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.idprovider.impl;
05:
06: import com.tc.object.ObjectID;
07: import com.tc.object.idprovider.api.ObjectIDProvider;
08: import com.tc.util.sequence.Sequence;
09:
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: }
|