On 08.05.2004 23:04:40 Simon Pepping wrote:
> I am trying to enable user configuration of the directory of
> hyphenation files, like in the maintenance code. Configuration of the
> renderers is easy, because they are instantiated in Fop.main(). But
> hyphenation is done deep down in the process, where any reference to
> the start-up objects is lost. How can I configure it?
> If I am correct, in the maintenance code the user configuration could
> be accessed by a static method, anywhere in the process, just like a
> log file in commons logging. I suppose that is not the preferred
> way of accessing configuration in HEAD?
Indeed. Logging is a special case where static lookup is in order. For
the other cases lookup via references is preferred (IMO).
> This is the stack frame:
>  org.apache.fop.layout.hyphenation.Hyphenator.getHyphenationTree
>  org.apache.fop.layout.hyphenation.Hyphenator.hyphenate (Hyphenator.java:232)
>  org.apache.fop.layoutmgr.LineLayoutManager.getHyphenContext
>  org.apache.fop.layoutmgr.LineLayoutManager.getNextBreakPoss
>  org.apache.fop.layoutmgr.BlockLayoutManager.getNextBreakPoss
>  org.apache.fop.layoutmgr.FlowLayoutManager.getNextBreakPoss
>  org.apache.fop.layoutmgr.PageLayoutManager.getNextBreakPoss
>  org.apache.fop.layoutmgr.PageLayoutManager.doLayout
> The first two frames are in static context. The LMs share a reference
> to a user agent object, of type
> layoutmgr.AbstractLayoutManager.userAgent. Would this be the right
> object to hold a reference to the user configuration?
On first thought, yes. But I feel the scope of the FOUserAgent is still
somewhat undefined. Maybe we need to finally settle this issue. Until
this is done I consider it safe to hold the user configuration in there.
We can change that easily later.