Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.ConstructorArgumentValues$ValueHolder


      assertEquals("Hi " + name, actual);
   }
  
   private void exercise(ValueHolderHome home) throws RemoteException, CreateException
   {
      ValueHolder bean = home.create("test");
      String actual = bean.getValue();
      assertEquals("test", actual);
   }
View Full Code Here


  
   @Test
   public void test1() throws Exception
   {
      ValueHolderHome home = lookup("ValueHolderBean/localHome", ValueHolderHome.class);
      ValueHolder bean = home.create("value");
      String actual = bean.getValue();
      assertEquals("value", actual);
   }
View Full Code Here

    GenericBeanDefinition bd = new GenericBeanDefinition();
    bd.setBeanClassName("org.jibeframework.core.util.ViewComponentFactory");
    bd.setScope(scope);
    bd.setAutowireMode(GenericBeanDefinition.AUTOWIRE_NO);
    bd.setDependencyCheck(AbstractBeanDefinition.DEPENDENCY_CHECK_NONE);
    ConstructorArgumentValues cav = bd.getConstructorArgumentValues();
    cav.addIndexedArgumentValue(0, file);
    BeanDefinitionHolder holder = new BeanDefinitionHolder(bd, beanName, new String[] {});
    BeanDefinitionReaderUtils.registerBeanDefinition(holder, fact);

  }
View Full Code Here

                    .addPropertyValue("bus", inject);
            } else if (BusWiringType.CONSTRUCTOR == beanDefinition
                .getAttribute(AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE)) {
                LOG.fine("Found " + AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE + " attribute "
                         + BusWiringType.CONSTRUCTOR + " on bean " + beanName);
                ConstructorArgumentValues constructorArgs = beanDefinition.getConstructorArgumentValues();
                insertConstructorArg(constructorArgs, inject);
            }
        }
    }
View Full Code Here

                    bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR);
                }
            }
            // constructorArgs
            else if(CONSTRUCTOR_ARGS.equals(property) && newValue instanceof List) {
                ConstructorArgumentValues cav = new ConstructorArgumentValues();
                List args = (List)newValue;
                for (Object e : args) {
                    cav.addGenericArgumentValue(e);
                }
                bd.setConstructorArgumentValues(cav);
            }
            // destroyMethod
            else if(DESTROY_METHOD.equals(property)) {
View Full Code Here

  }

  protected AbstractBeanDefinition createBeanDefinition() {
    AbstractBeanDefinition bd;
    if(constructorArgs.size() > 0) {
      ConstructorArgumentValues cav = new ConstructorArgumentValues();
            for (Object constructorArg : constructorArgs) {
                cav.addGenericArgumentValue(constructorArg);
            }
            if(StringUtils.isBlank(parentName)) {
                bd = new RootBeanDefinition(clazz,cav,null);
            }
            else {
View Full Code Here

  private GenericApplicationContext setupSqlSessionTemplate() {

    GenericApplicationContext genericApplicationContext = setupSqlSessionFactory();
    GenericBeanDefinition definition = new GenericBeanDefinition();
    definition.setBeanClass(SqlSessionTemplate.class);
    ConstructorArgumentValues constructorArgs = new ConstructorArgumentValues();
    constructorArgs.addGenericArgumentValue(new RuntimeBeanReference("sqlSessionFactory"));
    definition.setConstructorArgumentValues(constructorArgs);
    genericApplicationContext.registerBeanDefinition("sqlSessionTemplate", definition);
    return genericApplicationContext;
  }
View Full Code Here

    private String getLoginFormUrl(BeanDefinition entryPoint) {
        if (entryPoint == null) {
            return null;
        }

        ConstructorArgumentValues cavs = entryPoint.getConstructorArgumentValues();
        ValueHolder vh = cavs.getIndexedArgumentValue(0, String.class);
        if (vh == null) {
             return null;
        }

        // If the login URL is the default one, then it is assumed not to have been set explicitly
View Full Code Here

  @Test
  public void testScanWithExplicitSqlSessionTemplate() throws Exception {
    GenericBeanDefinition definition = new GenericBeanDefinition();
    definition.setBeanClass(SqlSessionTemplate.class);
    ConstructorArgumentValues constructorArgs = new ConstructorArgumentValues();
    constructorArgs.addGenericArgumentValue(new RuntimeBeanReference("sqlSessionFactory"));
    definition.setConstructorArgumentValues(constructorArgs);
    applicationContext.registerBeanDefinition("sqlSessionTemplate", definition);

    applicationContext.getBeanDefinition("mapperScanner").getPropertyValues().add(
        "sqlSessionTemplateBeanName", "sqlSessionTemplate");
View Full Code Here

  @Test
  public void testScanWithExplicitSqlSessionTemplate() throws Exception {
    GenericBeanDefinition definition = new GenericBeanDefinition();
    definition.setBeanClass(SqlSessionTemplate.class);
    ConstructorArgumentValues constructorArgs = new ConstructorArgumentValues();
    constructorArgs.addGenericArgumentValue(new RuntimeBeanReference("sqlSessionFactory"));
    definition.setConstructorArgumentValues(constructorArgs);
    applicationContext.registerBeanDefinition("sqlSessionTemplate", definition);

    applicationContext.register(AppConfigWithSqlSessionTemplate.class);
   
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.ConstructorArgumentValues$ValueHolder

Copyright © 2018 www.massapicom. 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.