De : Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
> 
> Hi,
> 
> I'm working on making portlets load parallelly...  But I'm having 
> trouble tracing the lifecycle of a portlet.  Perhaps someone knows it 
> offhand.  what is the general flow?
> 
> My approach.. . add a method to Portlet called "preload" 
> which is called 
> in seperate threads before getContent (which is called single 
> threaded).. . But I need to know the hierachy of control...  
> What gets 
> called which calls what which calls Portlet.init and eventually 
> portlet.getcontent.  I'm debugging through but its jumping 
> all around so 
> its kinda hard to follow... especially at the drunkathon..I mean 
> Apachecon hackathon...
> 

So you can't wait for wednesday, can you ?
Here's a quick and dirty guide to the control flow and portlet 
lifefcyle:
- the first major point is that the current Jetspeed portlets *do not*
  behave like servlet-type components with a managed lifecycle.
- the overall structure of control is very similar to AWT, with 
  Portlet = Component, 
  PortletSet = Container, 
  PortletController = LayoutManager
- the Portlets are created and organized into a component tree by the
  PortalToolkit service (mainly getSet() method). This tree is then
  rendered by invoking getContent() on the root node of the tree.
  (This is typically done through the JetspeedTool).
  The PortalToolkit invokes the Portlet.init() method at this stage.
- There's already a setContent() method implemented in the AbstractPortlet
  that can be used to preload content (you still need to deal with the JSP
  case)
- the rendering is triggered by the use of JetspeedTool.getContent()

Maybe you can implement your solution by writing a custom PortletSet 
implementation that would create the content loading threads before invoking
the controller to lay out the complete page.
A little custom logic in AbstractPortlet should be enough to make sure that
a background thread can get a lock on the portlet toset its content without 
allowing getContent() from being called from the main request thread... 

I hope this helps.

--
Rapha�l Luta - [EMAIL PROTECTED]
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to