[ 
https://issues.apache.org/jira/browse/SLING-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617855#action_12617855
 ] 

Bertrand Delacretaz commented on SLING-587:
-------------------------------------------

Revision 680753 contains a first usable version, here's how to test it:

a) Installing and removing bundles
Create one or several folders named "bundles" somewhere under /libs or /apps in 
the repository (WebDAV is fine for that). These folders must exist before the 
jcrbundles service starts, as the service does not yet observe the creation of 
new folders.

Install the jcrbundle service (currently found under 
http://svn.eu.apache.org/repos/asf/incubator/sling/whiteboard/jcrbundles)

Copy an OSGi bundle jar file into a bundles folder, it should be installed 
after a few seconds. Try 
http://www.knopflerfish.org/releases/2.1.0/jars/desktop_awt/desktop_awt_all-2.0.0.jar
 for example, which shows a nice GUI OSGi console.

Remove the bundle jar file to uninstall the bundle.

b) Creating configurations
To test the configuration feature, create a file named 
org.apache.sling.commons.log.LogManager.cfg, with this content, in a bundles 
folder:

  org.apache.sling.commons.log.file=logs/error.log
  org.apache.sling.commons.log.file.number=5
  org.apache.sling.commons.log.file.size=10mb
  org.apache.sling.commons.log.level=info
  org.apache.sling.commons.log.pattern={0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* 
[{2}] {3} {5}

And watch the log level change in logs/error.log (under the Sling home 
directory) when changing the level parameter between "info" and "debug".

Note that the same config can be edited from the Sling console, which will show 
changes made in the cfg file, but the opposite is not true: changes made in the 
Sling console are not visible in the cfg file, that's a problem that we'll need 
to solve. Not to mention potential security implications - we might need to 
restrict what can be done with jcrbundles, or make sure that it doesn't mess 
with bundles and configs installed via other means.

Removing the cfg file causes the configuration to be deleted - in this case I 
think the log service continues to work with default parameters.

Configurations that use OSGi factories must be named like 
factoryName-instanceName.cfg

c) Debugging
jcrbundles logs lots of information about what it's doing, that can help 
troubleshooting it if needed.

d) Resync at service startup
Note that jcrbundles will resynchronize the OSGi state with what's in the 
bundles folders when the service starts: bundles and configs added, removed or 
updated while the service is not active are taken into account at the next 
restart.

> JcrBundlesManager
> -----------------
>
>                 Key: SLING-587
>                 URL: https://issues.apache.org/jira/browse/SLING-587
>             Project: Sling
>          Issue Type: Improvement
>          Components: OSGi
>            Reporter: Bertrand Delacretaz
>
> See http://markmail.org/message/wey5dod7cm7oalhr for a tentative spec

-- 
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