/** * Set the init method for this definition. */ public BeanDefinitionBuilder setInitMethodName(@Nullable String methodName) { this.beanDefinition.setInitMethodName(methodName); return this; }
/** * Set the init method for this definition. */ public BeanDefinitionBuilder setInitMethodName(@Nullable String methodName) { this.beanDefinition.setInitMethodName(methodName); return this; }
bd.setInitMethodName(initMethodName); bd.setInitMethodName(this.defaults.getInitMethod()); bd.setEnforceInitMethod(false);
bd.setInitMethodName(newValue.toString());
bd.setInitMethodName(newValue.toString());
bd.setInitMethodName(newValue.toString());
bd.setInitMethodName(initMethodName); bd.setInitMethodName(this.defaults.getInitMethod()); bd.setEnforceInitMethod(false);
/** * Apply the provided default values to this bean. * @param defaults the defaults to apply */ public void applyDefaults(BeanDefinitionDefaults defaults) { setLazyInit(defaults.isLazyInit()); setAutowireMode(defaults.getAutowireMode()); setDependencyCheck(defaults.getDependencyCheck()); setInitMethodName(defaults.getInitMethodName()); setEnforceInitMethod(false); setDestroyMethodName(defaults.getDestroyMethodName()); setEnforceDestroyMethod(false); }
/** * Set the init method for this definition. */ public BeanDefinitionBuilder setInitMethodName(String methodName) { this.beanDefinition.setInitMethodName(methodName); return this; }
/** * Apply the provided default values to this bean. * @param defaults the defaults to apply */ public void applyDefaults(BeanDefinitionDefaults defaults) { setLazyInit(defaults.isLazyInit()); setAutowireMode(defaults.getAutowireMode()); setDependencyCheck(defaults.getDependencyCheck()); setInitMethodName(defaults.getInitMethodName()); setEnforceInitMethod(false); setDestroyMethodName(defaults.getDestroyMethodName()); setEnforceDestroyMethod(false); }
setLenientConstructorResolution(otherAbd.isLenientConstructorResolution()); if (otherAbd.getInitMethodName() != null) { setInitMethodName(otherAbd.getInitMethodName()); setEnforceInitMethod(otherAbd.isEnforceInitMethod());
setLenientConstructorResolution(otherAbd.isLenientConstructorResolution()); if (otherAbd.getInitMethodName() != null) { setInitMethodName(otherAbd.getInitMethodName()); setEnforceInitMethod(otherAbd.isEnforceInitMethod());
setNonPublicAccessAllowed(originalAbd.isNonPublicAccessAllowed()); setLenientConstructorResolution(originalAbd.isLenientConstructorResolution()); setInitMethodName(originalAbd.getInitMethodName()); setEnforceInitMethod(originalAbd.isEnforceInitMethod()); setDestroyMethodName(originalAbd.getDestroyMethodName());
private void setBaseProperties(AbstractBeanDefinition definition) { definition.setAbstract(true); definition.setAttribute("foo", "bar"); definition.setAutowireCandidate(false); definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE); // definition.getConstructorArgumentValues().addGenericArgumentValue("foo"); definition.setDependencyCheck(AbstractBeanDefinition.DEPENDENCY_CHECK_OBJECTS); definition.setDependsOn(new String[] { "foo", "bar" }); definition.setDestroyMethodName("destroy"); definition.setEnforceDestroyMethod(false); definition.setEnforceInitMethod(true); definition.setFactoryBeanName("factoryBean"); definition.setFactoryMethodName("factoryMethod"); definition.setInitMethodName("init"); definition.setLazyInit(true); definition.getMethodOverrides().addOverride(new LookupOverride("foo", "bar")); definition.getMethodOverrides().addOverride(new ReplaceOverride("foo", "bar")); definition.getPropertyValues().add("foo", "bar"); definition.setResourceDescription("desc"); definition.setRole(BeanDefinition.ROLE_APPLICATION); definition.setScope(BeanDefinition.SCOPE_PROTOTYPE); definition.setSource("foo"); }
setNonPublicAccessAllowed(originalAbd.isNonPublicAccessAllowed()); setLenientConstructorResolution(originalAbd.isLenientConstructorResolution()); setInitMethodName(originalAbd.getInitMethodName()); setEnforceInitMethod(originalAbd.isEnforceInitMethod()); setDestroyMethodName(originalAbd.getDestroyMethodName());
String initMethodName = ele.getAttribute(INIT_METHOD_ATTRIBUTE); if (!"".equals(initMethodName)) { bd.setInitMethodName(initMethodName); bd.setInitMethodName(this.defaults.getInitMethod()); bd.setEnforceInitMethod(false);
/** * Apply the provided default values to this bean. * @param defaults the defaults to apply */ public void applyDefaults(BeanDefinitionDefaults defaults) { setLazyInit(defaults.isLazyInit()); setAutowireMode(defaults.getAutowireMode()); setDependencyCheck(defaults.getDependencyCheck()); setInitMethodName(defaults.getInitMethodName()); setEnforceInitMethod(false); setDestroyMethodName(defaults.getDestroyMethodName()); setEnforceDestroyMethod(false); }
@Override protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { // We don't want spring managing lifecycle anymore, but since this module // is going to be rewritten, it doesn't make sense to spend time in removing this // init method AbstractBeanDefinition beanDefinition = super.parseInternal(element, parserContext); beanDefinition.setInitMethodName(Initialisable.PHASE_NAME); return beanDefinition; } };
setLenientConstructorResolution(otherAbd.isLenientConstructorResolution()); if (StringUtils.hasLength(otherAbd.getInitMethodName())) { setInitMethodName(otherAbd.getInitMethodName()); setEnforceInitMethod(otherAbd.isEnforceInitMethod());
setNonPublicAccessAllowed(originalAbd.isNonPublicAccessAllowed()); setLenientConstructorResolution(originalAbd.isLenientConstructorResolution()); setInitMethodName(originalAbd.getInitMethodName()); setEnforceInitMethod(originalAbd.isEnforceInitMethod()); setDestroyMethodName(originalAbd.getDestroyMethodName());