OK.

Just a recap.  I need to get this done ASAP for Jetspeed 1.1.5 so here
is a modified proposal which I think should address any concerns.  I
have not included multi-class Initialization because I think this is
overkill and kind of kludgy.  -1 me if you think it is important.  I
have thought about a lot of scenarios and performing your own
Initialization and handling the different startup cases is important.

Anyway it will be based on two properties:

turbine.external.init.classname=<CLASSNAME>
turbine.external.init.onstartup=<BOOLEAN>

I changed it to turbine.external.init so that it was obvious that this
code really isn't part of the Turbine framework.

If you specify onstartup=true then the initialization will occur within
Turbine.init() else Turbine.doGet().  

Here is the prototype for the interface:

public interface TurbineInitable {

    /**
    Called by Turbine when this class needs to be initialized.  You
should
    throw an InitializationException if anything happens that would
cause
    your code not to work correctly.
    */
    public void init() throws InitializationException;

    /**
    If this TurbineInitable is not started from init() then Turbine will
    provide you with RunData for you to use in your initialization
    @return null if this was called from Turbine.init() 
    */
    public RunData getRunData();

    /**
    Set the RunData for this TurbineInitable
    */
    public void setRunData( RunData rundata );
}

The really cool part about the above TurbineInitable is that we can
aggregate together multiple TurbineInitable objects into one
TurbineInitable.  For example, JetspeedInitable could call
CocoonInitable and if it threw an InitializationException then it could
handle it better.

Thoughts?

-- 
Kevin A Burton ([EMAIL PROTECTED])
http://relativity.yi.org
Message to SUN:  "Please Open Source Java!"
"For evil to win is for good men to do nothing."


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to