You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>You should use the <code>BundleManifestScanner</code> if you wish to implement an extender that is triggered by existence of specific entries in bundle manifest (<code>META-INF/MANIFEST.MF</code>).</p>
139
+
</div>
130
140
<divclass="paragraph">
131
-
<p>Utilities related to extender pattern.</p>
141
+
<p>Usually in your extender <code>BundleActivator</code> you will create and start an instance of <code>BundleWatcher</code> by passing in a <code>BundleManifestScanner</code> and your extender specific <code>BundleObserver</code>.</p>
<p>This scanner takes the starting bundle manifest entries and makes use of provided <code>ManifestFilter</code> to find out if the current bundle manifest contains expected entries.
165
+
If there are any entries matched by the manifest filter it will create for each one a <code>ManifestEntry</code> which is a simple pair between manifest header name and value.
166
+
Below is an example of creating a <code>BundleManifestScanner</code> that uses a regular expression based manifest filter:</p>
<p>You should use the <code>BundleURLScanner</code> if you wish to implement an extender that is triggered by existence of specific files or directories in bundles.</p>
202
+
</div>
203
+
<divclass="sect2">
204
+
<h3id="_example_war_extender"><aclass="anchor" href="#_example_war_extender"></a>Example WAR Extender</h3>
205
+
<divclass="paragraph">
206
+
<p>The following is an example of how you can implement an extender bundle for war files:</p>
207
+
</div>
208
+
<divclass="listingblock">
209
+
<divclass="content">
210
+
<pre>new BundleWatcher<URL>(
211
+
bundleContext,
212
+
new BundleURLScanner(
213
+
"WEB-INF/",
214
+
"web.xml",
215
+
false // do not recurse
216
+
),
217
+
new BundleObserver<URL>() {
218
+
public void addingEntries(Bundle bundle, List<URL> entries) {
219
+
// process web xml, as for example parsing and registering servlets
220
+
}
221
+
222
+
public void removingEntries(Bundle bundle, List<URL> entries) {
<h2id="_utilities_for_osgi"><aclass="anchor" href="#_utilities_for_osgi"></a>Utilities for OSGi</h2>
128
+
<divclass="sectionbody">
129
129
<divclass="paragraph">
130
-
<p>Utilities for OSGi</p>
130
+
<p>Pax Swissbox is a set of utilities targeting OSGi and the project emerged as means for re-usage within Pax projects.
131
+
But, as Pax Swissbox artifacts are generic, they can be reused outside Pax projects.
132
+
In order to minimize dependencies and improve modularity Pax Swissbox is split in very fine-grained bundles that you can use individually.
133
+
Pax Swissbox artifacts are meant to be embedded (wrapped) in your bundle (easy to achieve using Maven Bundle Plugin), but you can use them as standalone bundles.</p>
0 commit comments