|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.URLStreamHandler
org.eclipse.osgi.framework.internal.protocol.URLStreamHandlerProxy
public class URLStreamHandlerProxy
The URLStreamHandlerProxy is a URLStreamHandler that acts as a proxy for registered URLStreamHandlerServices. When a URLStreamHandler is requested from the URLStreamHandlerFactory and it exists in the service registry, a URLStreamHandlerProxy is created which will pass all the requests from the requestor to the real URLStreamHandlerService. We can't return the real URLStreamHandlerService from the URLStreamHandlerFactory because the JVM caches URLStreamHandlers and therefore would not support a dynamic environment of URLStreamHandlerServices being registered and unregistered.
| Field Summary | |
|---|---|
protected BundleContext |
context
|
protected java.lang.String |
protocol
|
protected int |
ranking
|
protected URLStreamHandlerService |
realHandlerService
|
protected URLStreamHandlerSetter |
urlSetter
|
protected ServiceTracker |
urlStreamHandlerServiceTracker
|
protected ServiceReference |
urlStreamServiceReference
|
| Constructor Summary | |
|---|---|
URLStreamHandlerProxy(java.lang.String protocol,
ServiceReference reference,
BundleContext context)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
addingService(ServiceReference reference)
A service is being added to the ServiceTracker. |
protected boolean |
equals(java.net.URL url1,
java.net.URL url2)
|
protected int |
getDefaultPort()
|
protected java.net.InetAddress |
getHostAddress(java.net.URL url)
|
protected int |
hashCode(java.net.URL url)
|
protected boolean |
hostsEqual(java.net.URL url1,
java.net.URL url2)
|
void |
modifiedService(ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker has been modified. |
protected java.net.URLConnection |
openConnection(java.net.URL url)
|
protected void |
parseURL(java.net.URL url,
java.lang.String str,
int start,
int end)
|
void |
removedService(ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker has been removed. |
protected boolean |
sameFile(java.net.URL url1,
java.net.URL url2)
|
void |
setURL(java.net.URL url,
java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String file,
java.lang.String ref)
|
void |
setURL(java.net.URL u,
java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String authority,
java.lang.String userInfo,
java.lang.String file,
java.lang.String query,
java.lang.String ref)
|
protected java.lang.String |
toExternalForm(java.net.URL url)
|
| Methods inherited from class java.net.URLStreamHandler |
|---|
openConnection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected URLStreamHandlerService realHandlerService
protected URLStreamHandlerSetter urlSetter
protected ServiceTracker urlStreamHandlerServiceTracker
protected BundleContext context
protected ServiceReference urlStreamServiceReference
protected java.lang.String protocol
protected int ranking
| Constructor Detail |
|---|
public URLStreamHandlerProxy(java.lang.String protocol,
ServiceReference reference,
BundleContext context)
| Method Detail |
|---|
protected boolean equals(java.net.URL url1,
java.net.URL url2)
equals in class java.net.URLStreamHandlerURLStreamHandler.equals(URL, URL)protected int getDefaultPort()
getDefaultPort in class java.net.URLStreamHandlerURLStreamHandler.getDefaultPort()protected java.net.InetAddress getHostAddress(java.net.URL url)
getHostAddress in class java.net.URLStreamHandlerURLStreamHandler.getHostAddress(URL)protected int hashCode(java.net.URL url)
hashCode in class java.net.URLStreamHandlerURLStreamHandler.hashCode(URL)
protected boolean hostsEqual(java.net.URL url1,
java.net.URL url2)
hostsEqual in class java.net.URLStreamHandlerURLStreamHandler.hostsEqual(URL, URL)
protected java.net.URLConnection openConnection(java.net.URL url)
throws java.io.IOException
openConnection in class java.net.URLStreamHandlerjava.io.IOExceptionURLStreamHandler.openConnection(URL)
protected void parseURL(java.net.URL url,
java.lang.String str,
int start,
int end)
parseURL in class java.net.URLStreamHandlerURLStreamHandler.parseURL(URL, String, int, int)
protected boolean sameFile(java.net.URL url1,
java.net.URL url2)
sameFile in class java.net.URLStreamHandlerURLStreamHandler.sameFile(URL, URL)protected java.lang.String toExternalForm(java.net.URL url)
toExternalForm in class java.net.URLStreamHandlerURLStreamHandler.toExternalForm(URL)
public void setURL(java.net.URL u,
java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String authority,
java.lang.String userInfo,
java.lang.String file,
java.lang.String query,
java.lang.String ref)
setURL in class java.net.URLStreamHandlerURLStreamHandler.setURL(URL, String, String, int, String, String, String, String, String)
public void setURL(java.net.URL url,
java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String file,
java.lang.String ref)
setURL in class java.net.URLStreamHandlerpublic java.lang.Object addingService(ServiceReference reference)
ServiceTrackerCustomizerServiceTracker.
This method is called before a service which matched the search
parameters of the ServiceTracker is added to the
ServiceTracker. This method should return the service object
to be tracked for the specified ServiceReference. The
returned service object is stored in the ServiceTracker and
is available from the getService and
getServices methods.
addingService in interface ServiceTrackerCustomizerreference - The reference to the service being added to the
ServiceTracker.
null if the specified referenced service
should not be tracked.ServiceTrackerCustomizer.addingService(ServiceReference)
public void modifiedService(ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker has been modified.
This method is called when a service being tracked by the
ServiceTracker has had it properties modified.
modifiedService in interface ServiceTrackerCustomizerreference - The reference to the service that has been modified.service - The service object for the specified referenced service.ServiceTrackerCustomizer.modifiedService(ServiceReference, Object)
public void removedService(ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker has been removed.
This method is called after a service is no longer being tracked by the
ServiceTracker.
removedService in interface ServiceTrackerCustomizerreference - The reference to the service that has been removed.service - The service object for the specified referenced service.ServiceTrackerCustomizer.removedService(ServiceReference, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||