Skip to content

Commit

Permalink
Change code slightly to (I hope) solve #110
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 26, 2020
1 parent 43a53b9 commit b3669a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.fasterxml</groupId>
<artifactId>oss-parent</artifactId>
<version>38</version>
<version>39</version>
</parent>

<groupId>com.fasterxml.woodstox</groupId>
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ctc.wstx.osgi;

import java.util.Dictionary;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

Expand All @@ -23,17 +25,21 @@ public WstxBundleActivator() { }
* Method called on activation. We need to register all providers we have at
* this point.
*/
@SuppressWarnings("rawtypes") // for compatibility between older and new OSGi-core jars
@Override
public void start(BundleContext ctxt)
{
InputFactoryProviderImpl inputP = new InputFactoryProviderImpl();
ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, inputP.getProperties());
final Dictionary inputProps = inputP.getProperties();
ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, inputProps);
OutputFactoryProviderImpl outputP = new OutputFactoryProviderImpl();
ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, outputP.getProperties());
final Dictionary outputProps = outputP.getProperties();
ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, outputProps);
ValidationSchemaFactoryProviderImpl[] impls = ValidationSchemaFactoryProviderImpl.createAll();
for (int i = 0, len = impls.length; i < len; ++i) {
ValidationSchemaFactoryProviderImpl impl = impls[i];
ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, impl.getProperties());
final Dictionary implProps = impl.getProperties();
ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, implProps);
}
}

Expand All @@ -43,4 +49,3 @@ public void stop(BundleContext ctxt) {
// deactivation.
}
}

0 comments on commit b3669a6

Please sign in to comment.