Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Voicetools » Stopping an IVoiceXMLBrowser implementation
Stopping an IVoiceXMLBrowser implementation [message #12465] Thu, 16 March 2006 11:25 Go to next message
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 18:45 Go to previous messageGo to next message
Brent D. Metz is currently offline Brent D. Metz
Messages: 10
Registered: July 2009
Junior Member
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 11:54 Go to previous messageGo to next message
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 21:15 Go to previous message
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 18:45 Go to previous message
Brent D. Metz is currently offline Brent D. Metz
Messages: 10
Registered: July 2009
Junior Member
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 11:54 Go to previous message
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 21:15 Go to previous message
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.
>>
>>
Previous Topic:CCXML editor invalidates valid CCXML codes
Next Topic:Observations on extending the VTP
Goto Forum:
  


Current Time: Sun Oct 26 08:50:50 GMT 2014

Powered by FUDForum. Page generated in 0.01898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software