Results 1 to 1 of 1

Thread: Custom namespace & deferred properties

  1. #1
    Join Date
    Aug 2012
    Posts
    7

    Default Custom namespace & deferred properties

    Hi,

    I'm implementing my custom namespace:AKKA (like Typesafe AKKA), but I've some questions:

    1) I want to populate some bean properties which are not directly exposed by FactoryBean, i.e. "injectableBean" property.

    I used BeanWrapper, but seems little elegant

    This is the code of my ActorFactoryBean:
    Code:
    		if ( !Collections.isEmpty( beanProperties ) ) {
    			final BeanWrapper wrapper = new BeanWrapperImpl( instance );
    			for ( final PropertyValue propertyValue : beanProperties) {
    				if ( propertyValue.isReference() ) {
    					final PropertyDescriptor propertyDescriptor = BeanUtils.getPropertyDescriptor( instance.getClass(), propertyValue.getName() );
    					if ( isNotNull( propertyDescriptor ) ) {
    						final Method writeMethodOfProperty = propertyDescriptor.getWriteMethod();
    						try {
    							writeMethodOfProperty.invoke( instance, getBeanFactory().getBean( (String) propertyValue.getValue() ) );
    						} catch ( Exception e ) {
    							...
    						}
    					}
    				} else {
    					wrapper.setPropertyValue( propertyValue );
    				}
    			}
    		}
    Code:
    	<akka:typed-actor id="serviceActor" interface="com.altran.spring.akka.test.config.ServiceActor"
    			implementation="com.altran.spring.akka.test.config.ServiceExecutorActor"
    			actors-context="defaultActorSystem">
    		<property name="injectableBean" ref="injectableBean" />
    	</akka:typed-actor>
    2) STS Content-assist doesn't work with "interface" attribute. How can i make it work, if feasible!

    Thanks in advance.
    Last edited by mborra; Mar 4th, 2013 at 03:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •