![JAR search and dependency download from the Maven repository](/logo.png)
info.kwarc.sally4.theo.factories.TheoFactory Maven / Gradle / Ivy
The newest version!
package info.kwarc.sally4.theo.factories;
import info.kwarc.sally4.registration.SallyClient;
import info.kwarc.sally4.util.InstanceCreator;
import org.apache.felix.ipojo.ConfigurationException;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.MissingHandlerException;
import org.apache.felix.ipojo.UnacceptableConfiguration;
import org.apache.felix.ipojo.annotations.Bind;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Requires;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component
@Instantiate
public class TheoFactory {
@Requires(filter="(factory.name=info.kwarc.sally4.theo.impl.TheoInstance)")
Factory theoFactory;
Logger log;
public TheoFactory() {
log = LoggerFactory.getLogger(getClass());
}
void addDoc(SallyClient doc) throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
if (doc.supports("theo")) {
InstanceCreator.init(theoFactory).setInstanceName("Theo for doc "+doc.getDocQueue()).setDynamicRequirement("docQueue", "(docQueue="+doc.getDocQueue()+")").create();;
}
}
@Bind(aggregate=true)
void newSallyDoc(SallyClient newDoc) throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
addDoc(newDoc);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy