Skip to content

Commit

Permalink
[PAXWEB-895] Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lostiniceland committed Aug 10, 2016
1 parent 8020b01 commit b9c49d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pax-web-resources/Readme.md
Expand Up @@ -12,11 +12,11 @@ This module enables Servlet 3.0 Resources for OSGi-Bundles.

## Beware the dynamics

Since resource-bundles, like every bundle in OSGi, can become unavailable, the implementation will block read-requests when the internal index is updated. This trade-off was made because usually the reads greatly outnumber the writes.
Since resource-bundles, like every bundle in OSGi, can become unavailable.

### Example with a unavailable resource
When creating a HTML page, there are two phases: in the first, the HTML will be created and served to the browser. Here a resource-bundle is available and JSF can retrieve the resource-URL from the ResourceHandler.

Now, the resource-bundle gets uninstalled.

During HTML-parsing, the browser will issue a dedicated resource-request with the given URL, but due to network-latency the resource-bundle has already gone. A webframework (like JSF) will try to open a stream to the given URL, in order to serve the actual bytes. This will cause an IOException because the resource under the given URL has vanished.
During HTML-parsing, the browser will issue a dedicated resource-request with the given URL, but due to network-latency the resource-bundle has already gone. A web-framework (like JSF) will try to open a stream to the given URL, in order to serve the actual bytes. This will cause an IOException because the resource under the given URL has vanished.
2 changes: 1 addition & 1 deletion pax-web-resources/pax-web-resources-extender/Readme.md
Expand Up @@ -35,7 +35,7 @@ To do this, another implementation for `org.ops4j.pax.web.resource.api.OsgiResou
1. Create a separate bundle using the provided api-bundle
2. Just provide a additional service for `org.ops4j.pax.web.resource.api.OsgiResourceLocator`
- The default implementation in this bundle registers a service with a ranking of -1. By registering a service without a ranking the framework will give it a ranking of 0 which will cause the custom implementation to be picked up
- This way, the exteder-pattern from this module is still active and will notify your custom-service about new and removed bundles.
- This way, the extender-pattern from this module is still active and will notify your custom-service about new and removed bundles.



Expand Down

0 comments on commit b9c49d7

Please sign in to comment.