/** * Eagerly create the singleton instance, if necessary. */ @Override public void afterPropertiesSet() throws Exception { if (isSingleton()) { this.initialized = true; this.singletonInstance = createInstance(); this.earlySingletonInstance = null; } }
/** * Destroy the singleton instance, if any. * @see #destroyInstance(Object) */ @Override public void destroy() throws Exception { if (isSingleton()) { destroyInstance(this.singletonInstance); } }
/** * Destroy the singleton instance, if any. * @see #destroyInstance(Object) */ @Override public void destroy() throws Exception { if (isSingleton()) { destroyInstance(this.singletonInstance); } }
/** * Eagerly create the singleton instance, if necessary. */ @Override public void afterPropertiesSet() throws Exception { if (isSingleton()) { this.initialized = true; this.singletonInstance = createInstance(); this.earlySingletonInstance = null; } }
/** * Expose the singleton instance or create a new prototype instance. * @see #createInstance() * @see #getEarlySingletonInterfaces() */ @Override public final T getObject() throws Exception { if (isSingleton()) { return (this.initialized ? this.singletonInstance : getEarlySingletonInstance()); } else { return createInstance(); } }
/** * Expose the singleton instance or create a new prototype instance. * @see #createInstance() * @see #getEarlySingletonInterfaces() */ @Override public final T getObject() throws Exception { if (isSingleton()) { return (this.initialized ? this.singletonInstance : getEarlySingletonInstance()); } else { return createInstance(); } }
@Bean public Bar bar() throws Exception { assertTrue(foo().isSingleton()); return new Bar(foo().getObject()); } }
/** * Destroy the singleton instance, if any. * @see #destroyInstance(Object) */ public void destroy() throws Exception { if (isSingleton()) { destroyInstance(this.singletonInstance); } }
/** * Eagerly create the singleton instance, if necessary. */ public void afterPropertiesSet() throws Exception { if (isSingleton()) { this.initialized = true; this.singletonInstance = createInstance(); this.earlySingletonInstance = null; } }
/** * Expose the singleton instance or create a new prototype instance. * @see #createInstance() * @see #getEarlySingletonInterfaces() */ public final T getObject() throws Exception { if (isSingleton()) { return (this.initialized ? this.singletonInstance : getEarlySingletonInstance()); } else { return createInstance(); } }
/** * Destroy the singleton instance, if any. * @see #destroyInstance(Object) */ @Override public void destroy() throws Exception { if (isSingleton()) { destroyInstance(this.singletonInstance); } }
/** * Eagerly create the singleton instance, if necessary. */ @Override public void afterPropertiesSet() throws Exception { if (isSingleton()) { this.initialized = true; this.singletonInstance = createInstance(); this.earlySingletonInstance = null; } }
/** * Expose the singleton instance or create a new prototype instance. * @see #createInstance() * @see #getEarlySingletonInterfaces() */ @Override public final T getObject() throws Exception { if (isSingleton()) { return (this.initialized ? this.singletonInstance : getEarlySingletonInstance()); } else { return createInstance(); } }