net.dpml.transit
Class DefaultTransitModel

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bynet.dpml.util.UnicastEventSource
                  extended bynet.dpml.transit.DefaultModel
                      extended bynet.dpml.transit.DefaultTransitModel
All Implemented Interfaces:
Disposable, EventHandler, Remote, Serializable, TransitModel

public class DefaultTransitModel
extends DefaultModel
implements TransitModel

The DefaultTransitModel class maintains an active configuration of the Transit system.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
static String DEFAULT_PROFILE_PATH
          Default configuration url path.
static URI DEFAULT_PROFILE_URI
          Default configuration url path.
static String PROFILE_KEY
          System property key used to hold an overriding configuration url.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DefaultTransitModel(EventQueue queue, Logger logger, TransitDirective directive)
          Creation of a new TransitModel using a supplied configuration and logging channel.
DefaultTransitModel(Logger logger, TransitDirective directive)
          Creation of a new TransitModel using a supplied configuration and logging channel.
 
Method Summary
 void addDisposalListener(DisposalListener listener)
          Add a disposal listener to the model.
 void dispose()
          Trigger disposal of the transit model.
 CacheModel getCacheModel()
          Return the cache model.
static DefaultTransitModel getDefaultModel()
          Resolve the transit configuration using the default resource path local:xml:dpml/transit/config.
static DefaultTransitModel getDefaultModel(Logger logger)
          Resolve the transit configuration using the default resource path local:xml:dpml/transit/config.
static DefaultTransitModel getDefaultModel(String category)
          Resolve the transit configuration using the default resource path local:xml:dpml/transit/config.
 ProxyModel getProxyModel()
          Return the proxy configuration model.
static DefaultTransitModel getSecureModel(Logger logger)
          Return a model that is restricted to the secure local environment with no proxy setting or external hosts.
 void processEvent(EventObject eventObject)
          Internal event handler.
 void removeDisposalListener(DisposalListener listener)
          Remove a disposal listener from the model.
 
Methods inherited from class net.dpml.transit.DefaultModel
enqueueEvent, getLogger
 
Methods inherited from class net.dpml.util.UnicastEventSource
addListener, enqueueEvent, getEventListeners, getEventQueue, getLocalLogger, getLock, removeListener, terminate
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PROFILE_PATH

public static final String DEFAULT_PROFILE_PATH
Default configuration url path.

See Also:
Constant Field Values

DEFAULT_PROFILE_URI

public static final URI DEFAULT_PROFILE_URI
Default configuration url path.


PROFILE_KEY

public static final String PROFILE_KEY
System property key used to hold an overriding configuration url.

See Also:
Constant Field Values
Constructor Detail

DefaultTransitModel

public DefaultTransitModel(Logger logger,
                           TransitDirective directive)
                    throws RemoteException,
                           NullPointerException
Creation of a new TransitModel using a supplied configuration and logging channel. The implementation will construct a proxy model, layout registry model, cache model, and repository codebase model using the supplied configuration.

Parameters:
logger - the assigned loging channel
directive - the transit configuration
Throws:
NullPointerException - if the logger or directive arguments are null
RemoteException - if a remote exception occurs

DefaultTransitModel

public DefaultTransitModel(EventQueue queue,
                           Logger logger,
                           TransitDirective directive)
                    throws RemoteException,
                           NullPointerException
Creation of a new TransitModel using a supplied configuration and logging channel. The implementation will construct a proxy model, layout registry model, cache model, and repository codebase model using the supplied configuration.

Parameters:
queue - the event queue
logger - the assigned logging channel
directive - the transit configuration
Throws:
NullPointerException - if the logger or directive arguments are null
RemoteException - if a remote exception occurs
Method Detail

getSecureModel

public static DefaultTransitModel getSecureModel(Logger logger)
Return a model that is restricted to the secure local environment with no proxy setting or external hosts.

Parameters:
logger - the logging channel to assign to the model
Returns:
the transit model

getDefaultModel

public static DefaultTransitModel getDefaultModel()
                                           throws Exception
Resolve the transit configuration using the default resource path local:xml:dpml/transit/config. If the resource does not exist a classic default scenario will be returned.

Returns:
the transit model
Throws:
Exception - if an error occurs during model construction

getDefaultModel

public static DefaultTransitModel getDefaultModel(String category)
                                           throws Exception
Resolve the transit configuration using the default resource path local:xml:dpml/transit/config. If the resource does not exist a classic default scenario will be returned.

Parameters:
category - the logging channel category name
Returns:
the transit model
Throws:
Exception - if an error occurs during model construction

getDefaultModel

public static DefaultTransitModel getDefaultModel(Logger logger)
                                           throws Exception
Resolve the transit configuration using the default resource path local:xml:dpml/transit/config. If the resource does not exist a classic default scenario will be returned.

Parameters:
logger - the logging channel
Returns:
the transit model
Throws:
Exception - if an error occurs during model construction

getProxyModel

public ProxyModel getProxyModel()
Return the proxy configuration model.

Specified by:
getProxyModel in interface TransitModel
Returns:
the proxy model (null if no proxy config defined).

getCacheModel

public CacheModel getCacheModel()
Return the cache model.

Specified by:
getCacheModel in interface TransitModel
Returns:
the cache model

addDisposalListener

public void addDisposalListener(DisposalListener listener)
Add a disposal listener to the model.

Specified by:
addDisposalListener in interface TransitModel
Parameters:
listener - the listener to add

removeDisposalListener

public void removeDisposalListener(DisposalListener listener)
Remove a disposal listener from the model.

Specified by:
removeDisposalListener in interface TransitModel
Parameters:
listener - the listener to remove

processEvent

public void processEvent(EventObject eventObject)
Internal event handler.

Specified by:
processEvent in interface EventHandler
Specified by:
processEvent in class UnicastEventSource
Parameters:
eventObject - the event to handle

dispose

public void dispose()
Trigger disposal of the transit model.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class DefaultModel