WebSphere Message Brokers
File: as07430_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:37:10

cniCreateNodeContext

Creates any context for an instance of a node object. It is invoked by the message 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 at this point are to:
  1. (Optionally) verify that the name of the node specified in the nodeName parameter is supported by the factory.
  2. Allocate any node instance specific data areas that might be required (for example: context, attribute data, and terminals).
  3. Perform any additional resource acquisition or initialization that might be required for the processing of the node.
  4. Return the address of the context to the calling function. Whenever an implementation function for this node instance is invoked, the appropriate context is passed as an argument to that function. This means that a user-defined node developed in C need not 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 */
Notices | Trademarks | Downloads | Library | Support | Feedback

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

as07430_ This topic's URL is: