net.larsan.urd.archive
Class ServiceArchive

java.lang.Object
  |
  +--net.larsan.urd.archive.ServiceArchive

public class ServiceArchive
extends java.lang.Object

A service archive contains a JAR file with a modified manifest for specialized Norna Service Archive properties.

This class pre-read the manifest, but this might change.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Field Summary
static java.util.jar.Attributes.Name EXPORT_PACKAGE
          Attribute name for the exported packages of a class.
static java.util.jar.Attributes.Name IMPORT_PACKAGE
          Attribute name for the imported packages of a class.
static java.util.jar.Attributes.Name SERVICE_CLASS
          Attribute name for the main norna service class.
 
Constructor Summary
ServiceArchive(java.io.File file)
          Create archive from a file.
 
Method Summary
 PackageSet getExportedPackages()
          Get the exported packages from this archive.
 java.io.File getFile()
          Get the file object that represents this archive.
 PackageSet getImportedPackages()
          Get the imported packages from this archive.
 java.lang.String getServiceClass()
          Get the main service class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_CLASS

public static final java.util.jar.Attributes.Name SERVICE_CLASS
Attribute name for the main norna service class.


EXPORT_PACKAGE

public static final java.util.jar.Attributes.Name EXPORT_PACKAGE
Attribute name for the exported packages of a class.


IMPORT_PACKAGE

public static final java.util.jar.Attributes.Name IMPORT_PACKAGE
Attribute name for the imported packages of a class.

Constructor Detail

ServiceArchive

public ServiceArchive(java.io.File file)
               throws java.io.IOException
Create archive from a file. The jar file will not be verified if it is signed since this is not the file that load the classes.

Parameters:
file - Jar file to read
Throws:
java.io.IOException - If the file is not found, or on IO errors
Method Detail

getServiceClass

public java.lang.String getServiceClass()
                                 throws java.io.IOException
Get the main service class name. This check the 'Norna-Service' manifest attribute. Returns null if not found.

Returns:
The service class name, or null if not found
Throws:
java.io.IOException - On read errors

getFile

public java.io.File getFile()
Get the file object that represents this archive.

Returns:
The file obejct for this archive

getExportedPackages

public PackageSet getExportedPackages()
Get the exported packages from this archive. This will return an empty set if no packages are exported.

Returns:
A package set of exported packages.

getImportedPackages

public PackageSet getImportedPackages()
Get the imported packages from this archive. This will return an empty set if no packages are imported.

Returns:
A package set of imported packages.