Class JsbmlSetup

java.lang.Object
org.cy3sbml.reader.JsbmlSetup

public final class JsbmlSetup extends Object
One-time setup of JSBML before SBML files are read or written on several threads.

JSBML creates its ParserManager singleton lazily and without synchronization, and the instance shares the iterators it fills its parser maps from. Two threads that read or write their first SBML document at the same time (two imports in Cytoscape, or tests run in parallel) can both create an instance, and one of them fails with a NoSuchElementException from the shared iterator. Creating the singleton once, before anything else uses JSBML, avoids that.

  • Method Details

    • initialize

      public static void initialize()
      Creates the JSBML parser manager. Call it on one thread before the SBML reader is used.