Home » Archived » Voicetools » Stopping an IVoiceXMLBrowser implementation
Stopping an IVoiceXMLBrowser implementation [message #12465] |
Thu, 16 March 2006 06:25  |
Eclipse User |
|
|
|
Originally posted by: mshaw.tesco.net
Hi,
What is the correct way to code the IVoiceXMLBrowser.stop() method? I
have stored a reference to the VoiceXMLBrowserProcess supplied by
setProcess but I am seeing a stack overflow when I try to terminate the
process.
The following implementation:
int count = 0;
public void stop() {
if (count++ >= 10) {
return;
}
System.out.println("MyBrowser stop. Can terminate? "
+ process.canTerminate() + ", isTerminated? "
+ process.isTerminated());
try {
process.terminate();
process.setTerminated(true);
} catch (DebugException e) {
System.out.println("DebugException: " + e.getMessage());
}
System.out.println("After terminate. Can terminate? "
+ process.canTerminate() + ", isTerminated? "
+ process.isTerminated());
}
produces this output:
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
MyBrowser stop. Can terminate? true, isTerminated? false
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
After terminate. Can terminate? false, isTerminated? true
I tried swapping the the process.terminate(); and
process.setTerminated(true); statements but this resulted in the browser
failing to terminate, that is to say the Terminate button remained red
and the DTMF buttons were still active, but I didn't get a stack overflow.
Any advice greatly appreciated.
Regards,
Marcus.
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #12493 is a reply to message #12465] |
Thu, 16 March 2006 13:45   |
Eclipse User |
|
|
|
The best example is the Tellme implementation in here:
http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
In particular CallState.endLaunch() does this:
(activeBrowser is a VoiceXMLBrowserProcess object)
activeBrowser.setTerminated(true);
DebugEvent[] event = new DebugEvent[2];
event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
DebugPlugin.getDefault().fireDebugEventSet(event);
What you're doing is communicating to both the process object and to the
eclipse infrastructure that you've now terminated. The first step is to
change the isTerminated() bit in the process object using setTerminated()
and the events tell the UI and any listeners that the session is now over.
The UI responds to those events by checking isTerminated() in the process
object to refresh its tree of items in the Debug perspective's debug view.
The VoiceXMLBrowserProcess.terminate() method in the process object actually
attempts to shutdown the process itself by calling the stop() method, so
calling it will get you in a loop there. It's there to be called by the UI
if the user pressed the terminate button in the Debug perspective's debug
view while they have selected the process object.
Hope that helps.
"Marcus Shaw" <mshaw@tesco.net> wrote in message
news:dvbi5o$d7k$1@utils.eclipse.org...
> Hi,
>
> What is the correct way to code the IVoiceXMLBrowser.stop() method? I
> have stored a reference to the VoiceXMLBrowserProcess supplied by
> setProcess but I am seeing a stack overflow when I try to terminate the
> process.
>
> The following implementation:
>
> int count = 0;
>
> public void stop() {
> if (count++ >= 10) {
> return;
> }
>
> System.out.println("MyBrowser stop. Can terminate? "
> + process.canTerminate() + ", isTerminated? "
> + process.isTerminated());
> try {
> process.terminate();
> process.setTerminated(true);
> } catch (DebugException e) {
> System.out.println("DebugException: " + e.getMessage());
> }
> System.out.println("After terminate. Can terminate? "
> + process.canTerminate() + ", isTerminated? "
> + process.isTerminated());
> }
>
> produces this output:
>
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
>
>
> I tried swapping the the process.terminate(); and
> process.setTerminated(true); statements but this resulted in the browser
> failing to terminate, that is to say the Terminate button remained red and
> the DTMF buttons were still active, but I didn't get a stack overflow.
>
> Any advice greatly appreciated.
>
> Regards,
>
> Marcus.
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #12575 is a reply to message #12493] |
Wed, 22 March 2006 06:54   |
Eclipse User |
|
|
|
Originally posted by: mshaw.tesco.net
Hi Brent,
Thanks once again. It works perfectly.
Regards,
Marcus.
Brent D. Metz wrote:
> The best example is the Tellme implementation in here:
>
> http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
>
> In particular CallState.endLaunch() does this:
>
> (activeBrowser is a VoiceXMLBrowserProcess object)
>
> activeBrowser.setTerminated(true);
> DebugEvent[] event = new DebugEvent[2];
> event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
> event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
> DebugPlugin.getDefault().fireDebugEventSet(event);
>
> What you're doing is communicating to both the process object and to the
> eclipse infrastructure that you've now terminated. The first step is to
> change the isTerminated() bit in the process object using setTerminated()
> and the events tell the UI and any listeners that the session is now over.
> The UI responds to those events by checking isTerminated() in the process
> object to refresh its tree of items in the Debug perspective's debug view.
>
> The VoiceXMLBrowserProcess.terminate() method in the process object actually
> attempts to shutdown the process itself by calling the stop() method, so
> calling it will get you in a loop there. It's there to be called by the UI
> if the user pressed the terminate button in the Debug perspective's debug
> view while they have selected the process object.
>
> Hope that helps.
>
> "Marcus Shaw" <mshaw@tesco.net> wrote in message
> news:dvbi5o$d7k$1@utils.eclipse.org...
>
>>Hi,
>>
>>What is the correct way to code the IVoiceXMLBrowser.stop() method? I
>>have stored a reference to the VoiceXMLBrowserProcess supplied by
>>setProcess but I am seeing a stack overflow when I try to terminate the
>>process.
>>
>>The following implementation:
>>
>>int count = 0;
>>
>>public void stop() {
>>if (count++ >= 10) {
>>return;
>>}
>>
>>System.out.println("MyBrowser stop. Can terminate? "
>>+ process.canTerminate() + ", isTerminated? "
>>+ process.isTerminated());
>>try {
>>process.terminate();
>>process.setTerminated(true);
>>} catch (DebugException e) {
>>System.out.println("DebugException: " + e.getMessage());
>>}
>>System.out.println("After terminate. Can terminate? "
>>+ process.canTerminate() + ", isTerminated? "
>>+ process.isTerminated());
>>}
>>
>>produces this output:
>>
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>
>>
>>I tried swapping the the process.terminate(); and
>>process.setTerminated(true); statements but this resulted in the browser
>>failing to terminate, that is to say the Terminate button remained red and
>>the DTMF buttons were still active, but I didn't get a stack overflow.
>>
>>Any advice greatly appreciated.
>>
>>Regards,
>>
>>Marcus.
>
>
>
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #12595 is a reply to message #12575] |
Wed, 22 March 2006 16:15  |
Eclipse User |
|
|
|
Originally posted by: gbrent.gmail.com
Great to hear! If you have a chance we'd love feedback on what was hard/easy
to get working..besides the stopping issue I suppose :).
"Marcus Shaw" <mshaw@tesco.net> wrote in message
news:dvrdtn$af7$1@utils.eclipse.org...
> Hi Brent,
>
> Thanks once again. It works perfectly.
>
> Regards,
>
> Marcus.
>
> Brent D. Metz wrote:
>> The best example is the Tellme implementation in here:
>>
>> http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
>>
>> In particular CallState.endLaunch() does this:
>>
>> (activeBrowser is a VoiceXMLBrowserProcess object)
>>
>> activeBrowser.setTerminated(true);
>> DebugEvent[] event = new DebugEvent[2];
>> event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
>> event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
>> DebugPlugin.getDefault().fireDebugEventSet(event);
>>
>> What you're doing is communicating to both the process object and to the
>> eclipse infrastructure that you've now terminated. The first step is to
>> change the isTerminated() bit in the process object using setTerminated()
>> and the events tell the UI and any listeners that the session is now
>> over. The UI responds to those events by checking isTerminated() in the
>> process object to refresh its tree of items in the Debug perspective's
>> debug view.
>>
>> The VoiceXMLBrowserProcess.terminate() method in the process object
>> actually attempts to shutdown the process itself by calling the stop()
>> method, so calling it will get you in a loop there. It's there to be
>> called by the UI if the user pressed the terminate button in the Debug
>> perspective's debug view while they have selected the process object.
>>
>> Hope that helps.
>>
>> "Marcus Shaw" <mshaw@tesco.net> wrote in message
>> news:dvbi5o$d7k$1@utils.eclipse.org...
>>
>>>Hi,
>>>
>>>What is the correct way to code the IVoiceXMLBrowser.stop() method? I
>>>have stored a reference to the VoiceXMLBrowserProcess supplied by
>>>setProcess but I am seeing a stack overflow when I try to terminate the
>>>process.
>>>
>>>The following implementation:
>>>
>>>int count = 0;
>>>
>>>public void stop() {
>>>if (count++ >= 10) {
>>>return;
>>>}
>>>
>>>System.out.println("MyBrowser stop. Can terminate? "
>>>+ process.canTerminate() + ", isTerminated? "
>>>+ process.isTerminated());
>>>try {
>>>process.terminate();
>>>process.setTerminated(true);
>>>} catch (DebugException e) {
>>>System.out.println("DebugException: " + e.getMessage());
>>>}
>>>System.out.println("After terminate. Can terminate? "
>>>+ process.canTerminate() + ", isTerminated? "
>>>+ process.isTerminated());
>>>}
>>>
>>>produces this output:
>>>
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>
>>>
>>>I tried swapping the the process.terminate(); and
>>>process.setTerminated(true); statements but this resulted in the browser
>>>failing to terminate, that is to say the Terminate button remained red
>>>and the DTMF buttons were still active, but I didn't get a stack
>>>overflow.
>>>
>>>Any advice greatly appreciated.
>>>
>>>Regards,
>>>
>>>Marcus.
>>
>>
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #573849 is a reply to message #12465] |
Thu, 16 March 2006 13:45  |
Eclipse User |
|
|
|
The best example is the Tellme implementation in here:
http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
In particular CallState.endLaunch() does this:
(activeBrowser is a VoiceXMLBrowserProcess object)
activeBrowser.setTerminated(true);
DebugEvent[] event = new DebugEvent[2];
event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
DebugPlugin.getDefault().fireDebugEventSet(event);
What you're doing is communicating to both the process object and to the
eclipse infrastructure that you've now terminated. The first step is to
change the isTerminated() bit in the process object using setTerminated()
and the events tell the UI and any listeners that the session is now over.
The UI responds to those events by checking isTerminated() in the process
object to refresh its tree of items in the Debug perspective's debug view.
The VoiceXMLBrowserProcess.terminate() method in the process object actually
attempts to shutdown the process itself by calling the stop() method, so
calling it will get you in a loop there. It's there to be called by the UI
if the user pressed the terminate button in the Debug perspective's debug
view while they have selected the process object.
Hope that helps.
"Marcus Shaw" <mshaw@tesco.net> wrote in message
news:dvbi5o$d7k$1@utils.eclipse.org...
> Hi,
>
> What is the correct way to code the IVoiceXMLBrowser.stop() method? I
> have stored a reference to the VoiceXMLBrowserProcess supplied by
> setProcess but I am seeing a stack overflow when I try to terminate the
> process.
>
> The following implementation:
>
> int count = 0;
>
> public void stop() {
> if (count++ >= 10) {
> return;
> }
>
> System.out.println("MyBrowser stop. Can terminate? "
> + process.canTerminate() + ", isTerminated? "
> + process.isTerminated());
> try {
> process.terminate();
> process.setTerminated(true);
> } catch (DebugException e) {
> System.out.println("DebugException: " + e.getMessage());
> }
> System.out.println("After terminate. Can terminate? "
> + process.canTerminate() + ", isTerminated? "
> + process.isTerminated());
> }
>
> produces this output:
>
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> MyBrowser stop. Can terminate? true, isTerminated? false
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
> After terminate. Can terminate? false, isTerminated? true
>
>
> I tried swapping the the process.terminate(); and
> process.setTerminated(true); statements but this resulted in the browser
> failing to terminate, that is to say the Terminate button remained red and
> the DTMF buttons were still active, but I didn't get a stack overflow.
>
> Any advice greatly appreciated.
>
> Regards,
>
> Marcus.
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #573975 is a reply to message #12493] |
Wed, 22 March 2006 06:54  |
Eclipse User |
|
|
|
Originally posted by: mshaw.tesco.net
Hi Brent,
Thanks once again. It works perfectly.
Regards,
Marcus.
Brent D. Metz wrote:
> The best example is the Tellme implementation in here:
>
> http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
>
> In particular CallState.endLaunch() does this:
>
> (activeBrowser is a VoiceXMLBrowserProcess object)
>
> activeBrowser.setTerminated(true);
> DebugEvent[] event = new DebugEvent[2];
> event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
> event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
> DebugPlugin.getDefault().fireDebugEventSet(event);
>
> What you're doing is communicating to both the process object and to the
> eclipse infrastructure that you've now terminated. The first step is to
> change the isTerminated() bit in the process object using setTerminated()
> and the events tell the UI and any listeners that the session is now over.
> The UI responds to those events by checking isTerminated() in the process
> object to refresh its tree of items in the Debug perspective's debug view.
>
> The VoiceXMLBrowserProcess.terminate() method in the process object actually
> attempts to shutdown the process itself by calling the stop() method, so
> calling it will get you in a loop there. It's there to be called by the UI
> if the user pressed the terminate button in the Debug perspective's debug
> view while they have selected the process object.
>
> Hope that helps.
>
> "Marcus Shaw" <mshaw@tesco.net> wrote in message
> news:dvbi5o$d7k$1@utils.eclipse.org...
>
>>Hi,
>>
>>What is the correct way to code the IVoiceXMLBrowser.stop() method? I
>>have stored a reference to the VoiceXMLBrowserProcess supplied by
>>setProcess but I am seeing a stack overflow when I try to terminate the
>>process.
>>
>>The following implementation:
>>
>>int count = 0;
>>
>>public void stop() {
>>if (count++ >= 10) {
>>return;
>>}
>>
>>System.out.println("MyBrowser stop. Can terminate? "
>>+ process.canTerminate() + ", isTerminated? "
>>+ process.isTerminated());
>>try {
>>process.terminate();
>>process.setTerminated(true);
>>} catch (DebugException e) {
>>System.out.println("DebugException: " + e.getMessage());
>>}
>>System.out.println("After terminate. Can terminate? "
>>+ process.canTerminate() + ", isTerminated? "
>>+ process.isTerminated());
>>}
>>
>>produces this output:
>>
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>MyBrowser stop. Can terminate? true, isTerminated? false
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>After terminate. Can terminate? false, isTerminated? true
>>
>>
>>I tried swapping the the process.terminate(); and
>>process.setTerminated(true); statements but this resulted in the browser
>>failing to terminate, that is to say the Terminate button remained red and
>>the DTMF buttons were still active, but I didn't get a stack overflow.
>>
>>Any advice greatly appreciated.
>>
>>Regards,
>>
>>Marcus.
>
>
>
|
|
|
Re: Stopping an IVoiceXMLBrowser implementation [message #574004 is a reply to message #12575] |
Wed, 22 March 2006 16:15  |
Eclipse User |
|
|
|
Originally posted by: gbrent.gmail.com
Great to hear! If you have a chance we'd love feedback on what was hard/easy
to get working..besides the stopping issue I suppose :).
"Marcus Shaw" <mshaw@tesco.net> wrote in message
news:dvrdtn$af7$1@utils.eclipse.org...
> Hi Brent,
>
> Thanks once again. It works perfectly.
>
> Regards,
>
> Marcus.
>
> Brent D. Metz wrote:
>> The best example is the Tellme implementation in here:
>>
>> http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.vtp /simdebug/plugins/org.eclipse.vtp.launching.tellme/src/org/e clipse/vtp/launching/internal/tellme/
>>
>> In particular CallState.endLaunch() does this:
>>
>> (activeBrowser is a VoiceXMLBrowserProcess object)
>>
>> activeBrowser.setTerminated(true);
>> DebugEvent[] event = new DebugEvent[2];
>> event[0] = new DebugEvent(activeBrowser, DebugEvent.TERMINATE);
>> event[1] = new DebugEvent(activeBrowser.getLaunch(), DebugEvent.CHANGE);
>> DebugPlugin.getDefault().fireDebugEventSet(event);
>>
>> What you're doing is communicating to both the process object and to the
>> eclipse infrastructure that you've now terminated. The first step is to
>> change the isTerminated() bit in the process object using setTerminated()
>> and the events tell the UI and any listeners that the session is now
>> over. The UI responds to those events by checking isTerminated() in the
>> process object to refresh its tree of items in the Debug perspective's
>> debug view.
>>
>> The VoiceXMLBrowserProcess.terminate() method in the process object
>> actually attempts to shutdown the process itself by calling the stop()
>> method, so calling it will get you in a loop there. It's there to be
>> called by the UI if the user pressed the terminate button in the Debug
>> perspective's debug view while they have selected the process object.
>>
>> Hope that helps.
>>
>> "Marcus Shaw" <mshaw@tesco.net> wrote in message
>> news:dvbi5o$d7k$1@utils.eclipse.org...
>>
>>>Hi,
>>>
>>>What is the correct way to code the IVoiceXMLBrowser.stop() method? I
>>>have stored a reference to the VoiceXMLBrowserProcess supplied by
>>>setProcess but I am seeing a stack overflow when I try to terminate the
>>>process.
>>>
>>>The following implementation:
>>>
>>>int count = 0;
>>>
>>>public void stop() {
>>>if (count++ >= 10) {
>>>return;
>>>}
>>>
>>>System.out.println("MyBrowser stop. Can terminate? "
>>>+ process.canTerminate() + ", isTerminated? "
>>>+ process.isTerminated());
>>>try {
>>>process.terminate();
>>>process.setTerminated(true);
>>>} catch (DebugException e) {
>>>System.out.println("DebugException: " + e.getMessage());
>>>}
>>>System.out.println("After terminate. Can terminate? "
>>>+ process.canTerminate() + ", isTerminated? "
>>>+ process.isTerminated());
>>>}
>>>
>>>produces this output:
>>>
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>MyBrowser stop. Can terminate? true, isTerminated? false
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>After terminate. Can terminate? false, isTerminated? true
>>>
>>>
>>>I tried swapping the the process.terminate(); and
>>>process.setTerminated(true); statements but this resulted in the browser
>>>failing to terminate, that is to say the Terminate button remained red
>>>and the DTMF buttons were still active, but I didn't get a stack
>>>overflow.
>>>
>>>Any advice greatly appreciated.
>>>
>>>Regards,
>>>
>>>Marcus.
>>
>>
|
|
|
Goto Forum:
Current Time: Fri May 09 11:41:18 EDT 2025
Powered by FUDForum. Page generated in 0.04966 seconds
|