WebLogic Messaging API Class Library

IContext.Close Method 

Closes this context but does not close child resources such as connection, sessions, consumers, and producers that are related to this context. This method does not release the context's network connection immediately, instead the network connection will be released after the application closes all of its child resources first.

Since JMS allocates context resources on behalf of an IContext outside the .NET CLR, clients should call Close on them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

This method is idempotent: invoking it on a context that has already been closed has no effect. Invoking any other method on a closed context is not allowed, and results in undefined behaviour.

void Close();


Exception TypeCondition
MessageExceptionif an internal exception is encountered

See Also

IContext Interface | WebLogic.Messaging Namespace | CloseAll