Bug 32054 - Pluggable area creation: AreaFactory
Summary: Pluggable area creation: AreaFactory
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: Other other
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 11:31 UTC by Tibor Vyletel
Modified: 2007-04-14 21:50 UTC (History)
1 user (show)



Attachments
AreaFactory patch (51.34 KB, patch)
2004-11-04 11:32 UTC, Tibor Vyletel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tibor Vyletel 2004-11-04 11:31:06 UTC
Creation of area objects was moved from LMs to classes implementing
org.apache.fop.area.AreaFactory interface. This interface provides a set of
create methods for different types of area objects.
Default implementation of this interface is in class called DefaultAreaFactory.

Additional changes:
+ FOUserAgent - getter & setter for AreaFactory
+ AbstractLayoutManager - getAreaFactory() --> convenience method for accesing
current area factory in layout manager
+ Default constructor was added to several area classes
Comment 1 Tibor Vyletel 2004-11-04 11:32:02 UTC
Created attachment 13325 [details]
AreaFactory patch
Comment 2 Clay Leeds 2004-11-04 16:47:49 UTC
A more complete 'brief' description of this is in this POST to fop-dev:

http://marc.theaimsgroup.com/?l=fop-dev&m=109956963917611&w=2
Comment 3 Glen Mazza 2004-11-04 20:34:54 UTC
In AbstractLayoutManager:

+    protected AreaFactory getAreaFactory() {
+        return (userAgent != null) ? userAgent.getAreaFactory() : null;
+    }

BTW, we can make AreaFactory a ThreadLocal in AbstractLayoutManager, correct?  
That way we can avoid .getAreaFactory() in FOUserAgent, also save the function 
call.

I understand we couldn't do ThreadLocal for FOEventHandler (potentially 
recursive FO documents within the same process would need a different instances 
of FOEventHandler) but this may be a good use-case for ThreadLocal here.