All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.daisy.pipeline.css.impl.StylesheetParametersWebServiceExtension_SPI Maven / Gradle / Ivy

There is a newer version: 5.3.1
Show newest version
/***************************************************************/
/* This class was generated by ds-to-spi-annotations-processor */
/***************************************************************/

package org.daisy.pipeline.css.impl;

public class StylesheetParametersWebServiceExtension_SPI
       implements org.daisy.common.spi.ServiceWithProperties
                , org.daisy.pipeline.webservice.restlet.WebServiceExtension
{
	
	private static final org.slf4j.Logger spi_log = org.slf4j.LoggerFactory.getLogger(StylesheetParametersWebServiceExtension_SPI.class);
	
	private final java.util.Map spi_props;
	private boolean spi_deactivated = false;
	
	private final org.daisy.pipeline.css.impl.StylesheetParametersWebServiceExtension delegate;

	public StylesheetParametersWebServiceExtension_SPI() {
		delegate = new org.daisy.pipeline.css.impl.StylesheetParametersWebServiceExtension();
		spi_log.trace("Creating StylesheetParametersWebServiceExtension");
		spi_props = new java.util.HashMap();
		spi_props.put("component.name", "stylesheet-parameters-service-extension");
		{
			spi_log.trace("Binding javax.xml.transform.URIResolver services...");
			// cardinality: 1..1
			int minRef = 1;
			int maxRef = 1;
			int refCount = 0;
			try {
				java.util.Iterator services
					= org.daisy.common.spi.ServiceLoader.load(javax.xml.transform.URIResolver.class).iterator();
				while (services.hasNext()) {
					try {
						javax.xml.transform.URIResolver service = services.next();
						delegate.setURIResolver(service);
						spi_log.trace("Bound javax.xml.transform.URIResolver service: "
						              + service.getClass().getName() + "@"
						              + Integer.toHexString(System.identityHashCode(service)));
						refCount++;
						if (maxRef > 0 && refCount == maxRef)
							break;
					} catch (Throwable e) {
						spi_log.error("Error while binding javax.xml.transform.URIResolver service", e);
					}
				}
			} catch (Throwable e) {
				spi_log.error("Error while binding javax.xml.transform.URIResolver services", e);
			}
			if (refCount < minRef) {
				spi_log.warn("No javax.xml.transform.URIResolver found");
				throw new RuntimeException("No javax.xml.transform.URIResolver found");
			} else {
				spi_log.trace("Bound " + refCount + " javax.xml.transform.URIResolver services.");
			}
		}
		{
			spi_log.trace("Binding org.daisy.pipeline.datatypes.DatatypeRegistry services...");
			// cardinality: 1..1
			int minRef = 1;
			int maxRef = 1;
			int refCount = 0;
			try {
				java.util.Iterator services
					= org.daisy.common.spi.ServiceLoader.load(org.daisy.pipeline.datatypes.DatatypeRegistry.class).iterator();
				while (services.hasNext()) {
					try {
						org.daisy.pipeline.datatypes.DatatypeRegistry service = services.next();
						delegate.setDatatypeRegistry(service);
						spi_log.trace("Bound org.daisy.pipeline.datatypes.DatatypeRegistry service: "
						              + service.getClass().getName() + "@"
						              + Integer.toHexString(System.identityHashCode(service)));
						refCount++;
						if (maxRef > 0 && refCount == maxRef)
							break;
					} catch (Throwable e) {
						spi_log.error("Error while binding org.daisy.pipeline.datatypes.DatatypeRegistry service", e);
					}
				}
			} catch (Throwable e) {
				spi_log.error("Error while binding org.daisy.pipeline.datatypes.DatatypeRegistry services", e);
			}
			if (refCount < minRef) {
				spi_log.warn("No org.daisy.pipeline.datatypes.DatatypeRegistry found");
				throw new RuntimeException("No org.daisy.pipeline.datatypes.DatatypeRegistry found");
			} else {
				spi_log.trace("Bound " + refCount + " org.daisy.pipeline.datatypes.DatatypeRegistry services.");
			}
		}
		{
			spi_log.trace("Binding org.daisy.pipeline.css.UserAgentStylesheetRegistry services...");
			// cardinality: 1..1
			int minRef = 1;
			int maxRef = 1;
			int refCount = 0;
			try {
				java.util.Iterator services
					= org.daisy.common.spi.ServiceLoader.load(org.daisy.pipeline.css.UserAgentStylesheetRegistry.class).iterator();
				while (services.hasNext()) {
					try {
						org.daisy.pipeline.css.UserAgentStylesheetRegistry service = services.next();
						delegate.setUserAgentStylesheetRegistry(service);
						spi_log.trace("Bound org.daisy.pipeline.css.UserAgentStylesheetRegistry service: "
						              + service.getClass().getName() + "@"
						              + Integer.toHexString(System.identityHashCode(service)));
						refCount++;
						if (maxRef > 0 && refCount == maxRef)
							break;
					} catch (Throwable e) {
						spi_log.error("Error while binding org.daisy.pipeline.css.UserAgentStylesheetRegistry service", e);
					}
				}
			} catch (Throwable e) {
				spi_log.error("Error while binding org.daisy.pipeline.css.UserAgentStylesheetRegistry services", e);
			}
			if (refCount < minRef) {
				spi_log.warn("No org.daisy.pipeline.css.UserAgentStylesheetRegistry found");
				throw new RuntimeException("No org.daisy.pipeline.css.UserAgentStylesheetRegistry found");
			} else {
				spi_log.trace("Bound " + refCount + " org.daisy.pipeline.css.UserAgentStylesheetRegistry services.");
			}
		}
	}
	
	public void spi_deactivate() {
	}
	
	public java.util.Map spi_getProperties() {
		return spi_props;
	}

	@Override
	public void attachTo(
		org.restlet.routing.Router arg1
	) {
		delegate.attachTo(
			arg1
		);
	}

	@Override
	public String toString() {
		return delegate.toString();
	}

	@Override
	public int hashCode() {
		return delegate.hashCode();
	}

	@Override
	public boolean equals(Object o) {
		return delegate.equals(o);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy