Class AbstractLazyCreationTargetSource

  • All Implemented Interfaces:
    TargetClassAware, TargetSource

    public abstract class AbstractLazyCreationTargetSource
    extends Object
    implements TargetSource
    TargetSource implementation that will lazily create a user-managed object.

    Creation of the lazy target object is controlled by the user by implementing the createObject() method. This TargetSource will invoke this method the first time the proxy is accessed.

    Useful when you need to pass a reference to some dependency to an object but you don't actually want the dependency to be created until it is first used. A typical scenario for this is a connection to a remote resource.

    Since:
    1.2.4
    Author:
    Rob Harrop, Juergen Hoeller
    See Also:
    isInitialized(), createObject()