From 6d231091ddf24f5c05e51b8c48e455b09dab47c8 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 26 Aug 2007 01:26:13 +0000 Subject: Removed Trigger lob adapting methods. --- .../com/amazon/carbonado/spi/TriggerManager.java | 85 +--------------------- 1 file changed, 1 insertion(+), 84 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/spi') diff --git a/src/main/java/com/amazon/carbonado/spi/TriggerManager.java b/src/main/java/com/amazon/carbonado/spi/TriggerManager.java index e7b653c..46747ea 100644 --- a/src/main/java/com/amazon/carbonado/spi/TriggerManager.java +++ b/src/main/java/com/amazon/carbonado/spi/TriggerManager.java @@ -33,9 +33,6 @@ import com.amazon.carbonado.Storable; import com.amazon.carbonado.Trigger; import com.amazon.carbonado.TriggerFactory; -import com.amazon.carbonado.lob.Blob; -import com.amazon.carbonado.lob.Clob; - /** * Used by Storage implementations to manage triggers and consolidate them into * single logical triggers. This class is thread-safe and ensures that changes @@ -49,7 +46,6 @@ public class TriggerManager extends Trigger { private static final int FOR_UPDATE = 2; private static final int FOR_DELETE = 4; private static final int FOR_LOAD = 8; - private static final int FOR_ADAPT_LOB = 16; private static final Method BEFORE_INSERT_METHOD, @@ -70,10 +66,7 @@ public class TriggerManager extends Trigger { AFTER_TRY_DELETE_METHOD, FAILED_DELETE_METHOD, - AFTER_LOAD_METHOD, - - ADAPT_BLOB_METHOD, - ADAPT_CLOB_METHOD; + AFTER_LOAD_METHOD; static { Class triggerClass = Trigger.class; @@ -100,11 +93,6 @@ public class TriggerManager extends Trigger { FAILED_DELETE_METHOD = triggerClass.getMethod("failedDelete", TWO_PARAMS); AFTER_LOAD_METHOD = triggerClass.getMethod("afterLoad", ONE_PARAM); - - ADAPT_BLOB_METHOD = triggerClass - .getMethod("adaptBlob", Object.class, String.class, Blob.class); - ADAPT_CLOB_METHOD = triggerClass - .getMethod("adaptClob", Object.class, String.class, Clob.class); } catch (NoSuchMethodException e) { Error error = new NoSuchMethodError(); error.initCause(e); @@ -116,7 +104,6 @@ public class TriggerManager extends Trigger { private final ForUpdate mForUpdate = new ForUpdate(); private final ForDelete mForDelete = new ForDelete(); private final ForLoad mForLoad = new ForLoad(); - private final ForAdaptLob mForAdaptLob = new ForAdaptLob(); public TriggerManager() { } @@ -175,18 +162,6 @@ public class TriggerManager extends Trigger { return forLoad.isEmpty() ? null : forLoad; } - /** - * Returns a consolidated trigger to call for adapt LOB operations, or null - * if none. If not null, the consolidated trigger is not a snapshot -- it - * will change as the set of triggers in this manager changes. - * - * @since 1.2 - */ - public Trigger getAdaptLobTrigger() { - ForAdaptLob forAdaptLob = mForAdaptLob; - return forAdaptLob.isEmpty() ? null : forAdaptLob; - } - public boolean addTrigger(Trigger trigger) { if (trigger == null) { throw new IllegalArgumentException(); @@ -208,9 +183,6 @@ public class TriggerManager extends Trigger { if ((types & FOR_LOAD) != 0) { retValue |= mForLoad.add(trigger); } - if ((types & FOR_ADAPT_LOB) != 0) { - retValue |= mForAdaptLob.add(trigger); - } return retValue; } @@ -236,9 +208,6 @@ public class TriggerManager extends Trigger { if ((types & FOR_LOAD) != 0) { retValue |= mForLoad.remove(trigger); } - if ((types & FOR_ADAPT_LOB) != 0) { - retValue |= mForAdaptLob.remove(trigger); - } return retValue; } @@ -422,16 +391,6 @@ public class TriggerManager extends Trigger { mForLoad.afterLoad(storable); } - @Override - public Blob adaptBlob(S storable, String name, Blob blob) { - return mForAdaptLob.adaptBlob(storable, name, blob); - } - - @Override - public Clob adaptClob(S storable, String name, Clob clob) { - return mForAdaptLob.adaptClob(storable, name, clob); - } - /** * Determines which operations the given trigger overrides. */ @@ -471,12 +430,6 @@ public class TriggerManager extends Trigger { types |= FOR_LOAD; } - if (overridesMethod(triggerClass, ADAPT_BLOB_METHOD) || - overridesMethod(triggerClass, ADAPT_CLOB_METHOD)) - { - types |= FOR_ADAPT_LOB; - } - return types; } @@ -1057,40 +1010,4 @@ public class TriggerManager extends Trigger { } } } - - private static class ForAdaptLob extends ManagedTrigger { - @Override - public Blob adaptBlob(S storable, String name, Blob blob) { - if (isLocallyDisabled()) { - return blob; - } - - Trigger[] triggers = mTriggers; - - int length = triggers.length; - - for (int i=0; i[] triggers = mTriggers; - - int length = triggers.length; - - for (int i=0; i