com.jtransc.service.JTranscService Maven / Gradle / Ivy
package com.jtransc.service;
import java.util.Iterator;
import java.util.ServiceLoader;
public class JTranscService {
static public T getFirst(Class clazz) {
Iterator iterator = ServiceLoader.load(clazz).iterator();
if (!iterator.hasNext()) throw new RuntimeException("Can't find service " + clazz);
return iterator.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy