Hi,
I haven't been successful in doing this and there is a few different models
that I am unsure which way to go.
Lets assume there are N different types of status/error messages in the
kernel/applications. Each different message may have 0, 1 or more
parameters. Some of these messages belong to a "family" where each member
of family takes same parameters. (ie they may all take name of block or
numeric).
There is a few different ways of doing this
(1) Each message has a different method. ie
listener.componentAdded( "myBlock" );
listener.errorLoadingComponent( "myBlock", myException );
listener.componentUnloaded( "myBlock" );
(2) Generic code + generic parameter list method
listener.status( Status.COMPONENT_ADDED, new Object[] { "myBlock" } );
listener.error( Status.ERROR_LOADING,
new Object[] { "myBlock", myException } );
listener.status( Status.COMPONENT_UNLOADED, new Object[] { "myBlock" } );
(3) Semi-stateful listeners
listener.componentAdded( "myBlock" );
// Note we know that the next message pertains to "myBlock" because
// it was last named in call to componentAdded()
listener.errorLoadingComponent( myException );
listener.componentUnloaded( "myBlock" );
(4) Force errors in same "family" into same method
listener.lifecycleStatus( Status.COMPONENT_ADDED, "myBlock" );
listener.lifecycleError( Status.ERROR_LOADING, "myBlock", myException );
listener.lifecycleStatus( Status.COMPONENT_UNLOADED, "myBlock" );
Or something else ?
Which method is the most correct? Probably (1) - however it can get
excessive as there will likely be close to 30 messages. Anyone else have
ideas/opinions etc?
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]