net.dpml.transit
Class Transit

java.lang.Object
  extended by net.dpml.transit.Transit

public final class Transit
extends Object

The Transit class manages the establishment of a singleton transit instance. The implementation establishes an internal cache management system, a suite of protocol handlers, and a dynamic content handler service. During initialization Transit will load an XML configuration descibing the available remote hosts. The XML file will be resolved using the following strategy:

During initialization Transit will create the following system properties:

Version:
2.1.1
Author:
Digital Product Management Library

Field Summary
static File CONFIG
          The Transit shared config directory.
static File DATA
          The Transit personal data directory.
static File HOME
          The DPML home directory established via assesment of the the ${dpml.home} system property and the DPML_HOME environment variable.
static File PREFS
          The Transit personal preferences directory.
static File SYSTEM
          If a system property named "dpml.system" is defined then the value is assigned otherwise the implementation will look for an environment variable DPML_SYSTEM.
static String VERSION
          The Transit system version.
 
Method Summary
 void addMonitor(Monitor monitor)
          Add a monitor to Transit.
 File getCacheDirectory()
          Return the current cache directory.
 Layout getCacheLayout()
          Return the cache layout.
 ContentHandler getContentHandler(String type)
          Return the content handler fo the supplied content type.
static Transit getInstance()
          Returns the singleton instance of the transit system.
 LinkManager getLinkManager()
          Return the link manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOME

public static final File HOME
The DPML home directory established via assesment of the the ${dpml.home} system property and the DPML_HOME environment variable.


SYSTEM

public static final File SYSTEM
If a system property named "dpml.system" is defined then the value is assigned otherwise the implementation will look for an environment variable DPML_SYSTEM.


DATA

public static final File DATA
The Transit personal data directory. The location of this diectory is system dependent.


PREFS

public static final File PREFS
The Transit personal preferences directory. The location of this diectory is system dependent.


CONFIG

public static final File CONFIG
The Transit shared config directory. The location of this diectory is system dependent.


VERSION

public static final String VERSION
The Transit system version.

See Also:
Constant Field Values
Method Detail

getInstance

public static Transit getInstance()
                           throws TransitError
Returns the singleton instance of the transit system. If Transit has not been initialized the transit configuration will be resolved using the System property dpml.transit.profile.

Returns:
the singleton transit instance
Throws:
TransitError - if an error occurs during establishment

getCacheDirectory

public File getCacheDirectory()
Return the current cache directory.

Returns:
the cache directory.

getLinkManager

public LinkManager getLinkManager()
Return the link manager.

Returns:
the link manager

getCacheLayout

public Layout getCacheLayout()
Return the cache layout.

Returns:
the layout

addMonitor

public void addMonitor(Monitor monitor)
Add a monitor to Transit.

Parameters:
monitor - the monitor to add

getContentHandler

public ContentHandler getContentHandler(String type)
Return the content handler fo the supplied content type.

Parameters:
type - the content handler type
Returns:
the content handler or null if no content handler found