Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333460

Summary: Add ability to register commit handlers and loggers
Product: [Modeling] EMF Reporter: Jos Warmer <jos.warmer>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 Keywords: noteworthy
Version: 4.0   
Target Milestone: ---   
Hardware: Other   
OS: other   
Whiteboard: Power to the People
Attachments:
Description Flags
Patch v1
none
Patch v2 none

Description Jos Warmer CLA 2011-01-04 06:40:07 EST
Build Identifier: 

For reproducing what multiple users have been doing it is very helpful to have a log file that contains all the commits that have been done. 

Reproducible: Always
Comment 1 Eike Stepper CLA 2011-01-04 10:48:33 EST
Created attachment 186015 [details]
Patch v1
Comment 2 Eike Stepper CLA 2011-01-04 10:53:30 EST
I've implemented several new CDOCommitInfoHandlers:

	AsyncCommitInfoHandler.java
	BinaryCommitInfoLog.java
	TextCommitInfoLog.java
	
CDOCommitInfoHandlers can be used in many places. Some examples are in CommitInfoTest:

	testLogThroughClient()
	testLogThroughWriteAccessHandler()
	testLogThroughCommitInfoHandler()
	
I've also created a new public hook in IRepository:

	addCommitInfoHandler(CDOCommitInfoHandler)
	removeCommitInfoHandler(CDOCommitInfoHandler)
Comment 3 Eike Stepper CLA 2011-01-04 11:00:18 EST
Note that the AsyncCommitInfoHandler needs to be activated/deactivated:

    AsyncCommitInfoHandler log = new AsyncCommitInfoHandler(new TextCommitInfoLog(stream));
    log.activate();
    getRepository().addCommitInfoHandler(log);

 		...
 		
    log.deactivate();
    LifecycleUtil.waitForInactive(log, Long.MAX_VALUE);
    stream.close();
Comment 4 Eike Stepper CLA 2011-01-04 11:02:33 EST
Created attachment 186017 [details]
Patch v2
Comment 5 Eike Stepper CLA 2011-01-04 11:04:01 EST
Committed to HEAD
Comment 6 Eike Stepper CLA 2011-06-23 03:40:21 EDT
Available in R20110608-1407