| This only works with CouchDB >= 0.10.0 and is still an experimental feature in couch4j. |
The Database.addChangeListener method allows you to register ChangeListeners. A ChangeEvent will be delivered whenever the database changes. The implementation currently only supports the continuous change API. An overloaded method will be added that allows the client to define the update sequence to start with.
CouchDbClient server = new DefaultCouchDbClient(); Database database = server.getDatabase("couch4j"); database.addChangeListener(new ChangeListener() { public void onChange(ChangeEvent event) { System.out.println(event); } }); // This or *any other change* to the couch4j CouchDB database will trigger a change event. database.saveDocument(new Document("test-1"));
Comments (0)
Anonymous replies:
Help Tips
- Text formatting
- Headings
- Lists
Full notation guide*bold*bold_italic_italich1.Large headingh5.Small heading*Bulleted point#Numbered point