|
||||||||||
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 object. |
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 object 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 object 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.URLStreamHandler
URLStreamHandler.equals(URL, URL)
protected int getDefaultPort()
getDefaultPort
in class java.net.URLStreamHandler
URLStreamHandler.getDefaultPort()
protected java.net.InetAddress getHostAddress(java.net.URL url)
getHostAddress
in class java.net.URLStreamHandler
URLStreamHandler.getHostAddress(URL)
protected int hashCode(java.net.URL url)
hashCode
in class java.net.URLStreamHandler
URLStreamHandler.hashCode(URL)
protected boolean hostsEqual(java.net.URL url1, java.net.URL url2)
hostsEqual
in class java.net.URLStreamHandler
URLStreamHandler.hostsEqual(URL, URL)
protected java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOException
openConnection
in class java.net.URLStreamHandler
java.io.IOException
URLStreamHandler.openConnection(URL)
protected void parseURL(java.net.URL url, java.lang.String str, int start, int end)
parseURL
in class java.net.URLStreamHandler
URLStreamHandler.parseURL(URL, String, int, int)
protected boolean sameFile(java.net.URL url1, java.net.URL url2)
sameFile
in class java.net.URLStreamHandler
URLStreamHandler.sameFile(URL, URL)
protected java.lang.String toExternalForm(java.net.URL url)
toExternalForm
in class java.net.URLStreamHandler
URLStreamHandler.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.URLStreamHandler
URLStreamHandler.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.URLStreamHandler
public java.lang.Object addingService(ServiceReference reference)
ServiceTrackerCustomizer
ServiceTracker
object.
This method is called before a service which matched the search
parameters of the ServiceTracker
object is added to it.
This method should return the service object to be tracked for this
ServiceReference
object. The returned service object is
stored in the ServiceTracker
object and is available from
the getService
and getServices
methods.
addingService
in interface ServiceTrackerCustomizer
reference
- Reference to service being added to the
ServiceTracker
object.
ServiceReference
object or null
if
the ServiceReference
object should not be tracked.ServiceTrackerCustomizer.addingService(ServiceReference)
public void modifiedService(ServiceReference reference, java.lang.Object service)
ServiceTrackerCustomizer
ServiceTracker
object has been
modified.
This method is called when a service being tracked by the
ServiceTracker
object has had it properties modified.
modifiedService
in interface ServiceTrackerCustomizer
reference
- Reference to service that has been modified.service
- The service object for the modified service.ServiceTrackerCustomizer.modifiedService(ServiceReference, Object)
public void removedService(ServiceReference reference, java.lang.Object service)
ServiceTrackerCustomizer
ServiceTracker
object has been
removed.
This method is called after a service is no longer being tracked by the
ServiceTracker
object.
removedService
in interface ServiceTrackerCustomizer
reference
- Reference to service that has been removed.service
- The service object for the removed service.ServiceTrackerCustomizer.removedService(ServiceReference, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |