org.jboss.messaging.utils
Class TimeAndCounterIDGenerator

java.lang.Object
  extended by org.jboss.messaging.utils.TimeAndCounterIDGenerator
All Implemented Interfaces:
IDGenerator

public class TimeAndCounterIDGenerator
extends java.lang.Object
implements IDGenerator

A TimeAndCounterIDGenerator

This IDGenerator doesn't support more than 16777215 IDs per 16 millisecond. It would throw an exception if this happens.

Author:
Clebert Suconic, Tim Fox Created Sep 24, 2008 11:54:10 AM

Field Summary
static long ID_MASK
           
static long MASK_TIME
           
 
Constructor Summary
TimeAndCounterIDGenerator()
           
 
Method Summary
 long generateID()
           
 long getCurrentID()
           
 long getInternalTimeMark()
           
 void refresh()
           
 void setInternalDate(long date)
           
 void setInternalID(long id)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MASK_TIME

public static final long MASK_TIME
See Also:
Constant Field Values

ID_MASK

public static final long ID_MASK
See Also:
Constant Field Values
Constructor Detail

TimeAndCounterIDGenerator

public TimeAndCounterIDGenerator()
Method Detail

generateID

public long generateID()
Specified by:
generateID in interface IDGenerator

getCurrentID

public long getCurrentID()
Specified by:
getCurrentID in interface IDGenerator

getInternalTimeMark

public long getInternalTimeMark()

setInternalID

public void setInternalID(long id)

setInternalDate

public void setInternalDate(long date)

refresh

public void refresh()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006 JBoss Inc. All Rights Reserved.