org.ops4j.pax.runner.handler.internal
Class CompositeURLStreamHandlerFactory

java.lang.Object
  extended by org.ops4j.pax.runner.handler.internal.CompositeURLStreamHandlerFactory
All Implemented Interfaces:
java.net.URLStreamHandlerFactory

public class CompositeURLStreamHandlerFactory
extends java.lang.Object
implements java.net.URLStreamHandlerFactory

An composite URLStreamHandlerFactory that used it's internal list of registred URLStreamHandlerFactories to find out if they can handle the requestd protocol. First one that canhandle (does not return null) will be returned.

Since:
0.5.6, December 13, 2007
Author:
Alin Dreghiciu
See Also:
URLStreamHandlerFactory

Constructor Summary
CompositeURLStreamHandlerFactory()
          Creates a new composite url stream handler factory.
 
Method Summary
 java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
          Searches the registered factories for one that can handle the protocol.
 CompositeURLStreamHandlerFactory registerFactory(java.net.URLStreamHandlerFactory factory)
          Registeres a factory with the composite.
 CompositeURLStreamHandlerFactory unregisterFactory(java.net.URLStreamHandlerFactory factory)
          Unregisteres a factory with the composite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeURLStreamHandlerFactory

public CompositeURLStreamHandlerFactory()
Creates a new composite url stream handler factory.

Method Detail

createURLStreamHandler

public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
Searches the registered factories for one that can handle the protocol. First that can (does not return null) will be returned.

Specified by:
createURLStreamHandler in interface java.net.URLStreamHandlerFactory
See Also:
URLStreamHandlerFactory

registerFactory

public CompositeURLStreamHandlerFactory registerFactory(java.net.URLStreamHandlerFactory factory)
Registeres a factory with the composite.

Parameters:
factory - to be registered. Cannot be null.
Returns:
self, for fluent api use

unregisterFactory

public CompositeURLStreamHandlerFactory unregisterFactory(java.net.URLStreamHandlerFactory factory)
Unregisteres a factory with the composite. If the factory was not registered before the method will return silently.

Parameters:
factory - to be unregistered. Cannot be null.
Returns:
self, for fluent api use


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.