Saturday 15 January 2011

osgi - ManagedServiceFactory using Blueprint -



osgi - ManagedServiceFactory using Blueprint -

the registration of managedservicefactory follows can done :-

private serviceregistration factoryservice; public void start(bundlecontext context) { dictionary props = new hashtable(); props.put("service.pid", "test.smssenderfactory"); factoryservice = context.registerservice(managedservicefactory.class.getname(), new smssenderfactory(), props); }

how can 1 in blueprint(sample illustration highly useful) ?

apache aries has back upwards managed services. can find examples in integration tests of apache aries design @ https://svn.apache.org/repos/asf/aries/trunk/blueprint/blueprint-itests/src/test/resources/managedservicefactorytest.xml. in case can alter code of smssenderfactory not implement managedservicefactory straight design you.

you can embed code (that gave sample in question) init-method of bean if question. in case managedservicefactory should unregistered in destroy method of bean.

third alternative leave design out of game. have managedservicefactory implementation, why don't register in activator of bundle?

fourth alternative utilize declarative services 1 of annotation set. in case metatype info generated , can configure smssender via webconsole.

i suggest utilize lastly option.

osgi blueprint-osgi

No comments:

Post a Comment