Hi Michael,

"Kerschbaum Michael " <[EMAIL PROTECTED]> wrote on 10/09/2008 10:25:17 
AM:

> Thank you for the tipps.
> 
> 1.)How can i set the document back to the canvas ?
> 
>      canvas.setDocument(canvas.getDocument()); ?? => what is the 
> canvas in this case ? is this the JSVGComponent itself ?

   Yes, it's the JSVGComponent (except most people subclass the
JSVGCanvas which is why it's called canvas).

> 2.)adding a try cache block to the Runnable Queue ?!
> 
>     Where exactly shoud i do this ? at the point where the 
> IllegalStateException is thrown ?! Or where i call invokeLater ?!

   Where the exception is thrown (around the 'runnableInvoked(rable)'
call in the run method).

> At the meantime i searched for the modification Methods and call 
> them in an own class an ask if the current Thread is a 
> UpdateManager's RunnableQueue Thread ?? if not i print a Stack Trace.
> 
>   if (Thread.currentThread() == ag.getUpdateManager().
> getUpdateRunnableQueue().getThread()) {
>         parentNode.replaceChild(newElement,oldElement);
>       } else {
>         logger.fatal("[replaceChild] node -was not called in the 
> UpdateManagers RunnableQueue.");
>         printCallStack();
>    }

   This should work assuming you track down all of the mutation
points.

    Actually I just thought of a much better place to check it,
add the above check to batik.gvt.UpdateTracker.changeStarted.
I think that should catch all changes that could possibly 
cause trouble (which might include things like animations
and CSS which the DOM checks might not catch), and it's just
once place that you need to change...

> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 09. Oktober 2008 12:16
> An: [email protected]
> Cc: [email protected]
> Betreff: Re: Watching the UpdateManagerThread if dead of alive ?! 
> Restart, Stopping etc.. Watchdog ?

> 
> Hi Michael,
> 
> "Kerschbaum Michael " <[EMAIL PROTECTED]> wrote on 10/09/2008 04:31:15 
AM:
> 
> > The Problem is now that the application itself wont't work anymore. 
> > Is there a possibility to restart or watch the RunnableQueue, and in
> > case of such an error?! 
> 
>    The simplest way to reboot the RunnableQueue would be to 
> set the document back to the canvas: 
> 
>         canvas.setDocument(canvas.getDocument()); 
> 
>    You can know the runnnablequeue is dead by 
> calling 'getThread()' on the UpdateManager's RunnableQueue 
> if it returns null then it has died. 
> 
> > I mean i have to find the modification of the dom tree outside of 
> > the updateManager, but I would like to have a fail back, and a quick
> > solution to this problem ? 
> 
>    A slightly better short term solution would be to 
> protect the RunnableQueue from runnableInvoked throwing 
> an exception (adding a try cache block to the RunnableQueue). 
> 
>    BTW to find the problem you might try instrumenting the 
> DOM so that various methods check the current thread to see 
> if it matches the UpdateManager's RunnableQueue Thread 
> (assuming an UpdateManager is associated with the DOM). 
> 
>    I would add the code to batik.dom.AbstractElement.setAttribute 
> and setAttributeNS, as well as batik.dom.AbstractParentNode.appendChild 
> That should check the most likely problems. 

Reply via email to