/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String) * @deprecated */ public void setURL(URL url, String protocol, String host, int port, String file, String ref) { handlerProxy.setURL(url, protocol, host, port, file, ref); }
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String) * @deprecated */ public void setURL(URL url, String protocol, String host, int port, String file, String ref) { handlerProxy.setURL(url, protocol, host, port, file, ref); }
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String, String, String, String) */ public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) { handlerProxy.setURL(url, protocol, host, port, authority, userInfo, path, query, ref); }
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String, String, String, String) */ public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) { handlerProxy.setURL(url, protocol, host, port, authority, userInfo, path, query, ref); }
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String) * @deprecated */ public void setURL(URL url, String protocol, String host, int port, String file, String ref) { handlerProxy.setURL(url, protocol, host, port, file, ref); }
for (int j = 0; j < protocols.length; j++) { if (protocols[j].equals(protocol)) { handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context); proxies.put(protocol, handler); return (handler);
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) return; // If so, look for a lower ranking URLHandler // this should get us the highest ranking service left, if available ServiceReference<URLStreamHandlerService> newReference = urlStreamHandlerServiceTracker.getServiceReference(); // if newReference == null then we will use the NullURLStreamHandlerService here setNewHandler(newReference, getRank(newReference)); }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String, String, String, String) */ public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) { handlerProxy.setURL(url, protocol, host, port, authority, userInfo, path, query, ref); }
/** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(ServiceReference) */ public ServiceReference<URLStreamHandlerService> addingService(ServiceReference<URLStreamHandlerService> reference) { //check to see if our protocol is being registered by another service Object prop = reference.getProperty(URLConstants.URL_HANDLER_PROTOCOL); if (!(prop instanceof String[])) return null; String[] protocols = (String[]) prop; for (int i = 0; i < protocols.length; i++) { if (protocols[i].equals(protocol)) { //If our protocol is registered by another service, check the service ranking and switch URLStreamHandlers if nessecary. int newServiceRanking = getRank(reference); if (newServiceRanking > ranking || urlStreamServiceReference == null) setNewHandler(reference, newServiceRanking); return reference; } } //we don't want to continue hearing events about a URLStreamHandlerService not registered under our protocol return null; }
/** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String) * @deprecated */ public void setURL(URL url, String protocol, String host, int port, String file, String ref) { handlerProxy.setURL(url, protocol, host, port, file, ref); }