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:
>   [1] org.apache.fop.layout.hyphenation.Hyphenator.getHyphenationTree 
> (Hyphenator.java:67)
>   [2] org.apache.fop.layout.hyphenation.Hyphenator.hyphenate (Hyphenator.java:232)
>   [3] org.apache.fop.layoutmgr.LineLayoutManager.getHyphenContext 
> (LineLayoutManager.java:479)
>   [4] org.apache.fop.layoutmgr.LineLayoutManager.getNextBreakPoss 
> (LineLayoutManager.java:228)
>   [5] org.apache.fop.layoutmgr.BlockLayoutManager.getNextBreakPoss 
> (BlockLayoutManager.java:204)
>   [6] org.apache.fop.layoutmgr.FlowLayoutManager.getNextBreakPoss 
> (FlowLayoutManager.java:79)
>   [7] org.apache.fop.layoutmgr.PageLayoutManager.getNextBreakPoss 
> (PageLayoutManager.java:229)
>   [8] org.apache.fop.layoutmgr.PageLayoutManager.doLayout 
> (PageLayoutManager.java:194)
> 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.

Jeremias Maerki

Reply via email to