org.jasig.portlet.newsreader.spring
Class SingletonDoubleCheckedCreator<T>

java.lang.Object
  extended by org.jasig.portlet.newsreader.spring.DoubleCheckedCreator<T>
      extended by org.jasig.portlet.newsreader.spring.SingletonDoubleCheckedCreator<T>

public abstract class SingletonDoubleCheckedCreator<T>
extends DoubleCheckedCreator<T>

Provides a DoubleCheckedCreator impl that tracks the singleton instance internally

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
 
Fields inherited from class org.jasig.portlet.newsreader.spring.DoubleCheckedCreator
logger, readLock, writeLock
 
Constructor Summary
SingletonDoubleCheckedCreator()
           
 
Method Summary
protected  T create(Object... args)
           
protected abstract  T createSingleton(Object... args)
          Called only once as long as it returns successfully
 boolean isCreated()
           
protected  T retrieve(Object... args)
           
 String toString()
           
 
Methods inherited from class org.jasig.portlet.newsreader.spring.DoubleCheckedCreator
get, invalid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingletonDoubleCheckedCreator

public SingletonDoubleCheckedCreator()
Method Detail

createSingleton

protected abstract T createSingleton(Object... args)
Called only once as long as it returns successfully

See Also:
DoubleCheckedCreator.create(Object...)

create

protected final T create(Object... args)
Specified by:
create in class DoubleCheckedCreator<T>
Parameters:
args - Arguments to use when creating the object
Returns:
A newly created object

retrieve

protected final T retrieve(Object... args)
Specified by:
retrieve in class DoubleCheckedCreator<T>
Parameters:
args - Arguments to use when retrieving the object
Returns:
An existing object if available

isCreated

public final boolean isCreated()
Returns:
true if the singleton has been created as of this call

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2009-2013 Jasig. All Rights Reserved.