org.jvnet.hk2.osgiadapter
Class OSGiDirectoryBasedRepository

java.lang.Object
  extended by com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
      extended by com.sun.enterprise.module.common_impl.DirectoryBasedRepository
          extended by org.jvnet.hk2.osgiadapter.OSGiDirectoryBasedRepository
All Implemented Interfaces:
Repository

public class OSGiDirectoryBasedRepository
extends DirectoryBasedRepository

Only OSGi bundles are recognized as modules.

Author:
Sanjeeb.Sahoo@Sun.COM

Field Summary
 
Fields inherited from class com.sun.enterprise.module.common_impl.DirectoryBasedRepository
repository
 
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
listeners
 
Constructor Summary
OSGiDirectoryBasedRepository(String name, File repository)
           
OSGiDirectoryBasedRepository(String name, File repository, boolean isTimerThreadDaemon)
           
 
Method Summary
protected  String getProperty(String property)
           
 void initialize()
          Initialize the repository for use.
protected  ModuleDefinition loadJar(File jar)
          This class overrides this mthod, because we don't support the following cases: 1.
protected  ModuleDefinition newModuleDefinition(File jar, Attributes attr)
          Extensibility point for subclasses to create a different instance of ModuleDefinition.
 
Methods inherited from class com.sun.enterprise.module.common_impl.DirectoryBasedRepository
addListener, isDisabled, loadModuleDefs, shutdown
 
Methods inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
add, addLibrary, find, findAll, findAll, getJarLocations, getLocation, getName, remove, removeLibrary, removeListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OSGiDirectoryBasedRepository

public OSGiDirectoryBasedRepository(String name,
                                    File repository)

OSGiDirectoryBasedRepository

public OSGiDirectoryBasedRepository(String name,
                                    File repository,
                                    boolean isTimerThreadDaemon)
Method Detail

initialize

public void initialize()
                throws IOException
Description copied from interface: Repository
Initialize the repository for use. This need to be called at least once before any find methods is invoked.

Specified by:
initialize in interface Repository
Overrides:
initialize in class AbstractRepositoryImpl
Throws:
IOException - if an error occur accessing the repository

loadJar

protected ModuleDefinition loadJar(File jar)
                            throws IOException
This class overrides this mthod, because we don't support the following cases: 1. external manifest.mf file for a jar file 2. jar file exploded as a directory. Both the cases are supported in HK2, but not in OSGi.

Overrides:
loadJar in class AbstractRepositoryImpl
Parameters:
jar - bundle jar
Returns:
a ModuleDefinition for this bundle
Throws:
IOException

newModuleDefinition

protected ModuleDefinition newModuleDefinition(File jar,
                                               Attributes attr)
                                        throws IOException
Description copied from class: AbstractRepositoryImpl
Extensibility point for subclasses to create a different instance of ModuleDefinition.

Overrides:
newModuleDefinition in class AbstractRepositoryImpl
Parameters:
jar - The module jar file for which ModuleDefinition will be created. Never null.
Throws:
IOException

getProperty

protected String getProperty(String property)


Copyright © 2013 Oracle Corporation. All Rights Reserved.