You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:18:51 UTC

[sling-org-apache-sling-bundleresource-impl] annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator created (now 0326e37)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git.


      at 0326e37  (tag)
 tagging 0b8ea46cb8340dc0eb132d168818a4a8694c3473 (commit)
      by Felix Meschberger
      on Thu Jun 18 09:21:02 2009 +0000

- Log -----------------------------------------------------------------
org.apache.sling.bundleresource.impl-2.0.4-incubator
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 8adff11  SLING-256 create project folder for bundle resource provider
     new 3bdcb03  SLING-356 Add separate bundle for the BundleResourceProvider SLING-361 First steps towards simple path mapping (currently on the bang separator is supported)
     new 5b195a9  SLING-357 Replace the currently used pipe symbol (¦) by the bang (!) as described in the issue
     new f0dba22  Move licence and notice to top level dir.
     new 856967f  Add incubator disclaimer.
     new a7bb09a  Write first element in pom in one line (to avoid problems with the maven release plugin) and minor pom fixes.
     new 1a14d57  Update notice files.
     new 3e3593e  more svn:ignore
     new 3f9036b  Move constant to bundleresource module.
     new 15b9883  Exclude maven-eclipse.xml generated by the maven eclipse plugin.
     new 15a6979  SLING-450: Move bundleresource to extensions
     new a24d70f  Correct svn urls.
     new 20bd245  SLING-442: Clean up exports, imports, dependencies and used plugins.
     new 563a113  SLING-483: Add excludes for javadocs and fix javadocs (WiP)
     new 5febc09  SLING-495 - NOTICE files generated using mknotice script
     new 57a64c9  SLING-495 - NOTICE files updated according to changes in revision 662927
     new c85cf13  SLING-495 - NOTICE files regenerated with revision 663097 changes
     new 59c0fa2  Use released version of parent pom.
     new 9ae781f  Use released versions (or soon to be released versions).
     new 58ddc8d  [maven-release-plugin] prepare release org.apache.sling.bundleresource.impl-2.0.0-incubator
     new 57bef59  [maven-release-plugin] prepare for next development iteration
     new a0dfbaa  Set version to next development version.
     new 289fa2a  Fix reference to parent pom.
     new da5a589  SLING-521: Restore more notice files.
     new 5f9007c  SLING-521: Separate between notice files for bin and src dists.
     new 307890b  SLING-521: Separate between notice files for bin and src dists.
     new 8b16c7f  Change copyright year to 2008.
     new 58d9b04  Update to released versions.
     new f13eb00  [maven-release-plugin] prepare release org.apache.sling.bundleresource.impl-2.0.2-incubator
     new 307ef52  [maven-release-plugin] prepare for next development iteration
     new 10858ca  Use latest snapshots again to make project buildable.
     new 4df3710  Use released versions.
     new d6cb9d9  Use released parent pom where possible.
     new d37ef56  SLING-555 : Update all poms to use the latest parent pom; update parent pom to include the incubator repo for plugins and use latest plugins.
     new 09f50f8  SLING-641 cache bundle entries for better performance
     new 96010ff  Fix wrong license header ...
     new 500240f  Fix error message to reflect actual task, which failed
     new 854122c  SLING-641 Make the internal map of the cache be access-ordered (instead of insert-ordered) and wrap the maps in synchronized maps to prevent multi-threading issues plus JavaDoc and preparation for management support
     new 1ec1e98  SLING-644 Add plugin for the Felix Web Console
     new 52fa537  Use released version of webconsole.
     new e1d4f8a  SLING-808 : Increase version to 5-incubator-SNAPSHOT
     new 0f2cbbd  Update notice files to include 2009 in copyright statement.
     new d65e9b0  Remove unused imports.
     new cca4002  SLING-829 Cosmetics to the bundle/project names
     new 0ff3d3b  SLING-865 : Move to bundles
     new 95dbafa  SLING-865 : Adjust reactor pom and svn information in each module.
     new edbb969  SLING-865 : Adjust path to parent pom and add profiles for samples and contrib
     new 1d37570  SLING-872 : Use manifest header parser to parse entries and handle new path directive if available.
     new 56ddf9b  SLING-941: Lots of svn:eol-style settings missing
     new 724c1c2  [maven-release-plugin]  copy for tag org.apache.sling.bundleresource.impl-2.0.4-incubator
     new 3b32c6f  Move Sling to new TLP location
     new 0b8ea46  Move Sling to new TLP location

The 52 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-bundleresource-impl] 18/25: SLING-865 : Move to bundles

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 0ff3d3bb237aee07885e52836b18aedc43f19ed7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 13:53:06 2009 +0000

    SLING-865 : Move to bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource@746693 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 05/25: Use released versions.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 4df37106bd55eee5d26e0872d666791b121559fa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jun 23 11:56:25 2008 +0000

    Use released versions.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@670527 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index dad6be0..073af62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,12 +86,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.3-incubator-SNAPSHOT</version>
+            <version>2.0.2-incubator</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.resource</artifactId>
-            <version>2.0.3-incubator-SNAPSHOT</version>
+            <version>2.0.2-incubator</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 20/25: SLING-865 : Adjust path to parent pom and add profiles for samples and contrib

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit edbb969601f4eb8eaf40cce35a8bf234fb9cd1c6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 15:19:05 2009 +0000

    SLING-865 : Adjust path to parent pom and add profiles for samples and contrib
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource@746728 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index db2eaa9..ccb82a1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>5-incubator-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
     <artifactId>org.apache.sling.bundleresource.impl</artifactId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 21/25: SLING-872 : Use manifest header parser to parse entries and handle new path directive if available.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 1d37570f413d6e369d2bf69665dc9d0d23696e91
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 24 18:11:15 2009 +0000

    SLING-872 : Use manifest header parser to parse entries and handle new path directive if available.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource@747467 13f79535-47bb-0310-9956-ffa450edef68
---
 .../bundleresource/impl/BundleResourceProvider.java     | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
