WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
cniCreateNodeContext
This function creates a context for an instance of a node object. It is called by the broker whenever an instance of a node object is constructed. Nodes are constructed when a message flow is deployed by the broker, or when the execution group is started.
The responsibilities of the node, when created, are to:
- (Optional) Verify that the name of the node specified in the nodeName parameter is supported by the factory.
- Allocate any node instance specific data areas that might be required (for example: context, attribute data, and terminals).
- Perform all additional resource acquisition or initialization that might be required for the processing of the node.
- Return the address of the context to the calling function. Whenever an implementation function for this node instance is called, the appropriate context is passed as an argument to that function. Therefore, a user-defined node developed in C does not have to maintain its own static pointers to per-instance data areas.
Defined In | Type | Member |
---|---|---|
CNI_VFT | Mandatory | iFpCreateNodeContext |
Syntax
CciContext* cniCreateNodeContext(
CciFactory* factoryObject,
CciChar* nodeName,
CciNode* nodeObject);
Parameters
- factoryObject
- The address of the factory object that owns the node being created (input).
- nodeName
- The name of the node being created (input).
- nodeObject
- The address of the node object that has just been created (input).
Return values
If successful, the address of the node context is returned. Otherwise, a value of zero (CCI_NULL_ADDR) is returned.
Example
static char* functionName = (char *)"_Switch_createNodeContext()";
NODE_CONTEXT_ST* p;
/* Allocate a pointer to the local context */
p = (NODE_CONTEXT_ST *)malloc(sizeof(NODE_CONTEXT_ST));
if (p) {
/* Clear the context area */
memset(p, 0, sizeof(NODE_CONTEXT_ST));
/* Save our node object pointer in our context */
p->nodeObject = nodeObject;
/* Save our node name */
CciCharNCpy((CciChar*) &p->nodeName, nodeName, MAX_NODE_NAME_LEN);
}
else
/* Handle errors */