@Override public void afterPropertiesSet() throws Exception { prepare(); if (this.singleton) { this.initialized = true; this.singletonObject = invokeWithTargetException(); } }
/** * Returns the same value each time if the singleton property is set * to "true", otherwise returns the value returned from invoking the * specified method on the fly. */ @Override @Nullable public Object getObject() throws Exception { if (this.singleton) { if (!this.initialized) { throw new FactoryBeanNotInitializedException(); } // Singleton: return shared object. return this.singletonObject; } else { // Prototype: new object on each call. return invokeWithTargetException(); } }
@Override public void afterPropertiesSet() throws Exception { prepare(); if (this.singleton) { this.initialized = true; this.singletonObject = invokeWithTargetException(); } }
/** * Returns the same value each time if the singleton property is set * to "true", otherwise returns the value returned from invoking the * specified method on the fly. */ @Override @Nullable public Object getObject() throws Exception { if (this.singleton) { if (!this.initialized) { throw new FactoryBeanNotInitializedException(); } // Singleton: return shared object. return this.singletonObject; } else { // Prototype: new object on each call. return invokeWithTargetException(); } }
@Override public void afterPropertiesSet() throws Exception { prepare(); if (this.singleton) { this.initialized = true; this.singletonObject = invokeWithTargetException(); } }
/** * Returns the same value each time if the singleton property is set * to "true", otherwise returns the value returned from invoking the * specified method on the fly. */ @Override public Object getObject() throws Exception { if (this.singleton) { if (!this.initialized) { throw new FactoryBeanNotInitializedException(); } // Singleton: return shared object. return this.singletonObject; } else { // Prototype: new object on each call. return invokeWithTargetException(); } }