1   /***************************************************************/
2   /* This class was generated by ds-to-spi-annotations-processor */
3   /***************************************************************/
4   
5   package org.daisy.pipeline.modules.impl;
6   
7   public class Module_braille_module_SPI
8          extends org.daisy.pipeline.modules.impl.Module_braille_module
9          implements org.daisy.common.spi.ServiceWithProperties
10                  , org.daisy.common.spi.CreateOnStart {
11  	
12  	private static final org.slf4j.Logger spi_log = org.slf4j.LoggerFactory.getLogger(Module_braille_module_SPI.class);
13  	
14  	private final java.util.Map spi_props;
15  	
16  	public Module_braille_module_SPI() {
17  		super();
18  		spi_log.trace("Creating Module_braille_module");
19  		spi_props = new java.util.HashMap();
20  		spi_props.put("component.name", "org.daisy.pipeline.modules.impl.Module_braille_module");
21  		{
22  			spi_log.trace("Binding org.daisy.pipeline.xmlcatalog.XmlCatalogParser services...");
23  			// cardinality: 1..1
24  			int minRef = 1;
25  			int maxRef = 1;
26  			int refCount = 0;
27  			try {
28  				java.util.Iterator<org.daisy.pipeline.xmlcatalog.XmlCatalogParser> services
29  					= org.daisy.common.spi.ServiceLoader.load(org.daisy.pipeline.xmlcatalog.XmlCatalogParser.class).iterator();
30  				while (services.hasNext()) {
31  					try {
32  						org.daisy.pipeline.xmlcatalog.XmlCatalogParser service = services.next();
33  						setParser(service);
34  						refCount++;
35  						if (maxRef > 0 && refCount == maxRef)
36  							break;
37  					} catch (Throwable e) {
38  						spi_log.error("Error while binding org.daisy.pipeline.xmlcatalog.XmlCatalogParser service", e);
39  					}
40  				}
41  			} catch (Throwable e) {
42  				spi_log.error("Error while binding org.daisy.pipeline.xmlcatalog.XmlCatalogParser services", e);
43  			}
44  			if (refCount < minRef) {
45  				spi_log.warn("No org.daisy.pipeline.xmlcatalog.XmlCatalogParser found");
46  				throw new RuntimeException("No org.daisy.pipeline.xmlcatalog.XmlCatalogParser found");
47  			} else {
48  				spi_log.trace("Bound " + refCount + " org.daisy.pipeline.xmlcatalog.XmlCatalogParser services.");
49  			}
50  		}
51  	}
52  	
53  	public java.util.Map spi_getProperties() {
54  		return spi_props;
55  	}
56  }