Code example for AbstractLazyCreationTargetSource

0
 
	private class ReferenceTargetSource<T> extends AbstractLazyCreationTargetSource { 
 
		private AtomicReference<T> reference; 
 
		public ReferenceTargetSource(AtomicReference<T> reference) { 
			this.reference = reference; 
		} 
 
		@Override 
		protected Object createObject() throws Exception { 
			initialize(); 
			return reference.get(); 
		} 
	} 
 
}