private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();
@Override
protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
@Override
public URLConnection openConnection(URL url) throws IOException {
return new URL(null, url.toExternalForm(), handler).openConnection();
}
};