org.jvnet.hk2.osgiadapter
Class OSGiModuleDefinition

java.lang.Object
  extended by org.jvnet.hk2.osgiadapter.OSGiModuleDefinition
All Implemented Interfaces:
ModuleDefinition, Serializable

public class OSGiModuleDefinition
extends Object
implements ModuleDefinition, Serializable

Author:
Sanjeeb.Sahoo@Sun.COM
See Also:
Serialized Form

Constructor Summary
OSGiModuleDefinition(org.osgi.framework.Bundle b)
           
OSGiModuleDefinition(File jar)
           
OSGiModuleDefinition(Jar jarFile, URI location)
           
 
Method Summary
 ModuleDependency[] getDependencies()
          Returns the list of this module's dependencies.
 String getImportPolicyClassName()
          Returns the import policy class name.
 String getLifecyclePolicyClassName()
          Returns the lifecycle policy class name.
 URI[] getLocations()
          A Module is implemented by one to many jar files.
 Manifest getManifest()
          Returns the manifest file for the main module jar file
 ModuleMetadata getMetadata()
          Gets the metadata that describes various components and services in this module.
 String getName()
          Returns the module name, usually this is the same name as the jar file name containing the module's implementation.
 String[] getPublicInterfaces()
          Returns a list of public interfaces for this module.
 String getVersion()
          Returns the version of this module's implementation
 String toString()
          Assists debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OSGiModuleDefinition

public OSGiModuleDefinition(File jar)
                     throws IOException
Throws:
IOException

OSGiModuleDefinition

public OSGiModuleDefinition(Jar jarFile,
                            URI location)
                     throws IOException
Throws:
IOException

OSGiModuleDefinition

public OSGiModuleDefinition(org.osgi.framework.Bundle b)
                     throws IOException,
                            URISyntaxException
Throws:
IOException
URISyntaxException
Method Detail

getName

public String getName()
Description copied from interface: ModuleDefinition
Returns the module name, usually this is the same name as the jar file name containing the module's implementation.

Specified by:
getName in interface ModuleDefinition
Returns:
module name

getPublicInterfaces

public String[] getPublicInterfaces()
Description copied from interface: ModuleDefinition
Returns a list of public interfaces for this module. Public interface can be packages, interfaces, or classes

Specified by:
getPublicInterfaces in interface ModuleDefinition
Returns:
a array of public interfaces

getDependencies

public ModuleDependency[] getDependencies()
Description copied from interface: ModuleDefinition
Returns the list of this module's dependencies. Each dependency must be satisfied at run time for this module to function properly.

Specified by:
getDependencies in interface ModuleDefinition
Returns:
List of bundles on which this bundle depends on using Require-Bundle

getLocations

public URI[] getLocations()
Description copied from interface: ModuleDefinition
A Module is implemented by one to many jar files. This method returns the list of jar files implementing the module

Specified by:
getLocations in interface ModuleDefinition
Returns:
the module's list of implementation jars

getVersion

public String getVersion()
Description copied from interface: ModuleDefinition
Returns the version of this module's implementation

Specified by:
getVersion in interface ModuleDefinition
Returns:
a version number

getImportPolicyClassName

public String getImportPolicyClassName()
Description copied from interface: ModuleDefinition
Returns the import policy class name. Although the implementation of this policy does not necessary have to implement the ImportPolicy, but could use another interface, it is the responsibility of the associated Repository to invoke that interface when the module is started.

Specified by:
getImportPolicyClassName in interface ModuleDefinition
Returns:
Fully qualified class name that's assignable to ImportPolicy, or null if no import policy exists.

getLifecyclePolicyClassName

public String getLifecyclePolicyClassName()
Description copied from interface: ModuleDefinition
Returns the lifecycle policy class name. Although the implementation of this policy does not necessary have to implement the LifecyclePolicy, but could use another interface, it is the responsibility of the associated Repository to invoke that interface when the module is started.

Specified by:
getLifecyclePolicyClassName in interface ModuleDefinition
Returns:
Fully qualified class name that's assignable to LifecyclePolicy, or null if no import policy exists.

getManifest

public Manifest getManifest()
Description copied from interface: ModuleDefinition
Returns the manifest file for the main module jar file

Specified by:
getManifest in interface ModuleDefinition
Returns:
the manifest file

getMetadata

public ModuleMetadata getMetadata()
Description copied from interface: ModuleDefinition
Gets the metadata that describes various components and services in this module.

Specified by:
getMetadata in interface ModuleDefinition
Returns:
Always non-null.

toString

public String toString()
Assists debugging.

Overrides:
toString in class Object


Copyright © 2013 Oracle Corporation. All Rights Reserved.