Package generic.cache
Class CountingBasicFactory<T>
java.lang.Object
generic.cache.CountingBasicFactory<T>
- All Implemented Interfaces:
- BasicFactory<T>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AtomicIntegerA counter for tracking the number of items that have been created.protected AtomicInteger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreate()Creates an instance ofBasicFactory.voidCalled when clients are finished with the given item and it should be disposed.abstract TdoCreate(int itemNumber) The method subclass use to createCountingBasicFactorys.abstract void
- 
Field Details- 
counterA counter for tracking the number of items that have been created.
- 
disposedCount
 
- 
- 
Constructor Details- 
CountingBasicFactorypublic CountingBasicFactory()
 
- 
- 
Method Details- 
createDescription copied from interface:BasicFactoryCreates an instance ofBasicFactory.- Specified by:
- createin interface- BasicFactory<T>
- Returns:
- the new instance of T
- Throws:
- Exception- any Exception encountered during creation
 
- 
disposeDescription copied from interface:BasicFactoryCalled when clients are finished with the given item and it should be disposed.- Specified by:
- disposein interface- BasicFactory<T>
- Parameters:
- t- the item to dispose.
 
- 
doCreateThe method subclass use to createCountingBasicFactorys.- Parameters:
- itemNumber- the number of the item being created-- one-based; the first item is item- 1.
- Returns:
- a new instance of CountingBasicFactory.
- Throws:
- Exception- any Exception encountered during creation
 
- 
doDispose
 
-