I'm working on updating the docs (yay for me =).
Please stay away from em...
Several things popped up while updating the lifecycle
docs...
1 - Executable and Interruptable are in the proposal, but
haven't appeared in the main tree yet. Is this something
you haven't got around to yet, Pete, or is it not gonna
happen anymore?
2 - init() has not been changed to initialize() yet...will
this change?
3 - the Re<XXX> interfaces should all be updated to
extend Interruptable:
Reconfigurable extends Configurable, Interruptable
Recontextualizable extends Contextualizable, Interruptable
Recomposable extends Composable, Interruptable
4 - if we keep Parameters (and I believe no-one has a problem
with that), the next logical step would be to also define
interface Reparameterizable extends Parameterizable, Interruptable {
public void reparameterize( Parameters parameters ) throws
ParameterException;
}
5 - it is currently stated that start(), run() and stop() may be
called multiple times. I have a problem with that - some Components
may not support this behaviour (I don't think they should), while
some containers may require it. The replacement would be the use
of Commands.
A compromise might be to deprecate the repeated use of these methods
and provide commands as the alternative - gives Pete until v5 to
update to the new setup =)
6 - The proposal was to add a Commandable and a Command instead (they're
in the proposal dir), and make sure the mentioned methods are
called only once.
If we do that, I think getCommands() would go after start()/run()
and before anything else, that all returned Commands are guaranteed
to start() (as new threads) before any other method is called,
and that a Component is responsible for suspend()ing and resume()ing
Commands if that is neccessary.
Also, Command threads will run until finished, even if a Component
has already been dispose()d of. A container may choose to stop them
if they do not finish in a timely manner (the Component is once
again responsible for making sure that happens in stop() and/or
dispose()). Command threads will always be stopped and dereferenced
before a Component is dereferenced though (so finalize() on the
Component can take care of any last loose ends).
So:
...
comp.start()
comp.run()
cmds = comp.getCommands()
runAll(cmds)
comp.suspend()
comp.resume()
comp.suspend()
comp.resume()
cmds.stop()
cmds.dispose()
...
while(! exit ) {
stopAll(cmds)
cmds = null;
comp = null;
System.gc(); // finalize() called on comp
}
can I have votes/comments on 1-6 where neccessary?
regards,
LSD
PS: what I'm doing with the docs? Two things. The first
one is changing all the language and some of the
organisation so things are easier to follow (you guys
have a 'nack for using complicated terms =), the second
is updating the docs to reflect recent changes.
<java:sig>
About LSD = new PersonalInfo();
LSD.name("Leo Simons");
LSD.email("[EMAIL PROTECTED]");
LSD.URL( [
http://www.leosimons.com, // personal website
http://www.atfantasy.com, // fantasy RPG portal
http://www.the-sign.nl // web-design company
] );
LSD.quote("Buh!");
email.setSig((String)LSD);
</java:sig>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]