I was thinking, and would suggest, exactly the same thing as Neil! Sincerely, - Ray
On Wed, Oct 19, 2016 at 7:04 AM, Neil Bartlett <[email protected]> wrote: > Change the logic of the update… instead of always replacing the > security.policy file, replace it only if it is not already in the required > state. This makes your bundle idempotent (it doesn’t matter how many times > it is called) which is a much more robust approach. > > Neil > > > On 19 Oct 2016, at 07:05, sid19039 <[email protected]> wrote: > > > > Hello Ray, > > > > Thanks for your reply. Following is our use case: > > > > we are making a bundle which would be used as a security patch meant to > > update a security.policy file. > > Now the scenario is that we are deploying that bundle on to a felix > > framework target via Apache Ace server. For the very first time when it > > starts, it updates the file - which is ok. But Apache Ace server > refreshes > > the felix framework i.e it restarts all of the bundles installed > previously > > also each time some new bundle is deployed onto the target. Due to which > our > > security bundle also restarts and update security.policy file again > which is > > not required. So we want it(the bundle) to be removed from the framework > > once it updates the file or simply runs only once until somebody tries to > > update the file by deploying its new version. > > > > Any suggestions would be very helpful. > > > > Regards > > Siddharth > > > > > > > > -- > > View this message in context: http://apache-felix.18485.x6. > nabble.com/how-can-a-bundle-stop-itself-programmatically- > tp5018885p5018894.html > > Sent from the Apache Felix - Users mailing list archive at Nabble.com. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile> (@rotty3000) Senior Software Architect *Liferay, Inc.* <http://www.liferay.com> (@Liferay) Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

