Create a custom Common Base Event content handler or template to automate configuration or values for specific events. A content handler is an object that automatically sets the property values of each event based on any arbitrary policies that you want to use.
The following content handler classes were added to WebSphere Application Server to facilitate the use of the Common Base Event infrastructure:
Class Name | Description |
WsContentHandlerImpl | This provides an implementation of org.eclipse.hyades.logging.events.cbe.ContentHandler specifically for use in the WebSphere Application Server environment. This content handler completes Common Base Events using information from the WebSphere Application Server runtime, and it uses the same content handler as is used internally by the WebSphere Application Server when completing Common Base Events for logging. |
WsTemplateContentHandlerImpl | This provides the same function as WsContentHandlerImpl, but it extends the org.eclipse.hyades.logging.events.cbe.impl.TemplateContentHandlerImpl class to enable the use of a Common Base Event template. Template content takes precedence in cases where the template data specifies values for the same Common Base Event fields as does the WsContentHandlerImpl. |
public class CustomContentHandler extends WsContentHandlerImpl { public CustomContentHandler() { super(); // TODO Custom initialization code goes here } public void completeEvent(CommonBaseEvent cbe) throws CompletionException { // following code will add WAS content to the Content Base Event super.completeEvent(cbe); // TODO Custom content can be added to the Content Base Event here } }
public class CustomTemplateContentHandler extends WsTemplateContentHandlerImpl { public CustomTemplateContentHandler() { super(); // TODO Custom initialization code goes here } public void completeEvent(CommonBaseEvent cbe) throws CompletionException { // following code will add WAS content to the Content Base Event super.completeEvent(cbe); // TODO Custom content can be added to the Content Base Event here } }