com.novell.nds.dirxml.util.mail
Class StylesheetSource

java.lang.Object
  extended by com.novell.nds.dirxml.util.mail.FileSource
      extended by com.novell.nds.dirxml.util.mail.XmlDocumentSource
          extended by com.novell.nds.dirxml.util.mail.StylesheetSource

public class StylesheetSource
extends XmlDocumentSource

Manager class that will find and construct XSLT stylesheets. The stylesheets are cached.

Note that changes to the stylesheet sources are not picked up, so the driver must be shut down and restarted in order to get changed stylesheets.


Constructor Summary
StylesheetSource(String dnBase, File pathBase)
          Construct a StylesheetSource with the passed bases.
 
Method Summary
 Stylesheet getStylesheet(String path)
          Find and parse an XSLT stylesheet in the directory or file system.
 void releaseStylesheet(Stylesheet stylesheet)
          Call when finished using a Stylesheet returned by getStylesheet().
 
Methods inherited from class com.novell.nds.dirxml.util.mail.XmlDocumentSource
getXmlDocument
 
Methods inherited from class com.novell.nds.dirxml.util.mail.FileSource
getFile, getFile, resolveFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StylesheetSource

public StylesheetSource(String dnBase,
                        File pathBase)
Construct a StylesheetSource with the passed bases.

Parameters:
pathBase - Base location for files in file system.
dnBase - Base location for objects in directory.
Method Detail

getStylesheet

public Stylesheet getStylesheet(String path)
                         throws IOException
Find and parse an XSLT stylesheet in the directory or file system. Passed path is relative to dnBase or pathBase with which this object was constructed.

The returned stylesheet may be used without further synchronization by the calling thread. releaseStylesheet() must be called when the calling thread is finished using the Stylesheet so that the Stylesheet can be reused by a different thread.

Parameters:
path - Path to XSLT stylesheet.
Throws:
IOException - If data not found, is invalid XML or XSLT.
See Also:
releaseStylesheet(Stylesheet)

releaseStylesheet

public void releaseStylesheet(Stylesheet stylesheet)
Call when finished using a Stylesheet returned by getStylesheet().

Calling this method marks the passed Stylesheet as not-in-use so that other threads may use it.

Parameters:
stylesheet - Stylesheet returned from getStylesheet().
See Also:
getStylesheet(java.lang.String)