felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Whytock <dwhyt...@gmail.com>
Subject Re: Closing felix when bundle/service is finished
Date Tue, 21 Jun 2011 23:20:55 GMT
Okay.  If you have access to the framework, you can use
bundlecontext.getBundle(0).stop(); that should shut down the
framework.

Don

On Tue, Jun 21, 2011 at 6:43 PM, Justin Stoecker <jstoecker911@gmail.com> wrote:
> Hi Don,
>
> It's not *absolutely* necessary. The statistics bundle actually
> depends on other bundles, all of which I could use directly, but it
> would be desirable and/or interesting for learning purposes.
>
> Justin
>
> On Tue, Jun 21, 2011 at 6:36 PM, Donald Whytock <dwhytock@gmail.com> wrote:
>> Do you absolutely need the statistics bundle to run in a Felix
>> framework?  Or could you just include the bundle's .jar on your
>> classpath, instantiate the service object and run the method directly?
>>
>> Don
>>
>> On Tue, Jun 21, 2011 at 6:31 PM, Justin Stoecker <jstoecker911@gmail.com> wrote:
>>> Hi,
>>>
>>> I have a "statistics" bundle that provides the service of reading a
>>> file, doing some calculations, and writing a new file. Ideally, I
>>> would like to write a small command-line program inside an executable
>>> JAR (not a bundle) that would be used as follows:
>>>
>>> java -jar analyzer.jar file1 file2 file3 ...
>>>
>>> The host program in analyzer.jar would then launch an embedded
>>> framework, auto-deploy the statistics bundle, and use the service
>>> interface of that bundle. I read on the felix website that there are
>>> two options for this type of situation: having the service interfaces
>>> inside the host program (not something I want to do, as these bundles
>>> should not depend on this host program) or to use reflection. I am not
>>> sure how to use reflection for this purpose.
>>>
>>> As an alternative, I figured I could write a second bundle that reads
>>> a series of files from a fixed location and uses the statistics
>>> bundle, as both would be inside the OSGi container. I can put these
>>> bundles into the bundle directory of the stand-alone felix framework
>>> and this works; however, I don't want felix to keep running after all
>>> the files are processed.
>>>
>>> What is the cleanest and easiest way to accomplish the task of
>>> providing input (file names) to a service and having it shutdown when
>>> finished?
>>>
>>> Thanks,
>>> Justin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message