Open topic with navigation

TIBCO GridServer® 7.1.0

# Cancel Method

If a Service is canceled by the user or a Service request (task) is canceled, the managing container receives a message and calls a specified operation on the Service automatically. For a given Service, a method can be assigned to be called by the container under this cancellation event. Here’s a simple example:

    public class DBCalculator {
        …
        public void stop() {
            _isStopped = true;
        }
        public Bar calculate(String arg1, …) {
            while (_isStopped != null) {
               // iterate over looping variable
            }
        }
        private volatile boolean _isStopped = false;
    }

In this example, the `stop` method must be registered as the “cancelMethod”. If it is not possible to stop the operation in this way, GridServer allows canceled Service operations to cause the entire Engine process to be killed and restarted automatically. The Service option is called `KILL_ENGINE_ON_CANCEL` and takes the value true or false.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.