Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333460 - Add ability to register commit handlers and loggers
Summary: Add ability to register commit handlers and loggers
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: Other other
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Power to the People
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2011-01-04 06:40 EST by Jos Warmer CLA
Modified: 2011-06-23 03:40 EDT (History)
0 users

See Also:


Attachments
Patch v1 (28.92 KB, patch)
2011-01-04 10:48 EST, Eike Stepper CLA
no flags Details | Diff
Patch v2 (29.89 KB, patch)
2011-01-04 11:02 EST, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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