Community
Participate
Working Groups
Native Common Base Event implementation does not provide a factory for creating events. When users instrument native Common Base Events for logging/tracing, the number of lines to create each record is typically around 20 - 30. This will be unacceptable to achieve widespread adoption of the native Common Base Events in applications for logging/tracing. One approach to reduce the number of lines to create a native Common Base Event is to provide an implementation of a factory pattern for users to create Common Base Events for logging/tracing. For example, the factory could be populated with a template event that is common for all events within a certain context (e.g. application, component, etc.) and when components create Common Base Events for logging/tracing, they are returned a pre-populated event which they set the dynamic data (e.g. severity, message, etc.). For a reference implementation of a Common Base Event factory pattern, see the Java Common Base Event implementation (e.g. org.eclipse.hyades.logging.core).
Assignment: Mike Hao
Created attachment 18664 [details] Partial implementation of EventFactory
Created attachment 18665 [details] Partial implementation of TemplateContentHandler
Now that we have a "3.3" Version in bugzilla, updating bugzillas targeted to 3.3 or a 3.3 iteration so that their Version matches their Target. "future", "unspecified", "4.0", and "4.1" Versions will not be updated.
Sizing: 2 PW
Created attachment 19173 [details] Fix Here is the summary to the fix of this defect: 1. File CommonBaseEvent.h -- added EventFactory declarations -- added TemplateContentHandler declarations -- two new fields and four functions added to CommonBaseEvent "class": -- hcbe_TemplateContentHandler *_templateContentHandler -- int _isComplete -- hcbe_CommonBaseEventSetContentHandlerFP setContentHandler; -- hcbe_CommonBaseEventGetContentHandlerFP getContentHandler; -- hcbe_CommonBaseEventIsCompleteFP isComplete; -- hcbe_CommonBaseEventCompleteFP complete; 2. File CommonBaseEvent.c: Following functions added: -- void commonBaseEvent_setContentHandler(hcbe_CommonBaseEvent* commonBaseEvent, hcbe_TemplateContentHandler* templateContentHandler) -- hcbe_TemplateContentHandler* commonBaseEvent_getContentHandler(hcbe_CommonBaseEvent* commonBaseEvent) -- int commonBaseEvent_isComplete(hcbe_CommonBaseEvent* commonBaseEvent) -- void commonBaseEvent_complete(hcbe_CommonBaseEvent* commonBaseEvent) 3. EventFormatter.c -- removed code related to CBE V1.0 -- changes made to the function hcbe_commonBaseEventFromCanonicalXMLString(char* xmlString) In this function, we had some code like: masterIndex = strstr(xmlString, "<contextDataElements "); By doing this way, if no ContextDataElement presents in the template CBE XML file, then the masterIndex will be NULL, so we lost the track of the masterIndex. Therefore, we will not be able to retrieve the <any> values when the processing going down to the end of the XML file. This problem was fixed in this way: if(strstr(xmlString, "<contextDataElements ") != NULL){ masterIndex = strstr(xmlString, "<contextDataElements "); ...... 4. New files EventFactory.c TemplateContentHandler.c
The following files checked-in to Hyades 3.3 (HEAD) and TPTP 4.0 (HEAD) on April 28, 2005: -CommonBaseEvent.c -CommonBaseEvent.h -EventFactory.c -EventFormatter.c -TemplateContentHandler.c -cImpl.def -cImpl.dsp
Verified in Hyades 3.3 (HEAD) build (20050502_0704) on May 2, 2005.
Closing.