index 2cbee15..8f8e1f2 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -24,7 +24,6 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
-import java.util.StringTokenizer;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -32,6 +31,7 @@ import org.apache.sling.api.SlingException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.osgi.ManifestHeader;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -54,12 +54,15 @@ public class BundleResourceProvider implements ResourceProvider {
      */
     public BundleResourceProvider(Bundle bundle, String rootList) {
         this.bundle = new BundleResourceCache(bundle);
-
-        StringTokenizer pt = new StringTokenizer(rootList, ", \t\n\r\f");
         List<MappedPath> prefixList = new ArrayList<MappedPath>();
-        while (pt.hasMoreTokens()) {
-            String resourceRoot = pt.nextToken();
-            if (resourceRoot.length() > 0) {
+
+        final ManifestHeader header = ManifestHeader.parse(rootList);
+        for(final ManifestHeader.Entry entry : header.getEntries()) {
+            final String resourceRoot = entry.getValue();
+            final String pathDirective = entry.getDirectiveValue("path");
+            if ( pathDirective != null ) {
+                prefixList.add(new MappedPath(resourceRoot, pathDirective));
+            } else {
                 prefixList.add(MappedPath.create(resourceRoot));
             }
         }
@@ -69,7 +72,7 @@ public class BundleResourceProvider implements ResourceProvider {
     void registerService(BundleContext context) {
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         props.put(Constants.SERVICE_DESCRIPTION,
-            "Provider of Bundle based Resources");
+            "Provider of bundle based resources");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(ROOTS, getRoots());
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 13/25: Use released version of webconsole.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 52fa5370acb3913abdd4eba6ca8875c04a0ad84f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 29 17:46:05 2008 +0000

    Use released version of webconsole.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@708951 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c87e1fd..e83ae5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,7 +102,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <version>1.2.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 24/25: Move Sling to new TLP location

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 3b32c6f912fd7510ffc1b0b0b0f89f386ace06b4
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jun 18 09:21:02 2009 +0000

    Move Sling to new TLP location
    
    git-svn-id: https://svn.eu.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator@785979 13f79535-47bb-0310-9956-ffa450edef68
---
 LICENSE                                            | 202 +++++++++++++++
 NOTICE                                             |   9 +
 README.txt                                         |  38 +++
 pom.xml                                            | 125 +++++++++
 .../sling/bundleresource/impl/Activator.java       | 176 +++++++++++++
 .../sling/bundleresource/impl/BundleResource.java  | 226 +++++++++++++++++
 .../bundleresource/impl/BundleResourceCache.java   | 282 +++++++++++++++++++++
 .../impl/BundleResourceIterator.java               | 153 +++++++++++
 .../impl/BundleResourceProvider.java               | 160 ++++++++++++
 .../impl/BundleResourceURLConnection.java          | 112 ++++++++
 .../impl/BundleResourceURLStreamHandler.java       |  51 ++++
 .../impl/BundleResourceWebConsolePlugin.java       | 222 ++++++++++++++++
 .../sling/bundleresource/impl/MappedPath.java      | 101 ++++++++
 src/main/resources/META-INF/DISCLAIMER             |   7 +
 src/main/resources/META-INF/LICENSE                | 202 +++++++++++++++
 src/main/resources/META-INF/NOTICE                 |   9 +
 16 files changed, 2075 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..255444e
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,9 @@
+Apache Sling Bundle Resource Provider
+Copyright 2008-2009 The Apache Software Foundation
+
+Apache Sling is based on source code originally developed 
+by Day Software (http://www.day.com/).
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..480d767
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,38 @@
+Apache Sling Bundle Resource Provider
+
+Provides a ResourceProvider implementation supporting bundle
+based resources.
+
+Disclaimer
+==========
+Apache Sling is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Jackrabbit PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other
+successful ASF projects. While incubation status is not necessarily a reflection of
+the completeness or stability of the code, it does indicate that the project has yet
+to be fully endorsed by the ASF.
+
+Getting Started
+===============
+
+This component uses a Maven 2 (http://maven.apache.org/) build
+environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
+2.0.7 or later. We recommend to use the latest Maven version.
+
+If you have Maven 2 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 2 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource
+
+See the Subversion documentation for other source control features.
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..3f30ff5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>5-incubator</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.sling.bundleresource.impl</artifactId>
+    <packaging>bundle</packaging>
+    <version>2.0.4-incubator</version>
+
+    <name>Apache Sling Bundle Resource Provider</name>
+    <description>
+        Provides a ResourceProvider implementation supporting bundle
+        based resources.
+    </description>
+
+    <scm>
+        <connection>
+            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
+        </connection>
+        <developerConnection>
+            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
+        </developerConnection>
+        <url>
+            http://svn.apache.org/viewvc/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
+        </url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Activator>
+                            org.apache.sling.bundleresource.impl.Activator
+                        </Bundle-Activator>
+                        <Private-Package>
+                            org.apache.sling.bundleresource.*,
+                            org.osgi.util.tracker
+                        </Private-Package>
+                        <DynamicImport-Package>
+                            org.apache.felix.webconsole
+                        </DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <excludePackageNames>
+                        org.apache.sling.bundleresource
+                    </excludePackageNames>
+                </configuration>
+            </plugin>
+        </plugins>
+    </reporting>
+    <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.resource</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.webconsole</artifactId>
+            <version>1.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/Activator.java b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
new file mode 100644
index 0000000..33e7a60
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Activator implements BundleActivator, BundleListener {
+
+    /**
+     * The name of the bundle manifest header listing the resource provider root
+     * paths provided by the bundle (value is "Sling-Bundle-Resources").
+     */
+    public static final String BUNDLE_RESOURCE_ROOTS = "Sling-Bundle-Resources";
+
+    /**
+     * Fully qualified name of the Web Console Plugin class. This class will be
+     * loaded dynamically to prevent issues if the Felix Web Console is not
+     * installed in the system (value is
+     * "org.apache.sling.bundleresource.impl.BundleResourceWebConsolePlugin").
+     */
+    private static final String CONSOLE_PLUGIN_CLASS = "org.apache.sling.bundleresource.impl.BundleResourceWebConsolePlugin";
+
+    /**
+     * Name of the initialization method to call on the Web Console Plugin class
+     * (value is "initPlugin").
+     */
+    private static final String METHOD_INIT = "initPlugin";
+
+    /**
+     * Name of the shutdown method to call on the Web Console Plugin class
+     * (value is "destroyPlugin").
+     */
+    private static final String METHOD_DESTROY = "destroyPlugin";
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    private Map<Long, BundleResourceProvider> bundleResourceProviderMap = new HashMap<Long, BundleResourceProvider>();
+
+    private BundleContext bundleContext;
+
+    public void start(BundleContext context) throws Exception {
+
+        this.bundleContext = context;
+
+        context.addBundleListener(this);
+
+        try {
+            Bundle[] bundles = context.getBundles();
+            for (Bundle bundle : bundles) {
+                if (bundle.getState() == Bundle.ACTIVE) {
+                    // add bundle resource provider for active bundles
+                    addBundleResourceProvider(bundle);
+                }
+            }
+        } catch (Throwable t) {
+            log.error(
+                "activate: Problem while registering bundle resources for existing bundles",
+                t);
+        }
+
+        // hackery thing to prevent problems if the web console is not present
+        callMethod(CONSOLE_PLUGIN_CLASS, METHOD_INIT,
+            new Class<?>[] { BundleContext.class }, new Object[] { context });
+
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        // hackery thing to prevent problems if the web console is not present
+        callMethod(CONSOLE_PLUGIN_CLASS, METHOD_DESTROY, null, null);
+
+        context.removeBundleListener(this);
+        this.bundleContext = null;
+    }
+
+    /**
+     * Loads and unloads any components provided by the bundle whose state
+     * changed. If the bundle has been started, the components are loaded. If
+     * the bundle is about to stop, the components are unloaded.
+     * 
+     * @param event The <code>BundleEvent</code> representing the bundle state
+     *            change.
+     */
+    public void bundleChanged(BundleEvent event) {
+        switch (event.getType()) {
+            case BundleEvent.STARTED:
+                // register resource provider for the started bundle
+                addBundleResourceProvider(event.getBundle());
+                break;
+
+            case BundleEvent.STOPPED:
+                // remove resource provider after the bundle has stopped
+                removeBundleResourceProvider(event.getBundle());
+                break;
+        }
+    }
+
+    // ---------- Bundle provided resources -----------------------------------
+
+    private void addBundleResourceProvider(Bundle bundle) {
+        String prefixes = (String) bundle.getHeaders().get(
+            BUNDLE_RESOURCE_ROOTS);
+        if (prefixes != null) {
+            BundleResourceProvider brp = new BundleResourceProvider(bundle,
+                prefixes);
+            brp.registerService(bundleContext);
+            bundleResourceProviderMap.put(bundle.getBundleId(), brp);
+        }
+    }
+
+    private void removeBundleResourceProvider(Bundle bundle) {
+        BundleResourceProvider brp = bundleResourceProviderMap.remove(bundle.getBundleId());
+        if (brp != null) {
+            brp.unregisterService();
+        }
+    }
+
+    /**
+     * Helper method to call the static method <code>methodName</code> on the
+     * class <code>clazzName</code> with the given <code>args</code>. This
+     * method operates exclusively using reflection to prevent any issues if the
+     * class cannot be loaded.
+     * <p>
+     * The goal is to enable running the bundle resource provider without a hard
+     * dependency on the Felix Web Console.
+     * 
+     * @param clazzName The fully qualified name of the class whose static
+     *            method is to be called.
+     * @param methodName The name of the method to call. This method must be
+     *            declared in the given class.
+     * @param argTypes The types of arguments of the methods to be able to find
+     *            the method. This may be <code>null</code> if the method has
+     *            no arguments.
+     * @param args The actual arguments to the method. This may be
+     *            <code>null</code> if the method has no arguments.
+     */
+    private void callMethod(String clazzName, String methodName,
+            Class<?>[] argTypes, Object[] args) {
+        try {
+            Class<?> clazz = getClass().getClassLoader().loadClass(clazzName);
+            Method method = clazz.getDeclaredMethod(methodName, argTypes);
+            if (!method.isAccessible()) {
+                method.setAccessible(true);
+            }
+            method.invoke(null, args);
+        } catch (Throwable t) {
+            // ignore anything
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
new file mode 100644
index 0000000..af49830
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import static org.apache.jackrabbit.JcrConstants.NT_FILE;
+import static org.apache.jackrabbit.JcrConstants.NT_FOLDER;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.adapter.SlingAdaptable;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceMetadata;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** A Resource that wraps a Bundle entry */
+public class BundleResource extends SlingAdaptable implements Resource {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    private final ResourceResolver resourceResolver;
+
+    private final BundleResourceCache bundle;
+
+    private final MappedPath mappedPath;
+
+    private final String path;
+
+    private URL url;
+
+    private final String resourceType;
+
+    private final ResourceMetadata metadata;
+
+    public static BundleResource getResource(ResourceResolver resourceResolver,
+            BundleResourceCache bundle, MappedPath mappedPath,
+            String resourcePath) {
+
+        String entryPath = mappedPath.getEntryPath(resourcePath);
+
+        // first try, whether the bundle has an entry with a trailing slash
+        // which would be a folder. In this case we check whether the
+        // repository contains an item with the same path. If so, we
+        // don't create a BundleResource but instead return null to be
+        // able to return an item-based resource
+        URL entry = bundle.getEntry(entryPath.concat("/"));
+        if (entry != null) {
+            Session session = resourceResolver.adaptTo(Session.class);
+            if (session != null) {
+                try {
+                    if (session.itemExists(resourcePath)) {
+                        return null;
+                    }
+                } catch (RepositoryException re) {
+                    // don't care
+                }
+            }
+
+            // append the slash to path for next steps
+            resourcePath = resourcePath.concat("/");
+        }
+
+        // if there is no entry with a trailing slash, try plain name
+        // which would then of course be a file
+        if (entry == null) {
+            entry = bundle.getEntry(entryPath);
+        }
+
+        // here we either have a folder for which no same-named item exists
+        // or a bundle file
+        if (entry != null) {
+            return new BundleResource(resourceResolver, bundle, mappedPath,
+                resourcePath);
+        }
+
+        // the bundle does not contain the path
+        return null;
+    }
+
+    public BundleResource(ResourceResolver resourceResolver,
+            BundleResourceCache bundle, MappedPath mappedPath,
+            String resourcePath) {
+
+        this.resourceResolver = resourceResolver;
+        this.bundle = bundle;
+        this.mappedPath = mappedPath;
+
+        metadata = new ResourceMetadata();
+        metadata.setResolutionPath(resourcePath);
+        metadata.setCreationTime(bundle.getBundle().getLastModified());
+        metadata.setModificationTime(bundle.getBundle().getLastModified());
+
+        if (resourcePath.endsWith("/")) {
+
+            this.path = resourcePath.substring(0, resourcePath.length() - 1);
+            this.resourceType = NT_FOLDER;
+
+        } else {
+
+            this.path = resourcePath;
+            this.resourceType = NT_FILE;
+
+            try {
+                URL url = bundle.getEntry(mappedPath.getEntryPath(resourcePath));
+                metadata.setContentLength(url.openConnection().getContentLength());
+            } catch (Exception e) {
+                // don't care, we just have no content length
+            }
+        }
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    /** Returns <code>null</code>, bundle resources have no super type */
+    public String getResourceSuperType() {
+        return null;
+    }
+
+    public ResourceMetadata getResourceMetadata() {
+        return metadata;
+    }
+
+    public ResourceResolver getResourceResolver() {
+        return resourceResolver;
+    }
+
+    @SuppressWarnings("unchecked")
+    public <Type> Type adaptTo(Class<Type> type) {
+        if (type == InputStream.class) {
+            return (Type) getInputStream(); // unchecked cast
+        } else if (type == URL.class) {
+            return (Type) getURL(); // unchecked cast
+        }
+
+        // fall back to nothing
+        return super.adaptTo(type);
+    }
+
+    public String toString() {
+        return getClass().getSimpleName() + ", type=" + getResourceType()
+            + ", path=" + getPath();
+    }
+
+    // ---------- internal -----------------------------------------------------
+
+    /**
+     * Returns a stream to the bundle entry if it is a file. Otherwise returns
+     * <code>null</code>.
+     */
+    private InputStream getInputStream() {
+        // implement this for files only
+        if (isFile()) {
+            try {
+                URL url = getURL();
+                if (url != null) {
+                    return url.openStream();
+                }
+            } catch (IOException ioe) {
+                log.error(
+                    "getInputStream: Cannot get input stream for " + this, ioe);
+            }
+        }
+
+        // otherwise there is no stream
+        return null;
+    }
+
+    private URL getURL() {
+        if (url == null) {
+            try {
+                url = new URL(BundleResourceURLStreamHandler.PROTOCOL, null,
+                    -1, path, new BundleResourceURLStreamHandler(
+                        bundle.getBundle(), mappedPath.getEntryPath(path)));
+            } catch (MalformedURLException mue) {
+                log.error("getURL: Cannot get URL for " + this, mue);
+            }
+        }
+
+        return url;
+    }
+
+    Iterator<Resource> listChildren() {
+        return new BundleResourceIterator(this);
+    }
+
+    BundleResourceCache getBundle() {
+        return bundle;
+    }
+
+    MappedPath getMappedPath() {
+        return mappedPath;
+    }
+
+    boolean isFile() {
+        return NT_FILE.equals(getResourceType());
+    }
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
new file mode 100644
index 0000000..55b5aa5
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * The <code>BundleResourceCache</code> implements a simple caching for
+ * resources provided from a bundle. Each {@link BundleResourceProvider}
+ * instance uses an instance of this class to access the bundle resources (or
+ * bundle entries) through the cache.
+ * <p>
+ * The cache on the one hand caches single entries as URLs. The other part of
+ * the cache is for the child entries of a given bundle entry path. This caches
+ * lists of strings (entry path).
+ * <p>
+ * Currently the cache limits are fixed at {@value #CACHE_SIZE} for the entries
+ * cache and at {@value #LIST_CACHE_SIZE} for the child entries cache.
+ */
+class BundleResourceCache {
+
+    /**
+     * The maximum size of the single entry cache (value is 50).
+     */
+    private static final int CACHE_SIZE = 50;
+
+    /**
+     * The maximum size of the child entry cache (value is 20).
+     */
+    private static final int LIST_CACHE_SIZE = 20;
+
+    /**
+     * Sentinel for the single entry cache representing a missing entry to
+     * prevent looking for non-existing bundle entries multiple times (value is
+     * "file:///not_found").
+     */
+    private static final URL NOT_FOUND_URL;
+
+    /**
+     * Sentinel for the child entry cache representing a missing child list for
+     * a given path to prevent looking for non-existing bundle entries multiple
+     * times (value is an empty list).
+     */
+    private static final List<String> NOT_FOUND_CHILDREN = Collections.<String> emptyList();
+
+    /**
+     * Single entry cache. This is a synchronized map with a size limit.
+     */
+    private final Map<String, URL> cache;
+
+    /**
+     * The child entry cache. This is a synchronized map with a size limit.
+     */
+    private final Map<String, List<String>> listCache;
+
+    /**
+     * The Bundle providing the resource entries.
+     */
+    private final Bundle bundle;
+
+    // static initializer setting the NOT_FOUND_URL. Because the
+    // constructor may throw an exception we use a static initializer
+    // which fails the class initialization in the unlikely case
+    // of the URL constructor failing.
+    static {
+        try {
+            NOT_FOUND_URL = new URL("file:/not_found");
+        } catch (MalformedURLException mue) {
+            throw new ExceptionInInitializerError(mue);
+        }
+    }
+
+    /**
+     * Creates a new instance of this class providing access to the entries in
+     * the given <code>bundle</code>.
+     * 
+     * @param bundle
+     */
+    BundleResourceCache(Bundle bundle) {
+        this.bundle = bundle;
+
+        // create the limited maps wrapping in synchronized maps
+        this.cache = Collections.synchronizedMap(new BundleResourceMap<String, URL>(
+            CACHE_SIZE));
+        this.listCache = Collections.synchronizedMap(new BundleResourceMap<String, List<String>>(
+            LIST_CACHE_SIZE));
+    }
+
+    /**
+     * Returns the <code>Bundle</code> to which this instance provides access.
+     */
+    Bundle getBundle() {
+        return bundle;
+    }
+
+    /**
+     * Returns the entry in the underlying bundle at the given path. This path
+     * is assumed to be an absolute path. If relative it is resolved relative to
+     * the bundle root.
+     * <p>
+     * This method is backed by the <code>Bundle.getEntry(String)</code>
+     * method.
+     * 
+     * @param path The path to the bundle entry to return
+     * @return The URL to access the bundle entry or <code>null</code> if the
+     *         bundle does not contain the request entry.
+     */
+    URL getEntry(String path) {
+        URL url = cache.get(path);
+        if (url == null) {
+            url = bundle.getEntry(path);
+
+            if (url == null) {
+                url = NOT_FOUND_URL;
+            }
+
+            cache.put(path, url);
+        }
+
+        return (url == NOT_FOUND_URL) ? null : url;
+    }
+
+    /**
+     * Returns a list of bundle entry paths considered children of the given
+     * <code>parentPath</code>. This parent path is assumed to be an absolute
+     * path. If relative it is resolved relative to the bundle root.
+     * <p>
+     * This method is backed by the <code>Bundle.getEntryPaths(String)</code>
+     * method but returns an <code>Iterator<String></code> instead of an
+     * <code>Enumeration</code> of strings.
+     * 
+     * @param parentPath The path to the parent entry whose child entries are to
+     *            be returned.
+     * @return An <code>Iterator<String></code> providing the paths of
+     *         entries considered direct children of the <code>parentPath</code>
+     *         or <code>null</code> if the parent entry does not exist.
+     */
+    Iterator<String> getEntryPaths(String path) {
+        List<String> list = listCache.get(path);
+        if (list == null) {
+
+            @SuppressWarnings("unchecked")
+            Enumeration<String> entries = bundle.getEntryPaths(path);
+            if (entries != null && entries.hasMoreElements()) {
+                list = new LinkedList<String>();
+                while (entries.hasMoreElements()) {
+                    list.add(entries.nextElement());
+                }
+            }
+
+            if (list == null) {
+                list = NOT_FOUND_CHILDREN;
+            }
+
+            listCache.put(path, list);
+        }
+
+        return (list == NOT_FOUND_CHILDREN) ? null : list.iterator();
+    }
+
+    // ---------- Management API
+
+    /**
+     * Returns the current number of entries stored in the entry cache. This
+     * number includes "negative" entries, which are requested entries not found
+     * in the bundle.
+     */
+    int getEntryCacheSize() {
+        return cache.size();
+    }
+
+    /**
+     * Returns the maximum number of entries to be stored in the cache. This
+     * number is currently fixed at {@link #CACHE_SIZE}
+     */
+    int getEntryCacheMaxSize() {
+        return CACHE_SIZE;
+    }
+
+    /**
+     * Returns the current number of list entries stored in the list cache. This
+     * number includes "negative" list entries, which are requested list entries
+     * not found in the bundle.
+     */
+    int getListCacheSize() {
+        return listCache.size();
+    }
+
+    /**
+     * Returns the maximum number of list entries to be stored in the cache.
+     * This number is currently fixed at {@link #LIST_CACHE_SIZE}
+     */
+    int getListCacheMaxSize() {
+        return LIST_CACHE_SIZE;
+    }
+
+    // ---------- inner class
+
+    /**
+     * The <code>BundleResourceMap</code> class extends the
+     * <code>LinkedHashMap</code> class overwriting the
+     * {@link #removeEldestEntry(Entry)} method to implement the size limit,
+     * which is set in the constructor.
+     */
+    private static class BundleResourceMap<K, V> extends
+            LinkedHashMap<String, V> {
+
+        /**
+         * The default size of a bundle resource cache (value is 20).
+         */
+        private static final int DEFAULT_LIMIT = 20;
+
+        /**
+         * The limit configured for this map.
+         */
+        private final int limit;
+
+        /**
+         * Creates a new instance of this size limited map.
+         * 
+         * @param limit The maximum number of entries in this map. If this value
+         *            is less than or equal to zero, the default size of
+         *            {@link #DEFAULT_LIMIT} is used.
+         */
+        BundleResourceMap(int limit) {
+            // deliberately chosen initial size and load factor, but
+            // we need the access-order to implement the LRU mechanism
+            super(8, 0.75f, true);
+
+            // normalize size to a possitive number
+            if (limit <= 0) {
+                limit = DEFAULT_LIMIT;
+            }
+
+            this.limit = limit;
+        }
+
+        /**
+         * Returns the maximum number of entries to be stored in this map.
+         */
+        int getLimit() {
+            return limit;
+        }
+
+        /**
+         * Returns <code>true</code> if the current number of elements in the
+         * map exceeds the configured limit.
+         */
+        @Override
+        protected boolean removeEldestEntry(Entry<String, V> eldest) {
+            return size() > limit;
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
new file mode 100644
index 0000000..de19d7d
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>BundleResourceIterator</code> class is a resource iterator, which
+ * returns resources for each Bundle entry of an underlying enumeration of
+ * Bundle entry paths.
+ */
+class BundleResourceIterator implements Iterator<Resource> {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /** The bundle resource resolver */
+    private final ResourceResolver resourceResolver;
+
+    /** Bundle providing the entry resources */
+    private final BundleResourceCache bundle;
+
+    private final MappedPath mappedPath;
+
+    /** Underlying bundle entry path enumeration */
+    private final Iterator<String> entries;
+
+    /** The length of the parent entry path, see seek() */
+    private final int prefixLength;
+
+    /** The prefetched next iterator entry, null at the end of iterating */
+    private Resource nextResult;
+
+    /**
+     * Creates an instance using the given parent bundle resource.
+     */
+    BundleResourceIterator(BundleResource parent) {
+
+        if (parent.isFile()) {
+
+            // if the parent is a file, the iterator is empty
+            this.resourceResolver = null;
+            this.bundle = null;
+            this.entries = null;
+            this.prefixLength = 0;
+            this.mappedPath = null;
+            this.nextResult = null;
+
+        } else {
+            // trailing slash to enumerate children
+            String parentPath = parent.getPath().concat("/");
+
+            this.resourceResolver = parent.getResourceResolver();
+            this.bundle = parent.getBundle();
+            this.mappedPath = parent.getMappedPath();
+            this.entries = parent.getBundle().getEntryPaths(parentPath);
+            this.prefixLength = parentPath.length();
+
+            this.nextResult = (entries != null) ? seek() : null;
+        }
+    }
+
+    BundleResourceIterator(ResourceResolver resourceResolver, BundleResourceCache bundle,
+            MappedPath mappedPath, String parentPath) {
+
+        // trailing slash to enumerate children
+        if (!parentPath.endsWith("/")) {
+            parentPath = parentPath.concat("/");
+        }
+
+        this.resourceResolver = resourceResolver;
+        this.bundle = bundle;
+        this.mappedPath = mappedPath;
+        this.entries = bundle.getEntryPaths(parentPath);
+        this.prefixLength = parentPath.length();
+
+        this.nextResult = (entries != null) ? seek() : null;
+    }
+
+    /** Returns true if there is another Resource available */
+    public boolean hasNext() {
+        return nextResult != null;
+    }
+
+    /** Returns the next resource in the iterator */
+    public Resource next() {
+        if (!hasNext()) {
+            throw new NoSuchElementException();
+        }
+
+        Resource result = nextResult;
+        nextResult = seek();
+        return result;
+    }
+
+    /**
+     * Throws <code>UnsupportedOperationException</code> as this method is not
+     * supported by this implementation.
+     */
+    public void remove() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Scans the entry path enumeration looking for the next entry being a
+     * direct child of the parent resource.
+     */
+    private Resource seek() {
+        while (entries.hasNext()) {
+            String entry = entries.next();
+
+            // require leading slash
+            if (!entry.startsWith("/")) {
+                entry = "/" + entry;
+            }
+
+            int slash = entry.indexOf('/', prefixLength);
+            if (slash < 0 || slash == entry.length() - 1) {
+                log.debug("seek: Using entry {}", entry);
+                return new BundleResource(resourceResolver, bundle, mappedPath,
+                    entry);
+            }
+
+            log.debug("seek: Ignoring entry {}", entry);
+        }
+
+        // no more results
+        log.debug("seek: No more nodes, iterator exhausted");
+        return null;
+    }
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
new file mode 100644
index 0000000..8f8e1f2
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.api.SlingException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.osgi.ManifestHeader;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+
+public class BundleResourceProvider implements ResourceProvider {
+
+    /** The bundle providing the resources */
+    private final BundleResourceCache bundle;
+
+    /** The root paths */
+    private final MappedPath[] roots;
+
+    private ServiceRegistration serviceRegistration;
+
+    /**
+     * Creates Bundle resource provider accessing entries in the given Bundle an
+     * supporting resources below root paths given by the rootList which is a
+     * comma (and whitespace) separated list of absolute paths.
+     */
+    public BundleResourceProvider(Bundle bundle, String rootList) {
+        this.bundle = new BundleResourceCache(bundle);
+        List<MappedPath> prefixList = new ArrayList<MappedPath>();
+
+        final ManifestHeader header = ManifestHeader.parse(rootList);
+        for(final ManifestHeader.Entry entry : header.getEntries()) {
+            final String resourceRoot = entry.getValue();
+            final String pathDirective = entry.getDirectiveValue("path");
+            if ( pathDirective != null ) {
+                prefixList.add(new MappedPath(resourceRoot, pathDirective));
+            } else {
+                prefixList.add(MappedPath.create(resourceRoot));
+            }
+        }
+        this.roots = prefixList.toArray(new MappedPath[prefixList.size()]);
+    }
+
+    void registerService(BundleContext context) {
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        props.put(Constants.SERVICE_DESCRIPTION,
+            "Provider of bundle based resources");
+        props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+        props.put(ROOTS, getRoots());
+
+        serviceRegistration = context.registerService(SERVICE_NAME, this, props);
+    }
+
+    void unregisterService() {
+        if (serviceRegistration != null) {
+            serviceRegistration.unregister();
+        }
+    }
+
+    //---------- Web Console plugin support
+
+    BundleResourceCache getBundleResourceCache() {
+        return bundle;
+    }
+
+    MappedPath[] getMappedPaths() {
+        return roots;
+    }
+
+    //---------- internal
+
+    /** Returns the root paths */
+    private String[] getRoots() {
+        String[] rootPaths = new String[roots.length];
+        for (int i = 0; i < roots.length; i++) {
+            rootPaths[i] = roots[i].getResourceRoot();
+        }
+        return rootPaths;
+    }
+
+    private MappedPath getMappedPath(String resourcePath) {
+        for (MappedPath mappedPath : roots) {
+            if (mappedPath.isChild(resourcePath)) {
+                return mappedPath;
+            }
+        }
+
+        return null;
+    }
+
+    public Resource getResource(ResourceResolver resourceResolver,
+            HttpServletRequest request, String path) {
+        return getResource(resourceResolver, path);
+    }
+
+    /**
+     * Returns a BundleResource for the path if such an entry exists in the
+     * bundle of this provider. The JcrResourceResolver is ignored by this
+     * implementation.
+     */
+    public Resource getResource(ResourceResolver resourceResolver, String path) {
+        MappedPath mappedPath = getMappedPath(path);
+        if (mappedPath != null) {
+            return BundleResource.getResource(resourceResolver, bundle,
+                mappedPath, path);
+        }
+
+        return null;
+    }
+
+    public Iterator<Resource> listChildren(final Resource parent)
+            throws SlingException {
+
+        // bundle resources can handle this request directly
+        if (parent instanceof BundleResource) {
+            return ((BundleResource) parent).listChildren();
+        }
+
+        // ensure this provider may have children of the parent
+        String parentPath = parent.getPath();
+        MappedPath mappedPath = getMappedPath(parentPath);
+        if (mappedPath != null) {
+            return new BundleResourceIterator(parent.getResourceResolver(),
+                bundle, mappedPath, parentPath);
+        }
+
+        // the parent resource cannot have children in this provider,
+        // though this is basically not expected, we still have to
+        // be prepared for such a situation
+        return Collections.<Resource> emptyList().iterator();
+    }
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLConnection.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLConnection.java
new file mode 100644
index 0000000..c121be4
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLConnection.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * A Bundle based <code>UIRLConnection</code> which uses the bundle's last
+ * modification time as the last modification time of the URL in contrast to the
+ * (Apache Felix) URLConnection used for the bundle entry, which always returns
+ * zero.
+ */
+public class BundleResourceURLConnection extends URLConnection {
+
+    /** The bundle owning the resource underlying the URLConnection */
+    private final Bundle bundle;
+
+    private final String bundlePath;
+    
+    /** The original URLConnection */
+    private URLConnection delegatee;
+
+    protected BundleResourceURLConnection(Bundle bundle, String bundlePath, URL url) {
+        super(url);
+
+        this.bundle = bundle;
+        this.bundlePath = bundlePath;
+    }
+
+    /**
+     * Connects this URLConnection to access the data and metadata such as the
+     * content length, last modification time and content type.
+     */
+    public synchronized void connect() throws IOException {
+        if (!connected) {
+            URL url = bundle.getEntry(bundlePath);
+            if (url == null) {
+                throw new IOException("Cannot find entry " + bundlePath
+                    + " in bundle " + bundle + " for URL " + url);
+            }
+
+            delegatee = url.openConnection();
+
+            connected = true;
+        }
+    }
+
+    /** Returns the input stream of the Bundle provided URLConnection */
+    public InputStream getInputStream() throws IOException {
+        connect();
+
+        return delegatee.getInputStream();
+    }
+
+    /** Returns the content length of the Bundle provided URLConnection */
+    public int getContentLength() {
+        try {
+            connect();
+        } catch (IOException ex) {
+            return -1;
+        }
+
+        return delegatee.getContentLength();
+    }
+
+    /**
+     * Returns the last modification time of the underlying bundle, which is the
+     * last time the bundle was installed or updated
+     */
+    public long getLastModified() {
+        try {
+            connect();
+        } catch (IOException ex) {
+            return 0;
+        }
+
+        return bundle.getLastModified();
+    }
+
+    /** Returns the content type of the Bundle provided URLConnection */
+    public String getContentType() {
+        try {
+            connect();
+        } catch (IOException ex) {
+            return null;
+        }
+
+        return delegatee.getContentType();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLStreamHandler.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLStreamHandler.java
new file mode 100644
index 0000000..a27585a
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceURLStreamHandler.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+import org.osgi.framework.Bundle;
+
+class BundleResourceURLStreamHandler extends URLStreamHandler {
+
+    static final String PROTOCOL = "bundle";
+
+    private final Bundle bundle;
+    
+    private final String bundlePath;
+
+    BundleResourceURLStreamHandler(Bundle bundle, String bundlePath) {
+        this.bundle = bundle;
+        this.bundlePath = bundlePath;
+    }
+
+    @Override
+    protected URLConnection openConnection(URL u) throws IOException {
+        if (!PROTOCOL.equals(u.getProtocol())) {
+            throw new IOException("Cannot open connection to " + u
+                + ", wrong protocol");
+        }
+
+        return new BundleResourceURLConnection(bundle, bundlePath, u);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java
new file mode 100644
index 0000000..19dd77a
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.webconsole.AbstractWebConsolePlugin;
+import org.apache.felix.webconsole.WebConsoleConstants;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.util.tracker.ServiceTracker;
+
+class BundleResourceWebConsolePlugin extends AbstractWebConsolePlugin {
+
+    private static final String LABEL = "bundleresources";
+
+    private ServiceRegistration serviceRegistration;
+
+    private ServiceTracker providerTracker;
+
+    private List<BundleResourceProvider> provider = new ArrayList<BundleResourceProvider>();
+
+    //--------- setup and shutdown
+
+    private static BundleResourceWebConsolePlugin INSTANCE;
+    
+    static void initPlugin(BundleContext context) {
+        if (INSTANCE == null) {
+            BundleResourceWebConsolePlugin tmp = new BundleResourceWebConsolePlugin();
+            tmp.activate(context);
+            INSTANCE = tmp;
+        }
+    }
+    
+    static void destroyPlugin() {
+        if (INSTANCE != null) {
+            try {
+                INSTANCE.deactivate();
+            } finally {
+                INSTANCE = null;
+            }
+        }
+    }
+    
+    // private constructor to force using static setup and shutdown
+    private BundleResourceWebConsolePlugin() {
+    }
+
+    //---------- AbstractWebConsolePlugin implementation
+    
+    @Override
+    public String getLabel() {
+        return LABEL;
+    }
+
+    @Override
+    public String getTitle() {
+        return "Bundle Resource Provider";
+    }
+
+    @Override
+    protected void renderContent(HttpServletRequest req, HttpServletResponse res)
+            throws IOException {
+
+        PrintWriter pw = res.getWriter();
+
+        pw.println("<table class='content' cellpadding='0' cellspacing='0' width='100%'>");
+
+        pw.println("<tr class='content'>");
+        pw.println("<th colspan='2' class='content container'>Bundle Resource Provider</th>");
+        pw.println("</tr>");
+
+        BundleResourceProvider[] brp = provider.toArray(new BundleResourceProvider[provider.size()]);
+        for (BundleResourceProvider bundleResourceProvider : brp) {
+
+            BundleResourceCache cache = bundleResourceProvider.getBundleResourceCache();
+            MappedPath[] paths = bundleResourceProvider.getMappedPaths();
+
+            pw.println("<tr class='content'>");
+
+            pw.println("<td class='content'>");
+            pw.println(cache.getBundle().getBundleId());
+            pw.println("</td>");
+
+            pw.println("<td class='content'>");
+            pw.println(getName(cache.getBundle()));
+            pw.println("</td>");
+
+            pw.println("</tr>");
+
+            pw.println("<tr class='content'>");
+            pw.println("<td class='content'>&nbsp;</td>");
+
+            pw.println("<td class='content'>");
+
+            pw.println("<table>");
+
+            pw.println("<tr>");
+            pw.println("<td>Mappings</td>");
+            pw.println("<td>");
+            for (MappedPath mappedPath : paths) {
+                pw.print(mappedPath.getResourceRoot());
+                if (mappedPath.getEntryRoot() != null) {
+                    pw.print(" ==> ");
+                    pw.print(mappedPath.getEntryRoot());
+                }
+                pw.print("<br>");
+            }
+            pw.println("</td>");
+            pw.println("</tr>");
+
+            pw.println("<tr>");
+            pw.println("<td>Entry Cache</td>");
+            pw.printf("<td>Size: %d, Limit: %d</td>%n",
+                cache.getEntryCacheSize(), cache.getEntryCacheMaxSize());
+            pw.println("</tr>");
+
+            pw.println("<tr>");
+            pw.println("<td>List Cache</td>");
+            pw.printf("<td>Size: %d, Limit: %d</td>%n",
+                cache.getListCacheSize(), cache.getListCacheMaxSize());
+            pw.println("</tr>");
+
+            pw.println("</table>");
+
+            pw.println("</td>");
+            pw.println("</tr>");
+        }
+
+        pw.println("</table>");
+
+    }
+
+    public void activate(BundleContext context) {
+        super.activate(context);
+
+        providerTracker = new ServiceTracker(context,
+            ResourceProvider.SERVICE_NAME, null) {
+            @Override
+            public Object addingService(ServiceReference reference) {
+                Object service = super.addingService(reference);
+                if (service instanceof BundleResourceProvider) {
+                    provider.add((BundleResourceProvider) service);
+                }
+                return service;
+            }
+
+            @Override
+            public void removedService(ServiceReference reference,
+                    Object service) {
+                if (service instanceof BundleResourceProvider) {
+                    provider.remove(service);
+                }
+                super.removedService(reference, service);
+            }
+        };
+        providerTracker.open();
+
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        props.put(Constants.SERVICE_DESCRIPTION,
+            "Web Console Plugin for Bundle Resource Providers");
+        props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+        props.put(Constants.SERVICE_PID, getClass().getName());
+        props.put(WebConsoleConstants.PLUGIN_LABEL, LABEL);
+
+        serviceRegistration = context.registerService(
+            WebConsoleConstants.SERVICE_NAME, this, props);
+    }
+
+    public void deactivate() {
+        if (serviceRegistration != null) {
+            serviceRegistration.unregister();
+            serviceRegistration = null;
+        }
+
+        if (providerTracker != null) {
+            providerTracker.close();
+            providerTracker = null;
+        }
+
+        super.deactivate();
+    }
+
+    private String getName(Bundle bundle) {
+        String name = (String) bundle.getHeaders().get(Constants.BUNDLE_NAME);
+        if (name == null) {
+            name = bundle.getSymbolicName();
+            if (name == null) {
+                name = bundle.getLocation();
+            }
+        }
+        return name;
+    }
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/MappedPath.java b/src/main/java/org/apache/sling/bundleresource/impl/MappedPath.java
new file mode 100644
index 0000000..98b2fc0
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/MappedPath.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+class MappedPath {
+
+    private static final char prefixSeparatorChar = '!';
+    private final String resourceRoot;
+    private final String resourceRootPrefix;
+    private final String entryRoot;
+    private final String entryRootPrefix;
+
+    static MappedPath create(String configPath) {
+        String resourceRoot;
+        String entryRoot;
+        int prefixSep = configPath.indexOf(prefixSeparatorChar);
+        if (prefixSep >= 0) {
+            entryRoot = configPath.substring(prefixSep + 1);
+            resourceRoot = configPath.substring(0, prefixSep).concat(entryRoot);
+        } else {
+            resourceRoot = configPath;
+            entryRoot = null;
+        }
+        return new MappedPath(resourceRoot, entryRoot);
+    }
+    
+    MappedPath(String resourceRoot, String entryRoot) {
+        this.resourceRoot = resourceRoot;
+        this.resourceRootPrefix = ensureTrailingSlash(resourceRoot);
+        this.entryRoot = entryRoot;
+        this.entryRootPrefix = ensureTrailingSlash(entryRoot);
+    }
+    
+    boolean isChild(String resourcePath) {
+        return resourcePath.startsWith(resourceRootPrefix)
+            || resourcePath.equals(resourceRoot);
+    }
+    
+    String getEntryPath(String resourcePath) {
+        if (entryRootPrefix == null) {
+            return resourcePath;
+        }
+        
+        if (resourcePath.startsWith(resourceRootPrefix)) {
+            return entryRootPrefix.concat(resourcePath.substring(resourceRootPrefix.length()));
+        } else if (resourcePath.equals(resourceRoot)) {
+            return entryRoot;
+        }
+        
+        return null;
+    }
+    
+    String getResourceRoot() {
+        return resourceRoot;
+    }
+    
+    String getResourceRootPrefix() {
+        return resourceRootPrefix;
+    }
+    
+    String getEntryRoot() {
+        return entryRoot;
+    }
+    
+    String getEntryRootPrefix() {
+        return entryRootPrefix;
+    }
+    
+    private static String ensureTrailingSlash(String path) {
+        if (path == null || path.length() == 0) {
+            return null;
+        }
+        
+        if (!path.endsWith("/")) {
+            return path.concat("/");
+        }
+        
+        return path;
+    }
+    
+    @Override
+    public String toString() {
+        return "MappedPath: " + getResourceRoot() + " -> " + getEntryRoot();
+    }
+}
diff --git a/src/main/resources/META-INF/DISCLAIMER b/src/main/resources/META-INF/DISCLAIMER
new file mode 100644
index 0000000..90850c2
--- /dev/null
+++ b/src/main/resources/META-INF/DISCLAIMER
@@ -0,0 +1,7 @@
+Apache Sling is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Jackrabbit PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other
+successful ASF projects. While incubation status is not necessarily a reflection of
+the completeness or stability of the code, it does indicate that the project has yet
+to be fully endorsed by the ASF.
\ No newline at end of file
diff --git a/src/main/resources/META-INF/LICENSE b/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/src/main/resources/META-INF/NOTICE b/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..255444e
--- /dev/null
+++ b/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,9 @@
+Apache Sling Bundle Resource Provider
+Copyright 2008-2009 The Apache Software Foundation
+
+Apache Sling is based on source code originally developed 
+by Day Software (http://www.day.com/).
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 22/25: SLING-941: Lots of svn:eol-style settings missing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 56ddf9bfecac94652d3b6e226e6d411716929d24
Author: Jukka Zitting <ju...@apache.org>
AuthorDate: Fri Apr 24 12:14:03 2009 +0000

    SLING-941: Lots of svn:eol-style settings missing
    
    Set svn:eol-style to native on all Java files that lack the setting.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource@768268 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 07/25: SLING-555 : Update all poms to use the latest parent pom; update parent pom to include the incubator repo for plugins and use latest plugins.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit d37ef563f970eef481308ab0e6923e85f64bd2fa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 21 14:24:25 2008 +0000

    SLING-555 : Update all poms to use the latest parent pom; update parent pom to include the incubator repo for plugins and use latest plugins.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@678436 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 03c3b90..073af62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>3-incubator</version>
+        <version>4-incubator-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 10/25: Fix error message to reflect actual task, which failed

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 500240fd5efb1f8dd08b97f42b94377f8cc0a1ec
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Wed Sep 3 21:51:08 2008 +0000

    Fix error message to reflect actual task, which failed
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@691801 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/bundleresource/impl/Activator.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/Activator.java b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
index f9a8f85..f44565a 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
@@ -59,8 +59,9 @@ public class Activator implements BundleActivator, BundleListener {
                 }
             }
         } catch (Throwable t) {
-            log.error("activate: Problem while loading initial content and"
-                + " registering mappings for existing bundles", t);
+            log.error(
+                "activate: Problem while registering bundle resources for existing bundles",
+                t);
         }
     }
 
@@ -73,7 +74,7 @@ public class Activator implements BundleActivator, BundleListener {
      * Loads and unloads any components provided by the bundle whose state
      * changed. If the bundle has been started, the components are loaded. If
      * the bundle is about to stop, the components are unloaded.
-     *
+     * 
      * @param event The <code>BundleEvent</code> representing the bundle state
      *            change.
      */
@@ -111,5 +112,4 @@ public class Activator implements BundleActivator, BundleListener {
         }
     }
 
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 08/25: SLING-641 cache bundle entries for better performance

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 09f50f8e37926698b7246d20db939065a3fb2cc5
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Wed Sep 3 13:40:35 2008 +0000

    SLING-641 cache bundle entries for better performance
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@691609 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/bundleresource/impl/BundleResource.java  |  22 ++--
 .../bundleresource/impl/BundleResourceCache.java   | 124 +++++++++++++++++++++
 .../impl/BundleResourceIterator.java               |  20 ++--
 .../impl/BundleResourceProvider.java               |   8 +-
 4 files changed, 148 insertions(+), 26 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
index f9519b1..4b6f9d2 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
@@ -44,7 +44,7 @@ public class BundleResource extends SlingAdaptable implements Resource {
 
     private final ResourceResolver resourceResolver;
 
-    private final Bundle bundle;
+    private final BundleResourceCache bundle;
 
     private final MappedPath mappedPath;
 
@@ -57,7 +57,8 @@ public class BundleResource extends SlingAdaptable implements Resource {
     private final ResourceMetadata metadata;
 
     public static BundleResource getResource(ResourceResolver resourceResolver,
-            Bundle bundle, MappedPath mappedPath, String resourcePath) {
+            BundleResourceCache bundle, MappedPath mappedPath,
+            String resourcePath) {
 
         String entryPath = mappedPath.getEntryPath(resourcePath);
 
@@ -100,8 +101,9 @@ public class BundleResource extends SlingAdaptable implements Resource {
         return null;
     }
 
-    public BundleResource(ResourceResolver resourceResolver, Bundle bundle,
-            MappedPath mappedPath, String resourcePath) {
+    public BundleResource(ResourceResolver resourceResolver,
+            BundleResourceCache bundle, MappedPath mappedPath,
+            String resourcePath) {
 
         this.resourceResolver = resourceResolver;
         this.bundle = bundle;
@@ -109,8 +111,8 @@ public class BundleResource extends SlingAdaptable implements Resource {
 
         metadata = new ResourceMetadata();
         metadata.setResolutionPath(resourcePath);
-        metadata.setCreationTime(bundle.getLastModified());
-        metadata.setModificationTime(bundle.getLastModified());
+        metadata.setCreationTime(bundle.getBundle().getLastModified());
+        metadata.setModificationTime(bundle.getBundle().getLastModified());
 
         if (resourcePath.endsWith("/")) {
 
@@ -197,8 +199,8 @@ public class BundleResource extends SlingAdaptable implements Resource {
         if (url == null) {
             try {
                 url = new URL(BundleResourceURLStreamHandler.PROTOCOL, null,
-                    -1, path, new BundleResourceURLStreamHandler(bundle,
-                        mappedPath.getEntryPath(path)));
+                    -1, path, new BundleResourceURLStreamHandler(
+                        bundle.getBundle(), mappedPath.getEntryPath(path)));
             } catch (MalformedURLException mue) {
                 log.error("getURL: Cannot get URL for " + this, mue);
             }
@@ -211,14 +213,14 @@ public class BundleResource extends SlingAdaptable implements Resource {
         return new BundleResourceIterator(this);
     }
 
-    Bundle getBundle() {
+    BundleResourceCache getBundle() {
         return bundle;
     }
 
     MappedPath getMappedPath() {
         return mappedPath;
     }
-    
+
     boolean isFile() {
         return NT_FILE.equals(getResourceType());
     }
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
new file mode 100644
index 0000000..7718637
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
@@ -0,0 +1,124 @@
+/*
+ * $Url: $
+ * $Id: $
+ *
+ * Copyright 1997-2005 Day Management AG
+ * Barfuesserplatz 6, 4001 Basel, Switzerland
+ * All Rights Reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Day Management AG, ("Confidential Information"). You shall not
+ * disclose such Confidential Information and shall use it only in
+ * accordance with the terms of the license agreement you entered into
+ * with Day.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.osgi.framework.Bundle;
+
+public class BundleResourceCache {
+
+    private static final URL NOT_FOUND_URL;
+
+    private static final List<String> NOT_FOUND_CHILDREN = Collections.<String> emptyList();
+
+    private final BundleResourceMap<String, URL> cache;
+
+    private final BundleResourceMap<String, List<String>> listCache;
+
+    private final Bundle bundle;
+
+    static {
+        try {
+            NOT_FOUND_URL = new URL("file:///not_found");
+        } catch (MalformedURLException mue) {
+            throw new ExceptionInInitializerError(mue);
+        }
+    }
+
+    BundleResourceCache(Bundle bundle) {
+        this.bundle = bundle;
+        this.cache = new BundleResourceMap<String, URL>(50);
+        this.listCache = new BundleResourceMap<String, List<String>>(20);
+    }
+
+    Bundle getBundle() {
+        return bundle;
+    }
+    
+    URL getEntry(String path) {
+        URL url = cache.get(path);
+        if (url == null) {
+            url = bundle.getEntry(path);
+            
+            if (url == null) {
+                url = NOT_FOUND_URL;
+            }
+            
+            cache.put(path, url);
+        }
+
+        return (url == NOT_FOUND_URL) ? null : url;
+    }
+
+    Iterator<String> getEntryPaths(String path) {
+        List<String> list = listCache.get(path);
+        if (list == null) {
+            
+            @SuppressWarnings("unchecked")
+            Enumeration<String> entries = bundle.getEntryPaths(path);
+            if (entries != null && entries.hasMoreElements()) {
+                list = new LinkedList<String>();
+                while (entries.hasMoreElements()) {
+                    list.add(entries.nextElement());
+                }
+            }
+            
+            if (list == null) {
+                list = NOT_FOUND_CHILDREN;
+            }
+            
+            listCache.put(path, list);
+        }
+        
+        return (list == NOT_FOUND_CHILDREN) ? null : list.iterator();
+    }
+    
+    private static class BundleResourceMap<K, V> extends LinkedHashMap<String, V> {
+
+        /**
+         * The default size of a bundle resource cache.
+         */
+        public static final int DEFAULT_LIMIT = 100;
+        
+        private final int limit;
+        
+        BundleResourceMap(int limit) {
+            if (limit <= 0) {
+                limit = DEFAULT_LIMIT;
+            }
+            
+            this.limit = limit;
+        }
+        
+        /**
+         * Returns <code>true</code> if the current number of elements in the
+         * map exceeds the configured limit.
+         */
+        @Override
+        protected boolean removeEldestEntry(Entry<String, V> eldest) {
+            return size() > limit;
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
index d4f03bd..55a446f 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
@@ -42,12 +42,12 @@ class BundleResourceIterator implements Iterator<Resource> {
     private final ResourceResolver resourceResolver;
 
     /** Bundle providing the entry resources */
-    private final Bundle bundle;
+    private final BundleResourceCache bundle;
 
     private final MappedPath mappedPath;
     
     /** Underlying bundle entry path enumeration */
-    private final Enumeration<String> entries;
+    private final Iterator<String> entries;
 
     /** The length of the parent entry path, see seek() */
     private final int prefixLength;
@@ -58,7 +58,6 @@ class BundleResourceIterator implements Iterator<Resource> {
     /**
      * Creates an instance using the given parent bundle resource.
      */
-    @SuppressWarnings("unchecked")
     BundleResourceIterator(BundleResource parent) {
 
         if (parent.isFile()) {
@@ -78,17 +77,14 @@ class BundleResourceIterator implements Iterator<Resource> {
             this.resourceResolver = parent.getResourceResolver();
             this.bundle = parent.getBundle();
             this.mappedPath = parent.getMappedPath();
-            
-            // unchecked cast
             this.entries = parent.getBundle().getEntryPaths(parentPath);
             this.prefixLength = parentPath.length();
-            
-            this.nextResult = seek();
+
+            this.nextResult = (entries != null) ? seek() : null;
         }
     }
 
-    @SuppressWarnings("unchecked")
-    BundleResourceIterator(ResourceResolver resourceResolver, Bundle bundle,
+    BundleResourceIterator(ResourceResolver resourceResolver, BundleResourceCache bundle,
             MappedPath mappedPath, String parentPath) {
         
         // trailing slash to enumerate children
@@ -99,8 +95,6 @@ class BundleResourceIterator implements Iterator<Resource> {
         this.resourceResolver = resourceResolver;
         this.bundle = bundle;
         this.mappedPath = mappedPath;
-        
-        // unchecked cast
         this.entries = bundle.getEntryPaths(parentPath);
         this.prefixLength = parentPath.length();
 
@@ -136,8 +130,8 @@ class BundleResourceIterator implements Iterator<Resource> {
      * direct child of the parent resource.
      */
     private Resource seek() {
-        while (entries.hasMoreElements()) {
-            String entry = entries.nextElement();
+        while (entries.hasNext()) {
+            String entry = entries.next();
 
             // require leading slash
             if (!entry.startsWith("/")) {
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
index 7347209..c9e71ff 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -18,12 +18,14 @@
  */
 package org.apache.sling.bundleresource.impl;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
 
 import javax.servlet.http.HttpServletRequest;
@@ -40,20 +42,20 @@ import org.osgi.framework.ServiceRegistration;
 public class BundleResourceProvider implements ResourceProvider {
 
     /** The bundle providing the resources */
-    private final Bundle bundle;
+    private final BundleResourceCache bundle;
 
     /** The root paths */
     private final MappedPath[] roots;
 
     private ServiceRegistration serviceRegistration;
-
+    
     /**
      * Creates Bundle resource provider accessing entries in the given Bundle an
      * supporting resources below root paths given by the rootList which is a
      * comma (and whitespace) separated list of absolute paths.
      */
     public BundleResourceProvider(Bundle bundle, String rootList) {
-        this.bundle = bundle;
+        this.bundle = new BundleResourceCache(bundle);
 
         StringTokenizer pt = new StringTokenizer(rootList, ", \t\n\r\f");
         List<MappedPath> prefixList = new ArrayList<MappedPath>();

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 01/25: Update to released versions.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 58d9b04e35396793935ca62e004f2aa35385d6a1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jun 17 06:57:15 2008 +0000

    Update to released versions.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@668413 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 43467d7..2fd4a4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>2-incubator-SNAPSHOT</version>
+        <version>3-incubator</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 
@@ -86,12 +86,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.1-incubator-SNAPSHOT</version>
+            <version>2.0.2-incubator</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.resource</artifactId>
-            <version>2.0.1-incubator-SNAPSHOT</version>
+            <version>2.0.2-incubator</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 06/25: Use released parent pom where possible.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit d6cb9d98f3cb522bdd0271bfe3fe0eed6ae92dda
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jun 23 12:07:27 2008 +0000

    Use released parent pom where possible.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@670529 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 073af62..03c3b90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>4-incubator-SNAPSHOT</version>
+        <version>3-incubator</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 12/25: SLING-644 Add plugin for the Felix Web Console

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 1ec1e9888b6d52b1b00af504e3dd0f9da24dc36d
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Sep 4 07:40:03 2008 +0000

    SLING-644 Add plugin for the Felix Web Console
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@691895 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  28 ++-
 .../sling/bundleresource/impl/Activator.java       |  61 ++++++
 .../impl/BundleResourceWebConsolePlugin.java       | 222 +++++++++++++++++++++
 3 files changed, 303 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index 073af62..c87e1fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,19 +37,21 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/bundleresource</url>
+        <connection>
+            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource
+        </connection>
+        <developerConnection>
+            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource
+        </developerConnection>
+        <url>
+            http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/bundleresource
+        </url>
     </scm>
 
     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
                 <configuration>
@@ -58,8 +60,12 @@
                             org.apache.sling.bundleresource.impl.Activator
                         </Bundle-Activator>
                         <Private-Package>
-                            org.apache.sling.bundleresource.*
+                            org.apache.sling.bundleresource.*,
+                            org.osgi.util.tracker
                         </Private-Package>
+                        <DynamicImport-Package>
+                            org.apache.felix.webconsole
+                        </DynamicImport-Package>
                     </instructions>
                 </configuration>
             </plugin>
@@ -95,11 +101,17 @@
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.webconsole</artifactId>
+            <version>1.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.osgi.compendium</artifactId>
+            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/Activator.java b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
index f44565a..33e7a60 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/Activator.java
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.bundleresource.impl;
 
+import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -37,6 +38,26 @@ public class Activator implements BundleActivator, BundleListener {
      */
     public static final String BUNDLE_RESOURCE_ROOTS = "Sling-Bundle-Resources";
 
+    /**
+     * Fully qualified name of the Web Console Plugin class. This class will be
+     * loaded dynamically to prevent issues if the Felix Web Console is not
+     * installed in the system (value is
+     * "org.apache.sling.bundleresource.impl.BundleResourceWebConsolePlugin").
+     */
+    private static final String CONSOLE_PLUGIN_CLASS = "org.apache.sling.bundleresource.impl.BundleResourceWebConsolePlugin";
+
+    /**
+     * Name of the initialization method to call on the Web Console Plugin class
+     * (value is "initPlugin").
+     */
+    private static final String METHOD_INIT = "initPlugin";
+
+    /**
+     * Name of the shutdown method to call on the Web Console Plugin class
+     * (value is "destroyPlugin").
+     */
+    private static final String METHOD_DESTROY = "destroyPlugin";
+
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -63,9 +84,17 @@ public class Activator implements BundleActivator, BundleListener {
                 "activate: Problem while registering bundle resources for existing bundles",
                 t);
         }
+
+        // hackery thing to prevent problems if the web console is not present
+        callMethod(CONSOLE_PLUGIN_CLASS, METHOD_INIT,
+            new Class<?>[] { BundleContext.class }, new Object[] { context });
+
     }
 
     public void stop(BundleContext context) throws Exception {
+        // hackery thing to prevent problems if the web console is not present
+        callMethod(CONSOLE_PLUGIN_CLASS, METHOD_DESTROY, null, null);
+
         context.removeBundleListener(this);
         this.bundleContext = null;
     }
@@ -112,4 +141,36 @@ public class Activator implements BundleActivator, BundleListener {
         }
     }
 
+    /**
+     * Helper method to call the static method <code>methodName</code> on the
+     * class <code>clazzName</code> with the given <code>args</code>. This
+     * method operates exclusively using reflection to prevent any issues if the
+     * class cannot be loaded.
+     * <p>
+     * The goal is to enable running the bundle resource provider without a hard
+     * dependency on the Felix Web Console.
+     * 
+     * @param clazzName The fully qualified name of the class whose static
+     *            method is to be called.
+     * @param methodName The name of the method to call. This method must be
+     *            declared in the given class.
+     * @param argTypes The types of arguments of the methods to be able to find
+     *            the method. This may be <code>null</code> if the method has
+     *            no arguments.
+     * @param args The actual arguments to the method. This may be
+     *            <code>null</code> if the method has no arguments.
+     */
+    private void callMethod(String clazzName, String methodName,
+            Class<?>[] argTypes, Object[] args) {
+        try {
+            Class<?> clazz = getClass().getClassLoader().loadClass(clazzName);
+            Method method = clazz.getDeclaredMethod(methodName, argTypes);
+            if (!method.isAccessible()) {
+                method.setAccessible(true);
+            }
+            method.invoke(null, args);
+        } catch (Throwable t) {
+            // ignore anything
+        }
+    }
 }
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java
new file mode 100644
index 0000000..19dd77a
--- /dev/null
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceWebConsolePlugin.java
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.bundleresource.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.webconsole.AbstractWebConsolePlugin;
+import org.apache.felix.webconsole.WebConsoleConstants;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.util.tracker.ServiceTracker;
+
+class BundleResourceWebConsolePlugin extends AbstractWebConsolePlugin {
+
+    private static final String LABEL = "bundleresources";
+
+    private ServiceRegistration serviceRegistration;
+
+    private ServiceTracker providerTracker;
+
+    private List<BundleResourceProvider> provider = new ArrayList<BundleResourceProvider>();
+
+    //--------- setup and shutdown
+
+    private static BundleResourceWebConsolePlugin INSTANCE;
+    
+    static void initPlugin(BundleContext context) {
+        if (INSTANCE == null) {
+            BundleResourceWebConsolePlugin tmp = new BundleResourceWebConsolePlugin();
+            tmp.activate(context);
+            INSTANCE = tmp;
+        }
+    }
+    
+    static void destroyPlugin() {
+        if (INSTANCE != null) {
+            try {
+                INSTANCE.deactivate();
+            } finally {
+                INSTANCE = null;
+            }
+        }
+    }
+    
+    // private constructor to force using static setup and shutdown
+    private BundleResourceWebConsolePlugin() {
+    }
+
+    //---------- AbstractWebConsolePlugin implementation
+    
+    @Override
+    public String getLabel() {
+        return LABEL;
+    }
+
+    @Override
+    public String getTitle() {
+        return "Bundle Resource Provider";
+    }
+
+    @Override
+    protected void renderContent(HttpServletRequest req, HttpServletResponse res)
+            throws IOException {
+
+        PrintWriter pw = res.getWriter();
+
+        pw.println("<table class='content' cellpadding='0' cellspacing='0' width='100%'>");
+
+        pw.println("<tr class='content'>");
+        pw.println("<th colspan='2' class='content container'>Bundle Resource Provider</th>");
+        pw.println("</tr>");
+
+        BundleResourceProvider[] brp = provider.toArray(new BundleResourceProvider[provider.size()]);
+        for (BundleResourceProvider bundleResourceProvider : brp) {
+
+            BundleResourceCache cache = bundleResourceProvider.getBundleResourceCache();
+            MappedPath[] paths = bundleResourceProvider.getMappedPaths();
+
+            pw.println("<tr class='content'>");
+
+            pw.println("<td class='content'>");
+            pw.println(cache.getBundle().getBundleId());
+            pw.println("</td>");
+
+            pw.println("<td class='content'>");
+            pw.println(getName(cache.getBundle()));
+            pw.println("</td>");
+
+            pw.println("</tr>");
+
+            pw.println("<tr class='content'>");
+            pw.println("<td class='content'>&nbsp;</td>");
+
+            pw.println("<td class='content'>");
+
+            pw.println("<table>");
+
+            pw.println("<tr>");
+            pw.println("<td>Mappings</td>");
+            pw.println("<td>");
+            for (MappedPath mappedPath : paths) {
+                pw.print(mappedPath.getResourceRoot());
+                if (mappedPath.getEntryRoot() != null) {
+                    pw.print(" ==> ");
+                    pw.print(mappedPath.getEntryRoot());
+                }
+                pw.print("<br>");
+            }
+            pw.println("</td>");
+            pw.println("</tr>");
+
+            pw.println("<tr>");
+            pw.println("<td>Entry Cache</td>");
+            pw.printf("<td>Size: %d, Limit: %d</td>%n",
+                cache.getEntryCacheSize(), cache.getEntryCacheMaxSize());
+            pw.println("</tr>");
+
+            pw.println("<tr>");
+            pw.println("<td>List Cache</td>");
+            pw.printf("<td>Size: %d, Limit: %d</td>%n",
+                cache.getListCacheSize(), cache.getListCacheMaxSize());
+            pw.println("</tr>");
+
+            pw.println("</table>");
+
+            pw.println("</td>");
+            pw.println("</tr>");
+        }
+
+        pw.println("</table>");
+
+    }
+
+    public void activate(BundleContext context) {
+        super.activate(context);
+
+        providerTracker = new ServiceTracker(context,
+            ResourceProvider.SERVICE_NAME, null) {
+            @Override
+            public Object addingService(ServiceReference reference) {
+                Object service = super.addingService(reference);
+                if (service instanceof BundleResourceProvider) {
+                    provider.add((BundleResourceProvider) service);
+                }
+                return service;
+            }
+
+            @Override
+            public void removedService(ServiceReference reference,
+                    Object service) {
+                if (service instanceof BundleResourceProvider) {
+                    provider.remove(service);
+                }
+                super.removedService(reference, service);
+            }
+        };
+        providerTracker.open();
+
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        props.put(Constants.SERVICE_DESCRIPTION,
+            "Web Console Plugin for Bundle Resource Providers");
+        props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+        props.put(Constants.SERVICE_PID, getClass().getName());
+        props.put(WebConsoleConstants.PLUGIN_LABEL, LABEL);
+
+        serviceRegistration = context.registerService(
+            WebConsoleConstants.SERVICE_NAME, this, props);
+    }
+
+    public void deactivate() {
+        if (serviceRegistration != null) {
+            serviceRegistration.unregister();
+            serviceRegistration = null;
+        }
+
+        if (providerTracker != null) {
+            providerTracker.close();
+            providerTracker = null;
+        }
+
+        super.deactivate();
+    }
+
+    private String getName(Bundle bundle) {
+        String name = (String) bundle.getHeaders().get(Constants.BUNDLE_NAME);
+        if (name == null) {
+            name = bundle.getSymbolicName();
+            if (name == null) {
+                name = bundle.getLocation();
+            }
+        }
+        return name;
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 11/25: SLING-641 Make the internal map of the cache be access-ordered (instead of insert-ordered) and wrap the maps in synchronized maps to prevent multi-threading issues plus JavaDoc and preparation for management support

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 854122cbdcc583436df1e9271a0b565e8d16623b
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Sep 4 06:33:42 2008 +0000

    SLING-641 Make the internal map of the cache be access-ordered (instead of
    insert-ordered) and wrap the maps in synchronized maps to prevent
    multi-threading issues plus JavaDoc and preparation for management support
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@691883 13f79535-47bb-0310-9956-ffa450edef68
---
 .../bundleresource/impl/BundleResourceCache.java   | 196 ++++++++++++++++++---
 .../impl/BundleResourceProvider.java               |  38 ++--
 2 files changed, 201 insertions(+), 33 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
index 32d74fb..55b5aa5 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
@@ -26,59 +26,146 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 
 import org.osgi.framework.Bundle;
 
-public class BundleResourceCache {
+/**
+ * The <code>BundleResourceCache</code> implements a simple caching for
+ * resources provided from a bundle. Each {@link BundleResourceProvider}
+ * instance uses an instance of this class to access the bundle resources (or
+ * bundle entries) through the cache.
+ * <p>
+ * The cache on the one hand caches single entries as URLs. The other part of
+ * the cache is for the child entries of a given bundle entry path. This caches
+ * lists of strings (entry path).
+ * <p>
+ * Currently the cache limits are fixed at {@value #CACHE_SIZE} for the entries
+ * cache and at {@value #LIST_CACHE_SIZE} for the child entries cache.
+ */
+class BundleResourceCache {
+
+    /**
+     * The maximum size of the single entry cache (value is 50).
+     */
+    private static final int CACHE_SIZE = 50;
+
+    /**
+     * The maximum size of the child entry cache (value is 20).
+     */
+    private static final int LIST_CACHE_SIZE = 20;
 
+    /**
+     * Sentinel for the single entry cache representing a missing entry to
+     * prevent looking for non-existing bundle entries multiple times (value is
+     * "file:///not_found").
+     */
     private static final URL NOT_FOUND_URL;
 
+    /**
+     * Sentinel for the child entry cache representing a missing child list for
+     * a given path to prevent looking for non-existing bundle entries multiple
+     * times (value is an empty list).
+     */
     private static final List<String> NOT_FOUND_CHILDREN = Collections.<String> emptyList();
 
-    private final BundleResourceMap<String, URL> cache;
+    /**
+     * Single entry cache. This is a synchronized map with a size limit.
+     */
+    private final Map<String, URL> cache;
 
-    private final BundleResourceMap<String, List<String>> listCache;
+    /**
+     * The child entry cache. This is a synchronized map with a size limit.
+     */
+    private final Map<String, List<String>> listCache;
 
+    /**
+     * The Bundle providing the resource entries.
+     */
     private final Bundle bundle;
 
+    // static initializer setting the NOT_FOUND_URL. Because the
+    // constructor may throw an exception we use a static initializer
+    // which fails the class initialization in the unlikely case
+    // of the URL constructor failing.
     static {
         try {
-            NOT_FOUND_URL = new URL("file:///not_found");
+            NOT_FOUND_URL = new URL("file:/not_found");
         } catch (MalformedURLException mue) {
             throw new ExceptionInInitializerError(mue);
         }
     }
 
+    /**
+     * Creates a new instance of this class providing access to the entries in
+     * the given <code>bundle</code>.
+     * 
+     * @param bundle
+     */
     BundleResourceCache(Bundle bundle) {
         this.bundle = bundle;
-        this.cache = new BundleResourceMap<String, URL>(50);
-        this.listCache = new BundleResourceMap<String, List<String>>(20);
+
+        // create the limited maps wrapping in synchronized maps
+        this.cache = Collections.synchronizedMap(new BundleResourceMap<String, URL>(
+            CACHE_SIZE));
+        this.listCache = Collections.synchronizedMap(new BundleResourceMap<String, List<String>>(
+            LIST_CACHE_SIZE));
     }
 
+    /**
+     * Returns the <code>Bundle</code> to which this instance provides access.
+     */
     Bundle getBundle() {
         return bundle;
     }
-    
+
+    /**
+     * Returns the entry in the underlying bundle at the given path. This path
+     * is assumed to be an absolute path. If relative it is resolved relative to
+     * the bundle root.
+     * <p>
+     * This method is backed by the <code>Bundle.getEntry(String)</code>
+     * method.
+     * 
+     * @param path The path to the bundle entry to return
+     * @return The URL to access the bundle entry or <code>null</code> if the
+     *         bundle does not contain the request entry.
+     */
     URL getEntry(String path) {
         URL url = cache.get(path);
         if (url == null) {
             url = bundle.getEntry(path);
-            
+
             if (url == null) {
                 url = NOT_FOUND_URL;
             }
-            
+
             cache.put(path, url);
         }
 
         return (url == NOT_FOUND_URL) ? null : url;
     }
 
+    /**
+     * Returns a list of bundle entry paths considered children of the given
+     * <code>parentPath</code>. This parent path is assumed to be an absolute
+     * path. If relative it is resolved relative to the bundle root.
+     * <p>
+     * This method is backed by the <code>Bundle.getEntryPaths(String)</code>
+     * method but returns an <code>Iterator<String></code> instead of an
+     * <code>Enumeration</code> of strings.
+     * 
+     * @param parentPath The path to the parent entry whose child entries are to
+     *            be returned.
+     * @return An <code>Iterator<String></code> providing the paths of
+     *         entries considered direct children of the <code>parentPath</code>
+     *         or <code>null</code> if the parent entry does not exist.
+     */
     Iterator<String> getEntryPaths(String path) {
         List<String> list = listCache.get(path);
         if (list == null) {
-            
+
             @SuppressWarnings("unchecked")
             Enumeration<String> entries = bundle.getEntryPaths(path);
             if (entries != null && entries.hasMoreElements()) {
@@ -87,34 +174,101 @@ public class BundleResourceCache {
                     list.add(entries.nextElement());
                 }
             }
-            
+
             if (list == null) {
                 list = NOT_FOUND_CHILDREN;
             }
-            
+
             listCache.put(path, list);
         }
-        
+
         return (list == NOT_FOUND_CHILDREN) ? null : list.iterator();
     }
-    
-    private static class BundleResourceMap<K, V> extends LinkedHashMap<String, V> {
+
+    // ---------- Management API
+
+    /**
+     * Returns the current number of entries stored in the entry cache. This
+     * number includes "negative" entries, which are requested entries not found
+     * in the bundle.
+     */
+    int getEntryCacheSize() {
+        return cache.size();
+    }
+
+    /**
+     * Returns the maximum number of entries to be stored in the cache. This
+     * number is currently fixed at {@link #CACHE_SIZE}
+     */
+    int getEntryCacheMaxSize() {
+        return CACHE_SIZE;
+    }
+
+    /**
+     * Returns the current number of list entries stored in the list cache. This
+     * number includes "negative" list entries, which are requested list entries
+     * not found in the bundle.
+     */
+    int getListCacheSize() {
+        return listCache.size();
+    }
+
+    /**
+     * Returns the maximum number of list entries to be stored in the cache.
+     * This number is currently fixed at {@link #LIST_CACHE_SIZE}
+     */
+    int getListCacheMaxSize() {
+        return LIST_CACHE_SIZE;
+    }
+
+    // ---------- inner class
+
+    /**
+     * The <code>BundleResourceMap</code> class extends the
+     * <code>LinkedHashMap</code> class overwriting the
+     * {@link #removeEldestEntry(Entry)} method to implement the size limit,
+     * which is set in the constructor.
+     */
+    private static class BundleResourceMap<K, V> extends
+            LinkedHashMap<String, V> {
 
         /**
-         * The default size of a bundle resource cache.
+         * The default size of a bundle resource cache (value is 20).
+         */
+        private static final int DEFAULT_LIMIT = 20;
+
+        /**
+         * The limit configured for this map.
          */
-        public static final int DEFAULT_LIMIT = 100;
-        
         private final int limit;
-        
+
+        /**
+         * Creates a new instance of this size limited map.
+         * 
+         * @param limit The maximum number of entries in this map. If this value
+         *            is less than or equal to zero, the default size of
+         *            {@link #DEFAULT_LIMIT} is used.
+         */
         BundleResourceMap(int limit) {
+            // deliberately chosen initial size and load factor, but
+            // we need the access-order to implement the LRU mechanism
+            super(8, 0.75f, true);
+
+            // normalize size to a possitive number
             if (limit <= 0) {
                 limit = DEFAULT_LIMIT;
             }
-            
+
             this.limit = limit;
         }
-        
+
+        /**
+         * Returns the maximum number of entries to be stored in this map.
+         */
+        int getLimit() {
+            return limit;
+        }
+
         /**
          * Returns <code>true</code> if the current number of elements in the
          * map exceeds the configured limit.
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
index c9e71ff..0c2230c 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -48,7 +48,7 @@ public class BundleResourceProvider implements ResourceProvider {
     private final MappedPath[] roots;
 
     private ServiceRegistration serviceRegistration;
-    
+
     /**
      * Creates Bundle resource provider accessing entries in the given Bundle an
      * supporting resources below root paths given by the rootList which is a
@@ -70,38 +70,51 @@ public class BundleResourceProvider implements ResourceProvider {
 
     void registerService(BundleContext context) {
         Dictionary<String, Object> props = new Hashtable<String, Object>();
-        props.put(Constants.SERVICE_DESCRIPTION, "Provider of Bundle based Resources");
+        props.put(Constants.SERVICE_DESCRIPTION,
+            "Provider of Bundle based Resources");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(ROOTS, getRoots());
-        
+
         serviceRegistration = context.registerService(SERVICE_NAME, this, props);
     }
-    
+
     void unregisterService() {
         if (serviceRegistration != null) {
             serviceRegistration.unregister();
         }
     }
+
+    //---------- Web Console plugin support
+    
+    BundleResourceCache getBundleResourceCache() {
+        return bundle;
+    }
+
+    MappedPath[] getMappedPaths() {
+        return roots;
+    }
+    
+    //---------- internal
     
     /** Returns the root paths */
     private String[] getRoots() {
         String[] rootPaths = new String[roots.length];
-        for (int i=0; i < roots.length; i++) {
+        for (int i = 0; i < roots.length; i++) {
             rootPaths[i] = roots[i].getResourceRoot();
         }
         return rootPaths;
     }
-    
+
     private MappedPath getMappedPath(String resourcePath) {
-        for (MappedPath mappedPath: roots) {
+        for (MappedPath mappedPath : roots) {
             if (mappedPath.isChild(resourcePath)) {
                 return mappedPath;
             }
         }
-        
+
         return null;
     }
-    
+
     public Resource getResource(ResourceResolver resourceResolver,
             HttpServletRequest request, String path) {
         return getResource(resourceResolver, path);
@@ -115,9 +128,10 @@ public class BundleResourceProvider implements ResourceProvider {
     public Resource getResource(ResourceResolver resourceResolver, String path) {
         MappedPath mappedPath = getMappedPath(path);
         if (mappedPath != null) {
-            return BundleResource.getResource(resourceResolver, bundle, mappedPath, path);
+            return BundleResource.getResource(resourceResolver, bundle,
+                mappedPath, path);
         }
-        
+
         return null;
     }
 
@@ -140,6 +154,6 @@ public class BundleResourceProvider implements ResourceProvider {
         // the parent resource cannot have children in this provider,
         // though this is basically not expected, we still have to
         // be prepared for such a situation
-        return Collections.<Resource>emptyList().iterator();
+        return Collections.<Resource> emptyList().iterator();
     }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 25/25: Move Sling to new TLP location

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 0b8ea46cb8340dc0eb132d168818a4a8694c3473
Merge: 3b32c6f 724c1c2
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jun 18 09:21:02 2009 +0000

    Move Sling to new TLP location
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator@785979 13f79535-47bb-0310-9956-ffa450edef68


-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 03/25: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 307ef525a496ee167ac5b5bde52c151a7e2706fe
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jun 17 07:37:11 2008 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@668496 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 308abeb..03c3b90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <artifactId>org.apache.sling.bundleresource.impl</artifactId>
     <packaging>bundle</packaging>
-    <version>2.0.2-incubator</version>
+    <version>2.0.3-incubator-SNAPSHOT</version>
 
     <name>Sling - Bundle Resource Provider</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/bundleresource</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 09/25: Fix wrong license header ...

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 96010ffbbcac2c00269b5e6a34505b1d17abf902
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Wed Sep 3 13:47:41 2008 +0000

    Fix wrong license header ...
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@691612 13f79535-47bb-0310-9956-ffa450edef68
---
 .../bundleresource/impl/BundleResourceCache.java   | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
index 7718637..32d74fb 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceCache.java
@@ -1,16 +1,20 @@
 /*
- * $Url: $
- * $Id: $
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Copyright 1997-2005 Day Management AG
- * Barfuesserplatz 6, 4001 Basel, Switzerland
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * This software is the confidential and proprietary information of
- * Day Management AG, ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Day.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.bundleresource.impl;
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 17/25: SLING-829 Cosmetics to the bundle/project names

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit cca4002fdc4ae834d5e1e48501e5bb175326741d
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jan 15 10:25:41 2009 +0000

    SLING-829 Cosmetics to the bundle/project names
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@734658 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f3cf7ea..a305122 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     <packaging>bundle</packaging>
     <version>2.0.3-incubator-SNAPSHOT</version>
 
-    <name>Sling - Bundle Resource Provider</name>
+    <name>Apache Sling Bundle Resource Provider</name>
     <description>
         Provides a ResourceProvider implementation supporting bundle
         based resources.

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 04/25: Use latest snapshots again to make project buildable.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 10858cada70b2053d015234b556bbbca85e35f44
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jun 17 08:55:12 2008 +0000

    Use latest snapshots again to make project buildable.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@668571 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 03c3b90..dad6be0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>3-incubator</version>
+        <version>4-incubator-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 
@@ -86,12 +86,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.2-incubator</version>
+            <version>2.0.3-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.resource</artifactId>
-            <version>2.0.2-incubator</version>
+            <version>2.0.3-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 14/25: SLING-808 : Increase version to 5-incubator-SNAPSHOT

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit e1d4f8ae0b435bafd154a3cf47a29da69bee94df
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 5 11:07:35 2009 +0000

    SLING-808 : Increase version to 5-incubator-SNAPSHOT
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@731526 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e83ae5b..f3cf7ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>4-incubator-SNAPSHOT</version>
+        <version>5-incubator-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 19/25: SLING-865 : Adjust reactor pom and svn information in each module.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 95dbafa84c9e28b4f58acc51d35016fb3d79c73b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 14:22:36 2009 +0000

    SLING-865 : Adjust reactor pom and svn information in each module.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource@746707 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index a305122..db2eaa9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource
+            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource
+            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/bundleresource
+            http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/extensions/bundleresource
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 23/25: [maven-release-plugin] copy for tag org.apache.sling.bundleresource.impl-2.0.4-incubator

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 724c1c26952c512ab4a64630854171f4f3c55ee1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 5 15:47:10 2009 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.bundleresource.impl-2.0.4-incubator
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator@771838 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index ccb82a1..3f30ff5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,13 +22,13 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>5-incubator-SNAPSHOT</version>
+        <version>5-incubator</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
     <artifactId>org.apache.sling.bundleresource.impl</artifactId>
     <packaging>bundle</packaging>
-    <version>2.0.3-incubator-SNAPSHOT</version>
+    <version>2.0.4-incubator</version>
 
     <name>Apache Sling Bundle Resource Provider</name>
     <description>
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource
+            scm:svn:http://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/extensions/bundleresource
+            scm:svn:https://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/extensions/bundleresource
+            http://svn.apache.org/viewvc/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.4-incubator
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 15/25: Update notice files to include 2009 in copyright statement.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 0f2cbbdd985aa26884e21fc5d44c66edca5ec00f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jan 7 09:07:02 2009 +0000

    Update notice files to include 2009 in copyright statement.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@732280 13f79535-47bb-0310-9956-ffa450edef68
---
 NOTICE                             | 2 +-
 src/main/resources/META-INF/NOTICE | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/NOTICE b/NOTICE
index 8cb5ef0..255444e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Sling Bundle Resource Provider
-Copyright 2008 The Apache Software Foundation
+Copyright 2008-2009 The Apache Software Foundation
 
 Apache Sling is based on source code originally developed 
 by Day Software (http://www.day.com/).
diff --git a/src/main/resources/META-INF/NOTICE b/src/main/resources/META-INF/NOTICE
index 8cb5ef0..255444e 100644
--- a/src/main/resources/META-INF/NOTICE
+++ b/src/main/resources/META-INF/NOTICE
@@ -1,5 +1,5 @@
 Apache Sling Bundle Resource Provider
-Copyright 2008 The Apache Software Foundation
+Copyright 2008-2009 The Apache Software Foundation
 
 Apache Sling is based on source code originally developed 
 by Day Software (http://www.day.com/).

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 02/25: [maven-release-plugin] prepare release org.apache.sling.bundleresource.impl-2.0.2-incubator

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit f13eb00a2da962a45f1a9b585fb560ad01432cb4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jun 17 07:37:01 2008 +0000

    [maven-release-plugin] prepare release org.apache.sling.bundleresource.impl-2.0.2-incubator
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@668494 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2fd4a4e..308abeb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <artifactId>org.apache.sling.bundleresource.impl</artifactId>
     <packaging>bundle</packaging>
-    <version>2.0.1-incubator-SNAPSHOT</version>
+    <version>2.0.2-incubator</version>
 
     <name>Sling - Bundle Resource Provider</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/bundleresource</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/sling/tags/org.apache.sling.bundleresource.impl-2.0.2-incubator</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-bundleresource-impl] 16/25: Remove unused imports.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit d65e9b0e05820122ec12232374ec4359baca4548
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jan 9 13:01:28 2009 +0000

    Remove unused imports.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/bundleresource@733020 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/bundleresource/impl/BundleResource.java | 1 -
 .../apache/sling/bundleresource/impl/BundleResourceIterator.java  | 6 ++----
 .../apache/sling/bundleresource/impl/BundleResourceProvider.java  | 8 +++-----
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
index 4b6f9d2..af49830 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java
@@ -32,7 +32,6 @@ import org.apache.sling.adapter.SlingAdaptable;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
index 55a446f..de19d7d 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
@@ -18,13 +18,11 @@
  */
 package org.apache.sling.bundleresource.impl;
 
-import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +43,7 @@ class BundleResourceIterator implements Iterator<Resource> {
     private final BundleResourceCache bundle;
 
     private final MappedPath mappedPath;
-    
+
     /** Underlying bundle entry path enumeration */
     private final Iterator<String> entries;
 
@@ -86,7 +84,7 @@ class BundleResourceIterator implements Iterator<Resource> {
 
     BundleResourceIterator(ResourceResolver resourceResolver, BundleResourceCache bundle,
             MappedPath mappedPath, String parentPath) {
-        
+
         // trailing slash to enumerate children
         if (!parentPath.endsWith("/")) {
             parentPath = parentPath.concat("/");
diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
index 0c2230c..2cbee15 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -18,14 +18,12 @@
  */
 package org.apache.sling.bundleresource.impl;
 
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.StringTokenizer;
 
 import javax.servlet.http.HttpServletRequest;
@@ -85,7 +83,7 @@ public class BundleResourceProvider implements ResourceProvider {
     }
 
     //---------- Web Console plugin support
-    
+
     BundleResourceCache getBundleResourceCache() {
         return bundle;
     }
@@ -93,9 +91,9 @@ public class BundleResourceProvider implements ResourceProvider {
     MappedPath[] getMappedPaths() {
         return roots;
     }
-    
+
     //---------- internal
-    
+
     /** Returns the root paths */
     private String[] getRoots() {
         String[] rootPaths = new String[roots.length];

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.