| 1 21 package com.db4o.events.impl; 22 23 import com.db4o.events.Event4; 24 import com.db4o.events.EventRegistry; 25 import com.db4o.inside.callbacks.Callbacks; 26 import com.db4o.query.Query; 27 28 31 public class EventRegistryImpl implements Callbacks, EventRegistry { 32 33 protected final Event4Impl _queryStarted = new Event4Impl(); 34 protected final Event4Impl _queryFinished = new Event4Impl(); 35 protected final Event4Impl _creating = new Event4Impl(); 36 protected final Event4Impl _activating = new Event4Impl(); 37 protected final Event4Impl _updating = new Event4Impl(); 38 protected final Event4Impl _deleting = new Event4Impl(); 39 protected final Event4Impl _deactivating = new Event4Impl(); 40 protected final Event4Impl _created = new Event4Impl(); 41 protected final Event4Impl _activated = new Event4Impl(); 42 protected final Event4Impl _updated = new Event4Impl(); 43 protected final Event4Impl _deleted = new Event4Impl(); 44 protected final Event4Impl _deactivated = new Event4Impl(); 45 46 public void onQueryFinished(Query query) { 48 EventPlatform.triggerQueryEvent(_queryFinished, query); 49 } 50 51 public void onQueryStarted(Query query) { 52 EventPlatform.triggerQueryEvent(_queryStarted, query); 53 } 54 55 public boolean objectCanNew(Object obj) { 56 return EventPlatform.triggerCancellableObjectEventArgs(_creating, obj); 57 } 58 59 public boolean objectCanActivate(Object obj) { 60 return EventPlatform.triggerCancellableObjectEventArgs(_activating, obj); 61 } 62 63 public boolean objectCanUpdate(Object obj) { 64 return EventPlatform.triggerCancellableObjectEventArgs(_updating, obj); 65 } 66 67 public boolean objectCanDelete(Object obj) { 68 return EventPlatform.triggerCancellableObjectEventArgs(_deleting, obj); 69 } 70 71 public boolean objectCanDeactivate(Object obj) { 72 return EventPlatform.triggerCancellableObjectEventArgs(_deactivating, obj); 73 } 74 75 public void objectOnActivate(Object obj) { 76 EventPlatform.triggerObjectEvent(_activated, obj); 77 } 78 79 public void objectOnNew(Object obj) { 80 EventPlatform.triggerObjectEvent(_created, obj); 81 } 82 83 public void objectOnUpdate(Object obj) { 84 EventPlatform.triggerObjectEvent(_updated, obj); 85 } 86 87 public void objectOnDelete(Object obj) { 88 EventPlatform.triggerObjectEvent(_deleted, obj); 89 } 90 91 public void objectOnDeactivate(Object obj) { 92 EventPlatform.triggerObjectEvent(_deactivated, obj); 93 } 94 95 public Event4 queryFinished() { 96 return _queryFinished; 97 } 98 99 public Event4 queryStarted() { 100 return _queryStarted; 101 } 102 103 public Event4 creating() { 104 return _creating; 105 } 106 107 public Event4 activating() { 108 return _activating; 109 } 110 111 public Event4 updating() { 112 return _updating; 113 } 114 115 public Event4 deleting() { 116 return _deleting; 117 } 118 119 public Event4 deactivating() { 120 return _deactivating; 121 } 122 123 public Event4 created() { 124 return _created; 125 } 126 127 public Event4 activated() { 128 return _activated; 129 } 130 131 public Event4 updated() { 132 return _updated; 133 } 134 135 public Event4 deleted() { 136 return _deleted; 137 } 138 139 public Event4 deactivated() { 140 return _deactivated; 141 } 142 } 143 | Popular Tags |