[ 
https://issues.apache.org/jira/browse/FELIX-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843824#action_12843824
 ] 

Oren Livne commented on FELIX-2182:
-----------------------------------

Dear Guillame:

I removed our copyright and added the ASF headers. Please let me know if you 
need any more changes and I'll be happy to upload another version if necessary.

I absolutely agree with you. I am not sure if I fixed any bug. It started as an 
original copy of the "osgi:list" code with one difference: an additional 
BundleListener that simply logs all events:

        <bean id="bundleListener" 
class="edu.utah.further.osgi.shell.BundleListener"
                init-method="afterPropertiesSet" />

        <service ref="bundleListener"           
interface="org.springframework.osgi.context.event.OsgiBundleApplicationContextListener"
 />

For some strange reason, either that or the exact place where I am loading my 
osgi-shell bundle into the bus, makes it catch almost all events. In most 
cases, it catches all events except its own start-up event.

As you mentioned, there is no guarantee that this version will catch all 
events. However, I recommend that you experiment with it and see if it works 
better in practice. Try to remove bundleListener and see if it makes any 
difference.

On an unrelated note, this version uses the Builder Pattern to construct the 
output list string, which you might find useful. It is much more flexible than 
the original version. It includes
- Multi-column view support.
- Ability to turn off and on version displays.
- Replaced the three boolean show* options by one enumerated "view" option.

I hope this code will help, at least in some way, even if it does not fully fix 
the spring event bug.

Best wishes,
Oren

> An improved "list" command implementation that correctly displays Spring 
> column status
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2182
>                 URL: https://issues.apache.org/jira/browse/FELIX-2182
>             Project: Felix
>          Issue Type: Improvement
>          Components: Karaf
>    Affects Versions: karaf-1.4.0
>         Environment: Felix OSGi container -- Karaf OSGi Shell.
>            Reporter: Oren Livne
>         Attachments: further-osgi-shell.zip, further-osgi-shell.zip
>
>
> Dear All,
> I'm lead developer of the FURTHeR (Federated Utah Research & 
> Translational Health e-Repository) project at the Biomedical Informatics 
> Department at the University of Utah, whose purpose is to develope 
> cutting edge infrastructure for clinical and translational sciences. You 
> can read more about our project at http://dev-app.further.utah.edu/portal
> We are using FUSE 4.2.0 that builds on top of Apache Felix - Karaf 1.4.0 
> as our ESB solution. We have encountered a known bug in felix: the 
> spring column is almost never populated upon restarting the bus. This 
> makes it hard for us to know when we break bundles, and forces us to 
> refresh them many times. See also
> https://issues.apache.org/jira/browse/FELIX-1717
> https://issues.apache.org/jira/browse/FELIX-1995
> Attached please find a zipped maven project with a custom command that 
> is almost identical to the standard "osgi:list", but when installed, 
> does display spring status correctly upon bus restart. Other 
> improvements to the original code (refactoring + using Spring.format())
> have also been incorporated, which might help improve future Karaf versions.
> Sincerely,
> Oren Livne

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to