Class URLHandlersStreamHandlerProxy

java.lang.Object
java.net.URLStreamHandler
org.apache.felix.framework.URLHandlersStreamHandlerProxy
All Implemented Interfaces:
InvocationHandler, URLStreamHandlerSetter

public class URLHandlersStreamHandlerProxy extends URLStreamHandler implements URLStreamHandlerSetter, InvocationHandler

This class implements a stream handler proxy. When the stream handler proxy instance is created, it is associated with a particular protocol and will answer all future requests for handling of that stream type. It does not directly handle the stream handler requests, but delegates the requests to an underlying stream handler service.

The proxy instance for a particular protocol is used for all framework instances that may contain their own stream handler services. When performing a stream handler operation, the proxy retrieves the handler service from the framework instance associated with the current call stack and delegates the call to the handler service.

The proxy will create simple stream handler service trackers for each framework instance. The trackers will listen to service events in its respective framework instance to maintain a reference to the "best" stream handler service at any given time.