Issue Details (XML | Word | Printable)

Key: SHALE-268
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rahul Akolkar
Reporter: Rahul Akolkar
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Shale

[dialog2] Add support for dialog execution listeners

Created: 31/Aug/06 03:00 PM   Updated: 23/Jan/07 04:40 PM
Return to search
Component/s: Dialog
Affects Version/s: 1.0.3
Fix Version/s: 1.0.4


 Description  « Hide
It should be possible to register listeners against dialog execution so the application can take whatever action it needs, either on failure, or routine progress (entry/exit etc.)

Discussion thread:

http://www.nabble.com/-dialog2--%22Advance%22-failures-and-names-tf2192624.html

Summary (fallback in case archives link fails):

On 8/31/06, Rahul Akolkar <rahul.akolkar@gmail.com> wrote:
> On 8/31/06, Craig McClanahan <craigmcc@apache.org> wrote:
> > On 8/30/06, Rahul Akolkar <rahul.akolkar@gmail.com> wrote:
> > >
> > > Sounds good, I can take a stab at the JavaBeans listener if we want to
> > > do this (after the long weekend). Do we just want error notifications
> > > or progress notifications as well?
> >
> >
> > Progress indications make a lot of sense. IIRC, this was one of Sean's
> > motiviations for specializing some of the classes in the original
> > implementation. Some things that might make sense to treat as notification
> > events:
> >
> > * Started dialog x
> >
> > * Ended dialog x
> >
> > * Entered state x
> >
> > * Exited state x (via transition x)
> >
> > * Excepton thrown from state
> >
> > * Suspending operation due to needing user input (i.e. when you
> > return from a view state or an exit state
> >
> <snip/>
>
> Sounds good, I'd further like to add:
>
> * Followed transition x
>
> We already have a progress listener for Commons SCXML, which is quite handy:
>
> http://jakarta.apache.org/commons/scxml/apidocs/org/apache/commons/scxml/SCXMLListener.html
>
> -Rahul
>
>
> > Craig
> >
> >
>

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #453015 Wed Oct 04 20:38:43 UTC 2006 rahul 1) shale-dialog2 module:

Added the concept of DialogListener, which is a JavaBean listener for a single instance of a Shale dialog, and receives callbacks on:
 * Dialog start
 * Dialog stop
 * Exceptions during dialog execution
 * State entry
 * State exit
 * Transition being followed

Accordingly, DialogContext now has the related add/remove listener methods.

Created a o.a.s.d.base package which contains two abstract implementations:
 * AbstractDialogListener - A convenience no-op DialogListener impl
 * AbstractDialogContext - A convenience superclass for DialogContexts which has management of DialogListeners built into it

2) shale-dialg2-legacy module:

 * LegacyDialogContext now inherits from AbstractDialogContext
 * Fixed a logical bug - the dialog was started at DialogContext initialization, rather than when the DialogContext was "started"
 * LegacyDialogContext now fires callbacks on associated DialogListeners

3) shale-dialog2-scxml module:

 * SCXMLDialogContext now inherits from AbstractDialogContext
 * Replaced the SimpleSCXMLListener with a DelegatingSCXMLListener which delegates state machine progress notifications to the registered DialogListeners (rather than a Log, which is what the SimpleSCXMLListener did)
 * SCXMLDialogContext now fires callbacks on associated DialogListeners

Discussion/comments welcome.

SHALE-268
Files Changed
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/base/AbstractDialogContext.java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/base
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/base/AbstractDialogListener.java
MODIFY /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale/dialog2/scxml/SCXMLDialogContext.java
MODIFY /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java
MODIFY /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/LegacyDialogContext.java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogListener.java

Rahul Akolkar made changes - 13/Oct/06 01:24 PM
Field Original Value New Value
Assignee Rahul Akolkar [ rahul@apache.org ]
Rahul Akolkar added a comment - 13/Oct/06 01:25 PM
DialogListener concept is available in the shale-dialog module in framework trunk.

Rahul Akolkar made changes - 13/Oct/06 01:25 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
ASF #468201 Fri Oct 27 00:04:07 UTC 2006 rahul Exceptions should first be logged before DialogListener callbacks, for better archival.
SHALE-268
Files Changed
MODIFY /shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/base/AbstractDialogContext.java

Rahul Akolkar made changes - 23/Jan/07 04:40 PM
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Fix Version/s 1.0.4 [ 21790 ]
Jeff Turner made changes - 09/Aug/07 07:17 AM
Workflow Struts [ 38693 ] Struts - editable closed status [ 42472 ]
Antonio Petrelli made changes - 08/Jan/09 08:57 AM
Workflow Struts - editable closed status [ 42472 ] Struts - editable closed status (temporary) [ 46334 ]
Antonio Petrelli made changes - 08/Jan/09 09:08 AM
Workflow Struts - editable closed status (temporary) [ 46334 ] Struts - editable closed status [ 53013 ]