openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: regarding configuration of the distributed cache
Date Sun, 03 Aug 2008 20:20:02 GMT

The listener side must add a handler to process the post-commit event it
receives over tcp.

The way to do this is as follows:
========================================================================
  OpenJPAEntityManagerFactory emf = ...;
  RemoteCommitListener listener = new RemoteCommitListener(){
	public void afterCommit(RemoteCommitEvent event) {
           // do whatever processing is required or just print to test
	   System.err.println("RemoteCommitListener.afterCommit()" + event);
	}
	public void close() {
	  System.err.println("Closing RemoteCommitListener");
	}
   };
   // add the listener 
 
emf.getConfiguration().getRemoteCommitEventManager().addListener(listener);
========================================================================

-- 
View this message in context: http://n2.nabble.com/regarding-configuration-of-the-distributed-cache-tp660903p667440.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message