io.apicurio.registry.util.WSDLReaderAccessor Maven / Gradle / Ivy
The newest version!
package io.apicurio.registry.util;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
public class WSDLReaderAccessor {
private static ThreadLocal threadLocalWsdlReader = new ThreadLocal() {
@Override
protected WSDLReader initialValue() {
WSDLReader wsdlReader = null;
try {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
wsdlReader = wsdlFactory.newWSDLReader();
} catch (WSDLException e) {
throw new RuntimeException(e);
}
return wsdlReader;
}
};
public static final WSDLReader getWSDLReader() {
return threadLocalWsdlReader.get();
}
}