Examples of afterPropertiesSet()


Examples of org.springframework.beans.factory.InitializingBean.afterPropertiesSet()

    @Override
    public void afterPropertiesSet() throws Exception {
        if (executor instanceof InitializingBean) {
            InitializingBean bean = (InitializingBean) executor;
            bean.afterPropertiesSet();
        }
    }
}
View Full Code Here

Examples of org.springframework.beans.factory.config.ListFactoryBean.afterPropertiesSet()

public class XmlBeanCollectionTests extends TestCase {

  public void testCollectionFactoryDefaults() throws Exception {
    ListFactoryBean listFactory = new ListFactoryBean();
    listFactory.setSourceList(new LinkedList());
    listFactory.afterPropertiesSet();
    assertTrue(listFactory.getObject() instanceof ArrayList);

    SetFactoryBean setFactory = new SetFactoryBean();
    setFactory.setSourceSet(new TreeSet());
    setFactory.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.beans.factory.config.MapFactoryBean.afterPropertiesSet()

    setFactory.afterPropertiesSet();
    assertTrue(setFactory.getObject() instanceof LinkedHashSet);

    MapFactoryBean mapFactory = new MapFactoryBean();
    mapFactory.setSourceMap(new TreeMap());
    mapFactory.afterPropertiesSet();
    assertTrue(mapFactory.getObject() instanceof LinkedHashMap);
  }

  public void testRefSubelement() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("collections.xml", getClass()));
View Full Code Here

Examples of org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet()

        if (staticMethod != null) {
            try {
                MethodInvokingFactoryBean factory = new MethodInvokingFactoryBean();
                factory.setStaticMethod(staticMethod);
                factory.setArguments(new Object[] { loggerName });
                factory.afterPropertiesSet();
               
                result = factory.getObject();
            } catch (Throwable e) {
                throw new FatalBeanException("Problem injecting logger.  " + e.getMessage(), e);
            }
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertiesFactoryBean.afterPropertiesSet()

  @Override
  public YarnEnvironmentConfigurer propertiesLocationId(String id, String[] locations) throws IOException {
    for (String location : locations) {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource(location));
      fb.afterPropertiesSet();
      getDataHolder(id).properties.putAll(fb.getObject());
    }
    return this;
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.SetFactoryBean.afterPropertiesSet()

    listFactory.afterPropertiesSet();
    assertTrue(listFactory.getObject() instanceof ArrayList);

    SetFactoryBean setFactory = new SetFactoryBean();
    setFactory.setSourceSet(new TreeSet());
    setFactory.afterPropertiesSet();
    assertTrue(setFactory.getObject() instanceof LinkedHashSet);

    MapFactoryBean mapFactory = new MapFactoryBean();
    mapFactory.setSourceMap(new TreeMap());
    mapFactory.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.beans.factory.wiring.BeanConfigurerSupport.afterPropertiesSet()

          return new BeanWiringInfo(beanName);
        }
      });
    }

    configurer.afterPropertiesSet();
    configurer.configureBean(this);
    configurer.destroy();
  }
}
View Full Code Here

Examples of org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping.afterPropertiesSet()

  public void beanMethodMappings() {
    StaticApplicationContext context = new StaticApplicationContext();
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(
        Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
    mapping.setApplicationContext(new StaticApplicationContext());
    mapping.afterPropertiesSet();
    context.getDefaultListableBeanFactory().registerSingleton("mapping", mapping);
    this.endpoint.setApplicationContext(context);
    Map<String, Object> result = this.endpoint.invoke();
    assertEquals(1, result.size());
    assertTrue(result.keySet().iterator().next().contains("/dump"));
View Full Code Here

Examples of org.springframework.cache.ehcache.EhCacheFactoryBean.afterPropertiesSet()

    if(env.getProperty("setting.cacheable", Boolean.class, Boolean.FALSE)){
      EhCacheFactoryBean cacheFactory = new EhCacheFactoryBean();
      //use default cache manager CacheManager.getInstance();
      cacheFactory.setCacheName("settingCache");
      try{
        cacheFactory.afterPropertiesSet();
      }catch(Exception e){
        //TODO: do something
        e.printStackTrace();
      }
      Ehcache settingCache = cacheFactory.getObject();
View Full Code Here

Examples of org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet()

  protected final CacheManager initCacheManager() throws IOException {

    EhCacheManagerFactoryBean factoryBean = new EhCacheManagerFactoryBean();
    factoryBean.setShared(isShared());
    factoryBean.setConfigLocation(ResourceUtils.createResource(getConfigLocation()));
    factoryBean.afterPropertiesSet();

    return factoryBean.getObject();

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.