EAF 7.4 Util

org.enhydra.util.jivan
Class JivanFactory

java.lang.Object
  extended by org.jivan.html.document.DocumentFactory
      extended by org.enhydra.util.jivan.JivanFactory

public class JivanFactory
extends org.jivan.html.document.DocumentFactory

Title: JivanFactory

Description: JivanFactory extends the capabilities of DocumentFactory class which is originaly supplied by Jivan project. The enhacements are the possibilites of logging and autoreloading. To invoke autoreloading, in the application configuration file, the parameter 'Server.Jivan.AutoReload' should be set to 'true'. Autoreloading parameter force Jivan DocumentFactory object to read neededy resource again from its source. Note that autoreloading slows down the performance, and it should be used in testing purpose. The default value for autoreloading is false.

Copyright: Copyright (c) 2004

Company: Together

Version:
1.0
Author:
Vladimir Radisic

Field Summary
 
Fields inherited from class org.jivan.html.document.DocumentFactory
instance, mapMasterDoc, mapSysemtId2Thread
 
Constructor Summary
JivanFactory(boolean reload, com.lutris.logging.LogChannel logChan)
          Constructs JivanFactory with autoreloading indicator, and given Log4j logging object.
 
Method Summary
 org.jivan.html.document.DocumentManager docManFor(java.lang.String resourceId, org.jivan.apache.xerces.xni.parser.XMLInputSource inp)
          Overrides DocumentFactory method in order to implement autoreloading possibility.
 com.lutris.logging.LogChannel getLogger()
          Returns logging object which can be used in applications.
 
Methods inherited from class org.jivan.html.document.DocumentFactory
classHTMLDocument, createDocInfo, createDocumentManager, docManFor, docManFor, docManFor, getInstance, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JivanFactory

public JivanFactory(boolean reload,
                    com.lutris.logging.LogChannel logChan)
Constructs JivanFactory with autoreloading indicator, and given Log4j logging object. This constructor initialise DocumentManager singleton object if it is not initialised yet.

Parameters:
reload - autoreloading status indicator (true = on, false = off).
logChan - logging object
Method Detail

getLogger

public com.lutris.logging.LogChannel getLogger()
Returns logging object which can be used in applications.

Returns:
logging object

docManFor

public org.jivan.html.document.DocumentManager docManFor(java.lang.String resourceId,
                                                         org.jivan.apache.xerces.xni.parser.XMLInputSource inp)
Overrides DocumentFactory method in order to implement autoreloading possibility. It retrieves a DocumentManager for the specific 'resourceId'. Also, if DocumentManager for the corresponding 'resourceId' does not exists, it reads given XMLInputSource object and creates DocumentManager.

Other docManFor() methods also call this method. docManFor() with single argument of String type, calls this method with self created XMLInputSource object by using its 'systemId' argument, which represents the location of the resource.

For example the systemId can look like:

file:///C:/projects/testjivan/Welcome.html

Overrides:
docManFor in class org.jivan.html.document.DocumentFactory
Parameters:
resourceId - unique resource identifier which is used as key for retrieving corresponding DocumentManager.
inp - XMLInputSource object which is taken as resource in case when there is no corresponding DocumentManager for given 'resourceId'.
Returns:
DocumentManager which corresponds to given 'resourceId'.

EAF 7.4 Util