- URL file = b.getEntry(ADAPTERS_FILE);
- if (file != null) {
- String fileName = new Path(b.getLocation()).append(file.getPath()).toString();
- try {
- DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setErrorHandler(new ErrorHandler() {
-
- @Override
- public void error(SAXParseException exception)
- throws SAXException {
- // TODO Put this error somewhere
- System.err.println("Parse error at "
- + b.getSymbolicName() + "/adapters.xml" +
- " line " + exception.getLineNumber() +
- " column " + exception.getColumnNumber() + ":");
- System.err.println(exception.getMessage());
- }
-
- @Override
- public void fatalError(SAXParseException exception)
- throws SAXException {
- error(exception);
- }
-
- @Override
- public void warning(SAXParseException exception)
- throws SAXException {
- error(exception);
- }
-
- });
-
- //System.out.println("bundle=" + b.getSymbolicName());
- String text = FileUtils.getContents(file);
- text = OntologyVersions.getInstance().currentVersion(text);
- StringReader reader = new StringReader( text );
- InputSource inputSource = new InputSource( reader );
- Document doc = builder.parse( inputSource );
- reader.close();
- handleAdaptersDocument(loader(b), doc, fileName);
- } catch (Exception e) {
- handleException(e, fileName);
-
+ Future<?> submit = ThreadUtils.getNonBlockingWorkExecutor().submit(() -> {
+ URL file = b.getEntry(ADAPTERS_FILE);
+ if (file != null) {
+ String fileName = new Path(b.getLocation()).append(file.getPath()).toString();
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ builder.setErrorHandler(new ErrorHandler() {
+
+ @Override
+ public void error(SAXParseException exception) throws SAXException {
+ // TODO Put this error somewhere
+ System.err.println("Parse error at " + b.getSymbolicName() + "/adapters.xml"
+ + " line " + exception.getLineNumber() + " column "
+ + exception.getColumnNumber() + ":");
+ System.err.println(exception.getMessage());
+ }
+
+ @Override
+ public void fatalError(SAXParseException exception) throws SAXException {
+ error(exception);
+ }
+
+ @Override
+ public void warning(SAXParseException exception) throws SAXException {
+ error(exception);
+ }
+
+ });
+
+ // System.out.println("bundle=" + b.getSymbolicName());
+ String text = FileUtils.getContents(file);
+ text = OntologyVersions.getInstance().currentVersion(text);
+ StringReader reader = new StringReader(text);
+ InputSource inputSource = new InputSource(reader);
+ Document doc = builder.parse(inputSource);
+ reader.close();
+ handleAdaptersDocument(loader(b), doc, fileName);
+ } catch (Exception e) {
+ handleException(e, fileName);
+
+ }