How would I pause a Groovy script within the script until a Java program tells the script to run again? The script will be embedded inside of a Java program.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several possibilities depending on how you actually call the script.
If you call it using a seperate process, you could wait for input from STDIN in your script and write to STDOUT in java.
If both just run in different threads of one JVM (this includes the execution via ScriptingManager), than you can use
obj.wait()int the script andobj.notify[All]()in the java program.