org.apache.felix.ipojo.online.manipulator
Class IPOJOURLHandler

java.lang.Object
  extended by java.net.URLStreamHandler
      extended by org.osgi.service.url.AbstractURLStreamHandlerService
          extended by org.apache.felix.ipojo.online.manipulator.IPOJOURLHandler
All Implemented Interfaces:
URLStreamHandlerService

public class IPOJOURLHandler
extends AbstractURLStreamHandlerService
implements URLStreamHandlerService

iPOJO URL Handler allowing installation time manipulation. When a bundle is installed with the ipojo: URL prefix, the bundle is downloaded and manipulated by this handler. The metadata.xml file can either be provided inside the bundle (root, or in META-INF) or given in the URL: ipojo:URL_BUNDLE!URL_METADATA.

Author:
Felix Project Team

Field Summary
 
Fields inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
realHandler
 
Constructor Summary
IPOJOURLHandler(BundleContext bc)
          Creates a IPOJOURLHandler.
 
Method Summary
 URLConnection openConnection(URL url)
          Opens a connection using the ipojo url handler.
 void stop()
          Stops the URL handler: Deletes the working directory.
 
Methods inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.net.URLStreamHandler
parseURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.osgi.service.url.URLStreamHandlerService
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, toExternalForm
 

Constructor Detail

IPOJOURLHandler

public IPOJOURLHandler(BundleContext bc)
Creates a IPOJOURLHandler. Gets the bundle context and create the working directory.

Parameters:
bc - the bundle context
Method Detail

stop

public void stop()
Stops the URL handler: Deletes the working directory.


openConnection

public URLConnection openConnection(URL url)
                             throws IOException
Opens a connection using the ipojo url handler. This methods parses the URL and manipulate the given bundle.

Specified by:
openConnection in interface URLStreamHandlerService
Specified by:
openConnection in class AbstractURLStreamHandlerService
Parameters:
url - the url.
Returns:
the URL connection on the manipulated bundle
Throws:
IOException - occurs when the bundle cannot be either downloaded, or manipulated or installed correctly.
See Also:
AbstractURLStreamHandlerService.openConnection(java.net.URL)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.