org.ow2.jonas.lib.loader
Class MetaInfScanner

java.lang.Object
  extended by org.ow2.jonas.lib.loader.MetaInfScanner
All Implemented Interfaces:
IMetaInfLocator

public class MetaInfScanner
extends Object
implements IMetaInfLocator

This class will track all META-INF/ resources (except MANIFEST) so that we can get URL for META-INF/services/* key for example.

Author:
Florent Benoit

Constructor Summary
MetaInfScanner(org.osgi.framework.BundleContext bundleContext)
          Default constructor for the given bundle context.
 
Method Summary
 URL getResource(String name)
          Gets an URL for a given resource name.
 InputStream getResourceAsStream(String name)
          Gets inputstream for the given name.
 Enumeration<URL> getResources(String name)
          Gets list of URL for the given resource name.
 void start()
          Register the service when we start.
 void stop()
          Stop the locator and stop tracking entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaInfScanner

public MetaInfScanner(org.osgi.framework.BundleContext bundleContext)
Default constructor for the given bundle context.

Parameters:
bundleContext - the bundle context
Method Detail

start

public void start()
Register the service when we start. So we will track META-INF/ entries


stop

public void stop()
Stop the locator and stop tracking entries.


getResource

public URL getResource(String name)
Gets an URL for a given resource name.

Specified by:
getResource in interface IMetaInfLocator
Parameters:
name - the name to search
Returns:
value else null if not found

getResourceAsStream

public InputStream getResourceAsStream(String name)
Gets inputstream for the given name.

Specified by:
getResourceAsStream in interface IMetaInfLocator
Parameters:
name - the name to search
Returns:
value else null if not found

getResources

public Enumeration<URL> getResources(String name)
                              throws IOException
Gets list of URL for the given resource name.

Specified by:
getResources in interface IMetaInfLocator
Parameters:
name - the name to search
Returns:
value else null if not found
Throws:
IOException - if there is an error while searching entry


Copyright © 2012 OW2 Consortium. All Rights Reserved.