Over what interface can the user request the abort? Somehow he needs to 
communicate with the running process. If you can implement some semaphore or 
global class/method/field accesible from Velocity, you could adapt the stop 
directive to create your own directive and use it within loops in your 
template(s).

If your huge template is of a linear structure, you would need to place the 
abort check within the engine - again look at the stop directive on how it can 
be done. An engine abort hook might be a better choice, since it does not 
require cluttering the templates with the custom directive.

If you find a proper place to place the abort hook in the engine, maybe you can 
contribute a patch to make it into future Velocity realeases.

My 2c,
Christoph

[email protected] on 2011-01-11 09:25 wrote:
I guess you have to write your own ParserPool and Parser class. Your parser can 
override the parse method and abort the parsing or rendering.

________________________________

Von: [email protected] [mailto:[email protected]]
Gesendet: Dienstag, 11. Januar 2011 08:33
An: [email protected]
Betreff: Re: Aborting a running evaluation


That' not what i need, i need to stop the VelocityEngine in java, from another 
thread. Is that possible?

Kind Regards

Christoff Schmitz

F I N A R I S
Financial Software Partner GmbH
Sömmerringstrasse 23
60322 Frankfurt am Main

Fon:      +49 (0)69  / 254 98 - 24
Mobile: +49 (0)176 / 206 34 186
Fax:       +49 (0)69  / 254 98 - 50
eMail:    
mailto:[email protected]<mailto:[email protected]>
www:      http://www.finaris.de<http://www.finaris.de/>   und 
http://www.rapidrep.com<http://www.rapidrep.com/>
----- Forwarded by Christoff Schmitz/Finaris on 11.01.2011 08:31 -----

        
Re: Aborting a running evaluation

Nathan Bubna    to:     Velocity Users List     
10.01.2011 18:28


                
From:   Nathan Bubna<[email protected]>    
                
To:     Velocity Users List<[email protected]>     
                
        Please respond to "Velocity Users List"<[email protected]>       


________________________________



Use the #stop directive, particularly in Velocity 1.7.

On Mon, Jan 10, 2011 at 7:04 AM,<[email protected]>  wrote:
Hi everybody,

I'm using velocity within my java project which evaluates quite huge
templates.
The problem is I would like to abort that evaluation if the user wants to.

Is there a proper way to do this using Velocity in Java?

Kind regards

Christoff Schmitz

F I N A R I S
Financial Software Partner GmbH
Sömmerringstrasse 23
60322 Frankfurt am Main

Fon:      +49 (0)69  / 254 98 - 24
Fax:       +49 (0)69  / 254 98 - 50
eMail:    
mailto:[email protected]<mailto:[email protected]>
www:      http://www.finaris.de<http://www.finaris.de/>   und 
http://www.rapidrep.com<http://www.rapidrep.com/>

=======================================================
Disclaimer
The information contained in this e - mail and any attachments
( together the "message") is intended for the addressee only and may
contain confidential and/or privileged information. If you have received
the message by mistake please delete it and notify the sender and do
not copy or distribute it or disclose its contents to anyone.

FINARIS Financial Software Partner GmbH
Sömmerringstr. 23, 60322 Frankfurt/Main, Germany
Registered at Frankfurt/Main, HRB 52873

Managing Directors:
Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl
=======================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



=======================================================
Disclaimer
The information contained in this e - mail and any attachments
( together the "message") is intended for the addressee only and may
contain confidential and/or privileged information. If you have received
the message by mistake please delete it and notify the sender and do
not copy or distribute it or disclose its contents to anyone.

FINARIS Financial Software Partner GmbH
Sömmerringstr. 23, 60322 Frankfurt/Main, Germany
Registered at Frankfurt/Main, HRB 52873

Managing Directors:
Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl
=======================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to