org.apache.commons.proxy.provider
Class SingletonProvider

java.lang.Object
  extended by org.apache.commons.proxy.provider.ProviderDecorator
      extended by org.apache.commons.proxy.provider.SingletonProvider
All Implemented Interfaces:
ObjectProvider

public class SingletonProvider
extends ProviderDecorator

Wraps another object provider, making sure to only call it once, returning the value returned from the wrapped provider on all subsequent invocations.

Since:
1.0
Author:
James Carman

Field Summary
 
Fields inherited from class org.apache.commons.proxy.provider.ProviderDecorator
inner
 
Constructor Summary
SingletonProvider(ObjectProvider inner)
           
 
Method Summary
 Object getObject()
          Returns an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonProvider

public SingletonProvider(ObjectProvider inner)
Method Detail

getObject

public Object getObject()
Description copied from interface: ObjectProvider
Returns an object. Implementing classes should throw a ObjectProviderException if any problems arise while constructing/finding the object.

Specified by:
getObject in interface ObjectProvider
Overrides:
getObject in class ProviderDecorator
Returns:
the object on which the method should be called


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.