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 together with a service supporting the deployment of a application plugin and access to transit monitor routers.

Version:
1.0.3
Author:
Digital Product Meta Library

Field Summary
static String DATA_KEY
          DPML data key.
static File DPML_DATA
          The Transit personal data directory.
static File DPML_HOME
          The DPML home directory established via assesment of the the ${dpml.home} system property and the DPML_HOME environment variable.
static File DPML_PREFS
          The Transit personal preferences directory.
static File DPML_SYSTEM
          If a system property named "dpml.system" is defined then the value is assigned otherwise the implementation will look for an environment variable named "DPML_SYSTEM".
static String HOME_KEY
          DPML home key.
static String HOME_SYMBOL
          DPML environment variable string.
static String PREFS_KEY
          DPML prefs key.
static String SHARE_KEY
          Transit share key (alias to dpml.system).
static String SYSTEM_KEY
          Transit system key.
static String SYSTEM_SYMBOL
          DPML environment variable string.
static String VERSION
          The Transit system version.
 
Method Summary
 File getCacheDirectory()
          Return the current cache directory.
 Layout getCacheLayout()
          Return the cache layout.
 CacheMonitorRouter getCacheMonitorRouter()
          Returns a reference to the cache monitor router.
static Transit getInstance()
          Returns the singleton instance of the transit system.
static Transit getInstance(TransitModel model)
          Returns the singleton instance of the transit system.
 Layout getLayout(String id)
          Return a layout object matching the supplied identifier.
 LinkManager getLinkManager()
          Return the link manager.
 PrintWriter getLogWriter()
          Returns the LogWriter for the Transit system.
 NetworkMonitorRouter getNetworkMonitorRouter()
          Returns a reference to the netowork monitor router.
 RepositoryMonitorRouter getRepositoryMonitorRouter()
          Returns a reference to the repository monitor router.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOME_KEY

public static final String HOME_KEY
DPML home key.

See Also:
Constant Field Values

DATA_KEY

public static final String DATA_KEY
DPML data key.

See Also:
Constant Field Values

PREFS_KEY

public static final String PREFS_KEY
DPML prefs key.

See Also:
Constant Field Values

SYSTEM_KEY

public static final String SYSTEM_KEY
Transit system key.

See Also:
Constant Field Values

SHARE_KEY

public static final String SHARE_KEY
Transit share key (alias to dpml.system).

See Also:
Constant Field Values

HOME_SYMBOL

public static final String HOME_SYMBOL
DPML environment variable string.

See Also:
Constant Field Values

SYSTEM_SYMBOL

public static final String SYSTEM_SYMBOL
DPML environment variable string.

See Also:
Constant Field Values

DPML_HOME

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


DPML_SYSTEM

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


DPML_DATA

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


DPML_PREFS

public static final File DPML_PREFS
The Transit personal preferences 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 a the transit model will be resolved using the System property dpml.transit.profile.

Returns:
the singleton transit instance
Throws:
TransitError - if an error occurs during establishment
See Also:
DefaultTransitModel.getDefaultModel()

getInstance

public static Transit getInstance(TransitModel model)
                           throws IOException,
                                  TransitAlreadyInitializedException
Returns the singleton instance of the transit system. If this method has already been invoked the server and monitor argument will be ignored.

Parameters:
model - the activate transit model
Returns:
the singleton transit instance
Throws:
IOException - if an error occurs during establishment
TransitAlreadyInitializedException - if Transit is already initialized

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

getLayout

public Layout getLayout(String id)
                 throws UnknownKeyException,
                        IOException
Return a layout object matching the supplied identifier.

Parameters:
id - the layout identifier
Returns:
the layout object
Throws:
UnknownKeyException - if the supplied layout id is unknown
IOException - if an IO error occurs

getRepositoryMonitorRouter

public RepositoryMonitorRouter getRepositoryMonitorRouter()
Returns a reference to the repository monitor router. Client application may use the router to add, remove or replace existing monitors.

Returns:
the repository monitor router

getCacheMonitorRouter

public CacheMonitorRouter getCacheMonitorRouter()
Returns a reference to the cache monitor router. Client application may use the router to add, remove or replace existing monitors.

Returns:
the cache monitor router

getNetworkMonitorRouter

public NetworkMonitorRouter getNetworkMonitorRouter()
Returns a reference to the netowork monitor router. Client application may use the router to add, remove or replace existing monitors.

Returns:
the network monitor router

getLogWriter

public PrintWriter getLogWriter()
Returns the LogWriter for the Transit system. This writer should only be used to report information that should not be output to the user in the course of normal execution but can aid to determine what has gone wrong in Transit, such as configuration problems, network problems and security issues.

Returns:
a PrintWriter where troubleshooting information can be written to.