@Override public Object getObject() { if (this.proxy == null) { throw new FactoryBeanNotInitializedException(); } return this.proxy; }
@Override public Object getObject() { if (this.proxy == null) { throw new FactoryBeanNotInitializedException(); } return this.proxy; }
@Override @Nullable public Object getObject() throws IllegalAccessException { if (this.fieldObject == null) { throw new FactoryBeanNotInitializedException(); } ReflectionUtils.makeAccessible(this.fieldObject); if (this.targetObject != null) { // instance field return this.fieldObject.get(this.targetObject); } else { // class field return this.fieldObject.get(null); } }
/** * 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(); } }
/** * Determine an 'early singleton' instance, exposed in case of a * circular reference. Not called in a non-circular scenario. */ @SuppressWarnings("unchecked") private T getEarlySingletonInstance() throws Exception { Class<?>[] ifcs = getEarlySingletonInterfaces(); if (ifcs == null) { throw new FactoryBeanNotInitializedException( getClass().getName() + " does not support circular references"); } if (this.earlySingletonInstance == null) { this.earlySingletonInstance = (T) Proxy.newProxyInstance( this.beanClassLoader, ifcs, new EarlySingletonInvocationHandler()); } return this.earlySingletonInstance; }
@Override @Nullable public Object getObject() throws IllegalAccessException { if (this.fieldObject == null) { throw new FactoryBeanNotInitializedException(); } ReflectionUtils.makeAccessible(this.fieldObject); if (this.targetObject != null) { // instance field return this.fieldObject.get(this.targetObject); } else { // class field return this.fieldObject.get(null); } }
/** * 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(); } }
/** * Determine an 'early singleton' instance, exposed in case of a * circular reference. Not called in a non-circular scenario. */ @SuppressWarnings("unchecked") private T getEarlySingletonInstance() throws Exception { Class<?>[] ifcs = getEarlySingletonInterfaces(); if (ifcs == null) { throw new FactoryBeanNotInitializedException( getClass().getName() + " does not support circular references"); } if (this.earlySingletonInstance == null) { this.earlySingletonInstance = (T) Proxy.newProxyInstance( this.beanClassLoader, ifcs, new EarlySingletonInvocationHandler()); } return this.earlySingletonInstance; }
private javax.batch.runtime.context.StepContext getCurrent() { org.springframework.batch.core.StepExecution curStepExecution = null; if(StepSynchronizationManager.getContext() != null) { curStepExecution = StepSynchronizationManager.getContext().getStepExecution(); } if(curStepExecution == null) { throw new FactoryBeanNotInitializedException("A StepExecution is required"); } StepContext context = contextHolder.get(); // If the current context applies to the current step, use it if(context != null && context.getStepExecutionId() == curStepExecution.getId()) { return context; } Properties stepProperties = batchPropertyContext.getStepProperties(curStepExecution.getStepName()); if(stepProperties != null) { context = new JsrStepContext(curStepExecution, stepProperties); } else { context = new JsrStepContext(curStepExecution, new Properties()); } contextHolder.set(context); return context; }
throw new FactoryBeanNotInitializedException("A JobExecution is required");
/** * Return the singleton instance of this class's proxy object, * lazily creating it if it hasn't been created already. * @return the shared singleton proxy */ private synchronized Object getSingletonInstance() { if (this.singletonInstance == null) { this.targetSource = freshTargetSource(); if (this.autodetectInterfaces && getProxiedInterfaces().length == 0 && !isProxyTargetClass()) { // Rely on AOP infrastructure to tell us what interfaces to proxy. Class<?> targetClass = getTargetClass(); if (targetClass == null) { throw new FactoryBeanNotInitializedException("Cannot determine target class for proxy"); } setInterfaces(ClassUtils.getAllInterfacesForClass(targetClass, this.proxyClassLoader)); } // Initialize the shared singleton instance. super.setFrozen(this.freezeProxy); this.singletonInstance = getProxy(createAopProxy()); } return this.singletonInstance; }
public Object getObject() throws BeansException { if (this.beanFactory == null) { throw new FactoryBeanNotInitializedException(); } return this.beanFactory.getBean(this.targetBeanName); }
public Object getObject() throws IllegalAccessException { if (this.fieldObject == null) { throw new FactoryBeanNotInitializedException(); } ReflectionUtils.makeAccessible(this.fieldObject); if (this.targetObject != null) { // instance field return this.fieldObject.get(this.targetObject); } else{ // class field return this.fieldObject.get(null); } }
public boolean isSingleton() { if (this.beanFactory == null) { throw new FactoryBeanNotInitializedException(); } return this.beanFactory.isSingleton(this.targetBeanName); }
public boolean isPrototype() { if (this.beanFactory == null) { throw new FactoryBeanNotInitializedException(); } return this.beanFactory.isPrototype(this.targetBeanName); }
/** * 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. */ 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 doInvoke(); } }
/** * Determine an 'eager singleton' instance, exposed in case of a * circular reference. Not called in a non-circular scenario. */ @SuppressWarnings("unchecked") private T getEarlySingletonInstance() throws Exception { Class[] ifcs = getEarlySingletonInterfaces(); if (ifcs == null) { throw new FactoryBeanNotInitializedException( getClass().getName() + " does not support circular references"); } if (this.earlySingletonInstance == null) { this.earlySingletonInstance = (T) Proxy.newProxyInstance( this.beanClassLoader, ifcs, new EarlySingletonInvocationHandler()); } return this.earlySingletonInstance; }
@Override public Object getObject() { if (this.proxy == null) { throw new FactoryBeanNotInitializedException(); } return this.proxy; }
@Override public Object getObject() { if (this.proxy == null) { throw new FactoryBeanNotInitializedException(); } return this.proxy; }
public Object getObject() throws Exception { if (ldapOperations==null) { throw new FactoryBeanNotInitializedException("contextSource ldapOperations property has not been set"); } if (managedClasses==null) { throw new FactoryBeanNotInitializedException("managedClasses property has not been set"); } if (converterManager==null) { throw new FactoryBeanNotInitializedException("converterManager property has not been set"); } return new OdmManagerImpl(converterManager, ldapOperations, managedClasses); }