You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ron Gavlin <rg...@yahoo.com> on 2008/04/09 14:29:01 UTC

SMX-Bean and StoreFactory/Store usage

I have a SMX-Bean Pojo that requires a StoreFactory &
Store. When the Pojo is initialized, I would like to
include code similar to that listed below:

if (store == null) {
    if (storeFactory == null) { 
        storeFactory = new MemoryStoreFactory(); 
    }
    store =
storeFactory.open(getServiceEndpoint().getKey());
}

For this use case, it would be convenient if a
ServiceEndpoint could be dependency-injected into my
Pojo using @Resource in the same way the
ComponentContext & DeliveryChannel are
dependency-injected. This would require a few line
change to
org.apache.servicemix.bean.BeanEndpoint.injectBean(final
Object target). 

1. Would this change to BeanEndpoint make sense?

2. Also, are there other general SMX-Bean use cases
where a StoreFactory and Store might be needed? If so,
would it make sense to expose these in the SMX-Bean
schema?

Let me know..

 * Ron