Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 Tracing, Tracking, and Exception Handling : Tracking

Tracking
The TIBCO Adapter SDK tracking facility allows custom adapters to associate tracking information with data (not with trace messages). The tracking information remains associated with the data as they are passed between ActiveEnterprise applications. This makes it possible to see a history of the operations performed on the message.
Use of tracking should not be confused with tracing. While tracing provides full detail of custom adapter activities, tracking provides an audit trail for messages as they travel through the ActiveEnterprise.
MTrackingInfo
Tracking is implemented by an MTrackingInfo object.
1.
The source application places information into the MTrackingInfo objects using the MTrackingInfo::addApplicationInfo() method.
This SDK adds the information to the MTree, MData, or MOperation.
2.
3.
MTrackingInfo cannot be used if you are using rvMsg format.
Because the MTrackingInfo is sent on the wire, applications should limit the information added through addApplicationInfo(). Each application should call addApplicationInfo() only once per message. The message should contain concise and minimal information.
Tracking Example
The following pseudo-code fragment illustrates how a subscriber event listener could extract tracking information if serialization failed.
// *** A Subscriber tracking info sample ***
void
MyMEventListener::onEvent( MEvent const & event )
{
MTree const * pTree = NULL;
MDataEvent const * pDataEvent = MDataEvent::downCast( &event );
if ( pDataEvent ) {
pTree = pDataEvent->getData();
try {
MInstance foo( m_pClassRegistry, *pTree );
//...
}
catch ( MException e ) {
MTrackingInfo info = pTree->getTrackingInfo();
m_pMTrace->trace( e, &info, NULL );
}
//...
}
}

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved