Code example for AbstractLazyCreationTargetSource

0
 
 
	/** 
	 * Lazily creates an {@code MBeanServerConnection}. 
	 */ 
	private class MBeanServerConnectionLazyInitTargetSource extends AbstractLazyCreationTargetSource { 
 
		@Override 
		protected Object createObject() throws Exception { 
			return connector.getMBeanServerConnection(); 
		} 
 
		@Override 
		public Class<?> getTargetClass() { 
			return MBeanServerConnection.class; 
		} 
	} 
 
}