Tibrv.close()
Method
Declaration
static void close
() throws TibrvException
Purpose
Stop and destroy Rendezvous internal machinery.
Remarks
After Tibrv.close() destroys the internal machinery, Rendezvous software becomes inoperative:
• | Events no longer arrive in queues. |
• | All events, queues and queue groups are unusable, so programs can no longer dispatch events. |
• | All transports are unusable, so programs can no longer send outbound messages. |
After closing a Tibrv object, all events, transports, queues and queue groups associated with that environment are invalid; it is illegal to call any methods of these objects.
After closing a Tibrv environment, you can reopen it either with the same implementation, or with a different implementation.
Reference Count
A reference count protects against interactions between programs and third-party packages that call Tibrv.open() and Tibrv.close(). Each call to Tibrv.open() increments an internal counter; each call to Tibrv.close() decrements that counter. A call to Tibrv.open() actually creates internal machinery only when the reference counter is zero; subsequent calls merely increment the counter, but do not duplicate the machinery. A call to Tibrv.close() actually destroys the internal machinery only when the call decrements the counter to zero; other calls merely decrement the counter. In each program, the number of calls to Tibrv.open() and Tibrv.close() must match.
To ascertain the actual state of the internal machinery, use Tibrv.isValid().