Leo Sutic wrote:

>Where is Merlin 2.0 's lifecycle extensions. Stephen told me to 
>check it out, but I looked in excalibur/assembly and what I found 
>was the Creator/Accessor stuff. 
>

These are the lifestyle extension interfaces that are container 
independent.  

>I'm not that keen on wading through all of Merlin to find the
>code he told me to check out - so could you give me a ViewCVS 
>URL?
>
Lifecycle extensions deal with interception points are two different 
places in the system.  

  1. during component startup and shutdown (the CREATE and
     DESTROY phases)
  2. during lookup and release from/to a CM/SM (the ACCESS
     and RELEASE phases)

Create/Destroy phase management
-------------------------------

In the org.apache.excalibur.merlin.resourceLifecycleHelper you will find 
the startup phase handling code.  This takes a supplied object and 
processes it though the startup sequence.  Before the object is 
initialized, the handleStageExtensions method is called.  This method 
does the following:

  1. retrieves the set of extension references that have been
     assigned as providers for the component extensions stages
  2. validates if the extension is applicable to the creation or
     destroy stage
  4. accesses the extension reference value
  5. if applicable, build the context for the extension
  6. applies the startup or shutdown phase object and extension
     context to the extension handler

http://cvs.apache.org/viewcvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/LifecycleHelper.java

Access/Release phase management.
--------------------------------

The class AbstractLifestyleHandler is the base class for all of the 
component lifestyle types (thread-safe, per-thread, pooled, transient). 
 It contains two abstract methods - get and put.  Concreate lifestyle 
class implemetations of thse two methods call the processAccessStage and 
processReleaseStage methods inside AbstractLifestyleHandler.

http://cvs.apache.org/viewcvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/AbstractLifestyleHandler.java

Other Resources
---------------

You can also take advantage of the Javadoc for the resource package.
http://home.osm.net/doc/merlin/api/assembly/org/apache/excalibur/merlin/resource/package-summary.html

One more class you may be interesting in reviewing is the 
DeploymentHelper (also in the resource package).  This class handles the 
creation of the different instances passed between a container and the 
component it is managing.  This includes the creation of context 
information for classic components and extensions.

http://cvs.apache.org/viewcvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/DeploymentHelper.java

Cheers, Steve.

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:[EMAIL PROTECTED]
http://www.osm.net




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

Reply via email to