WebSphere Message Brokers
File: as01440_
Writer: Lorraine Waitt

Concept topic

This build: July 31, 2007 21:36:58

Storage management

This topic deals with issues relating to storage management that you need to consider when developing user-defined extensions for WebSphere Message Broker in the C programming language. If you are developing user-defined extensions using the Java programming language, you can use standard Java storage management methods.

All memory allocated by a user-defined extension must be released by the user-defined extension. The construction of a node at run-time causes cniCreateNodeContext to be invoked, which allows the user-defined extension to allocate node instance specific data areas to store a context. The address of the context is returned to the message broker, and is passed back from the broker when an internal method causes a user-defined extension function to be invoked; thus, the C user-defined extension can locate and use the correct context for the function processing.

The message broker will pass addresses of C++ objects to the user-defined extension. These are simply intended to be used as a handle to be passed back on subsequent function calls. You should not allow your C user-defined extension to try to manipulate or use this pointer in any way, by trying to release storage using the free function, for example. Such actions will cause unpredictable behavior in the message broker.

The cniCreateNodeContext implementation function is invoked whenever the underlying node object has been constructed internally. This occurs when a broker is defined with a message flow that uses a user-defined node. It is important to note that this is not necessarily the same activity as creating (or reusing) a thread to execute a message flow instance containing the node. In fact, the cniCreateNodeContext function will be called only once, during the configuration of the message flow, regardless of how many threads are executing the message flow.

Similar considerations apply to user-defined parsers, and the corresponding implementation function cpiCreateContext.

Related concepts
User-defined extensions overview
User-defined parsers
Related reference
cpiCreateContext
cniCreateNodeContext
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:36:58

as01440_ This topic's URL is: