Examples of MutablePropertyValues


Examples of org.springframework.beans.MutablePropertyValues

    BeanDefinitionRegistry registry = parserContext.getRegistry();

    //Definition of the FS Directory
    RootBeanDefinition fsDirectoryBeanDefinition = new RootBeanDefinition(
                          FSDirectoryFactoryBean.class);
    fsDirectoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
    fsDirectoryBeanDefinition.getPropertyValues()
        .addPropertyValue(LOCATION_ATTRIBUTE, location);
    registry.registerBeanDefinition(FS_DIRECTORY_ID_PREFIX + id, fsDirectoryBeanDefinition);

    //Definition of the index factory
    RootBeanDefinition simpleIndexFactoryBeanDefinition = new RootBeanDefinition(
                          SimpleIndexFactoryBean.class);
    simpleIndexFactoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
    simpleIndexFactoryBeanDefinition.getPropertyValues()
        .addPropertyValue(DIRECTORY_ATTRIBUTE, new RuntimeBeanReference(FS_DIRECTORY_ID_PREFIX + id));
    simpleIndexFactoryBeanDefinition.getPropertyValues()
        .addPropertyValue(CREATE_ATTRIBUTE, new Boolean(create));
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

      }
    }
  }

  private void configureAnalyzer(Element element, RootBeanDefinition definition, ParserContext parserContext) {
    MutablePropertyValues propertyValues = definition.getPropertyValues();
    if( hasAnalyzerRef(element) ) {
      String analyzerRef = element.getAttribute(ANALYZER_REF_ATTRIBUTE);
      configureAnalyzerRef(propertyValues, analyzerRef);
    } else {
      configureInnerAnalyzer(element, definition, parserContext, propertyValues);
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        return executeCallable((Callable<?>) callable, properties);
    }

    private ActionResult executeCallable(Callable<?> callable, Map<String, String> properties) {
        BeanWrapper beanWrapper = new BeanWrapperImpl(callable);
        PropertyValues propertyValues = new MutablePropertyValues(properties);

        try {
            beanWrapper.setPropertyValues(propertyValues, true, false);
        } catch (Exception e) {
            LOGGER.debug("Error while setting bean properties", e);
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        assertEquals(RequiredStringValidator.class, validator.getClass());
    }

    public void testObtainActionBySpringName() throws Exception {
        sac.registerPrototype("simple-action", SimpleAction.class, new MutablePropertyValues());

        ActionConfig actionConfig = new ActionConfig.Builder("fs", "jim", "simple-action").build();
        Object action = objectFactory.buildBean(actionConfig.getClassName(), null);

        assertEquals(SimpleAction.class, action.getClass());
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        assertEquals(SimpleAction.class, action.getClass());
    }

    public void testObtainInterceptorBySpringName() throws Exception {
        sac.registerSingleton("timer-interceptor", TimerInterceptor.class, new MutablePropertyValues());

        InterceptorConfig iConfig = new InterceptorConfig.Builder("timer", "timer-interceptor").build();
        Interceptor interceptor = objectFactory.buildInterceptor(iConfig, new HashMap<String, String>());

        assertEquals(TimerInterceptor.class, interceptor.getClass());
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        assertEquals(TimerInterceptor.class, interceptor.getClass());
    }

    public void testObtainResultBySpringName() throws Exception {
        // TODO: Does this need to be a prototype?
        sac.registerPrototype("chaining-result", ActionChainResult.class, new MutablePropertyValues());

        ResultConfig rConfig = new ResultConfig.Builder(Action.SUCCESS, "chaining-result").build();
        Result result = objectFactory.buildResult(rConfig, ActionContext.getContext().getContextMap());

        assertEquals(ActionChainResult.class, result.getClass());
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        assertEquals(ActionChainResult.class, result.getClass());
    }

    public void testObtainValidatorBySpringName() throws Exception {
        sac.registerPrototype("expression-validator", ExpressionValidator.class, new MutablePropertyValues());

        Map<String, Object> extraContext = new HashMap<String, Object>();
        Validator validator = objectFactory.buildValidator("expression-validator", new HashMap<String, Object>(), extraContext);

        assertEquals(ExpressionValidator.class, validator.getClass());
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        assertTrue("Expected app context to have been set", foo.isApplicationContextSet());
    }

    public void testLookingUpAClassInstanceDelegatesToSpring() throws Exception {
        sac.registerPrototype("simple-action", SimpleAction.class, new MutablePropertyValues());

        Class clazz = objectFactory.getClassInstance("simple-action");

        assertNotNull("Nothing returned", clazz);
        assertEquals("Expected to have instance of SimpleAction returned", SimpleAction.class, clazz);
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

        objectFactory.setAutowireStrategy(AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE);

        sac.getBeanFactory().registerSingleton("bean", new TestBean());
        TestBean bean = (TestBean) sac.getBean("bean");

        sac.registerPrototype("simple-action", SimpleAction.class, new MutablePropertyValues());

        ActionConfig actionConfig = new ActionConfig.Builder("jim", "bob", "simple-action").build();
        SimpleAction simpleAction = (SimpleAction) objectFactory.buildBean(actionConfig.getClassName(), null);
        objectFactory.autoWireBean(simpleAction);
        assertEquals(simpleAction.getBean(), bean);
View Full Code Here

Examples of org.springframework.beans.MutablePropertyValues

    }

    public void testShouldUseConstructorBasedInjectionWhenCreatingABeanFromAClassName() throws Exception {
        SpringObjectFactory factory = (SpringObjectFactory) objectFactory;
        objectFactory.setAlwaysRespectAutowireStrategy(false);
        sac.registerSingleton("actionBean", SimpleAction.class, new MutablePropertyValues());

        ConstructorBean bean = (ConstructorBean) factory.buildBean(ConstructorBean.class, null);

        assertNotNull("Bean should not be null", bean);
        assertNotNull("Action should have been added via DI", bean.getAction());
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.