Announcement Announcement Module
Collapse
No announcement yet.
Custom namespace & deferred properties Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:02 AM.
Working...
X