Hi,

My comment inline
On 2010-5-6, at 上午12:04, gnanda wrote:


Hi all,
I have a scenario where I need to create a singleton pojo class that will be deployed in smx (as OSGI service?) and could be started and stopped from management command. This class would contain a hashmap of some business entities reading from the database and cache in memory. The memory will be refreshed re-reading again on a notification send to the bean ( Not sure
yet, how to do this part though)

I have 2 more service assemblies deployed and they need to lookup entity by calling the above singleton bean class. My knowledge with SA and OSGI is not
very clear.

I have questions below

1)Should I create a serviceassemby containg one su having the smx- bean defined in it? or should I create an OSGI service wrapping up a POJO class?
Both way should work
Use JBI SA/SU way means two SUs communicate through NMR(two SUs are totally decoupled and only some message payload pass through between SU endpoint) Use OSGi Service means you can get service from one SU and invoke it directly just SAME AS normal java object invocation.

2)Can one su inside a SA call another su deployed inside another SA?
Not directly, only through NMR. In some case you can use proxy(e.g. cxf se proxy) which hide underlying details so you invoke one SU from another just LIKE normal java object invocation

3)When I list my SAs from karaf console by "list" command. Thay do not have "started" status though my SAs work as expected. Does that mean SA do not
have service life cycle ?
"started" status is only used for spring-dm, so if you SA bundle doesn't configured through spring-dm, then you won't see this status at all, it doesn't mean your SA don't have lifecycle.

Freeman

Please suggest


--
View this message in context: 
http://old.nabble.com/smx4.2-singleton-bean-class-with-its-own-service-life-cycle-tp28462815p28462815.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.



--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

Reply via email to