
org.daisy.dotify.api.tasks.TaskSystemFactory Maven / Gradle / Ivy
package org.daisy.dotify.api.tasks;
/**
* Provides an interface for task system factories. A
* task system factory implementation can provide
* task system instances for any number of specifications.
*
* @author Joel Håkansson
*/
public interface TaskSystemFactory {
/**
* Returns true if this factory can create instances with the desired properties.
* @param locale the desired locale
* @param outputFormat the desired output format
* @return returns true if this factory can create instances with the desired properties, false otherwise
*/
public boolean supportsSpecification(String locale, String outputFormat);
/**
* Creates a new task system with the given properties.
* @param locale the desired locale
* @param outputFormat the desired output format
* @return returns a new task system
* @throws TaskSystemFactoryException if a task system with these properties cannot be created
*/
public TaskSystem newTaskSystem(String locale, String outputFormat) throws TaskSystemFactoryException;
/**
* Informs the implementation that it was discovered and instantiated using
* information collected from a file within the META-INF/services directory.
* In other words, it was created using SPI (service provider interfaces).
*
* This information, in turn, enables the implementation to use the same mechanism
* to set dependencies as needed.
*
* If this information is not given, an implementation
* should avoid using SPIs and instead use
* declarative services
* for dependency injection as specified by OSGi. Note that this also applies to
* several newInstance() methods in the Java API.
*
* The class that created an instance with SPI must call this method before
* putting it to use.
*/
public void setCreatedWithSPI();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy