1 8 9 package com.sleepycat.je; 10 11 import com.sleepycat.je.txn.Locker; 12 13 class SecondaryTrigger implements DatabaseTrigger { 14 15 private SecondaryDatabase secDb; 16 17 SecondaryTrigger(SecondaryDatabase secDb) { 18 19 this.secDb = secDb; 20 } 21 22 final SecondaryDatabase getDb() { 23 24 return secDb; 25 } 26 27 public void triggerAdded(Database db) { 28 } 29 30 public void triggerRemoved(Database db) { 31 32 secDb.clearPrimary(); 33 } 34 35 public void databaseUpdated(Database db, 36 Locker locker, 37 DatabaseEntry priKey, 38 DatabaseEntry oldData, 39 DatabaseEntry newData) 40 throws DatabaseException { 41 42 secDb.updateSecondary(locker, null, priKey, oldData, newData); 43 } 44 } 45 | Popular Tags |