Open topic with navigation

# Clean-Up

Design programs to behave appropriately when they exit, and when they create a new realm object and its associated objects. (For example, creating new realm objects could be a recovery path after the FTL server disables the client process.)

Proper clean-up serves two goals:

- The FTL server and administrators can distinguish application processes that exit cleanly from processes that exit abnormally. When a process cleans up, you can infer that it exited deliberately, rather than unexpectedly.
- Clean-up manages the resources within a process that closes and reopens the realm but does not exit.

## Program Exit

When a program exits, it is important to close the realm object. This step closes the FTL server’s connection to the program process. The FTL server stops monitoring the process.

When a program exits, it is not necessary to close or destroy other objects associated with the realm object.

Nonetheless, in C programs, you must close the top-level `FTL` object as well as the realm object.

## Close and Reopen the Realm

In contrast, the clean-up requirements are different when a program does not completely exit, but instead creates a new realm object. In this situation, programs must do these steps, in order:

Close or destroy objects associated with the defunct realm object: including messages, property objects, field reference objects, content matchers, subscribers, publishers, inboxes, and event queues.

Close the defunct realm object.

Open a new realm object (that is, connect to the FTL server).

Create objects associated with the new realm.

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 FTL® - Enterprise Edition

Copyright © 2009-2024. Cloud Software Group, Inc. All Rights Reserved.