cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r932996 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ framework...
Date Sun, 11 Apr 2010 21:33:01 GMT
Author: aadamchik
Date: Sun Apr 11 21:33:00 2010
New Revision: 932996

URL: http://svn.apache.org/viewvc?rev=932996&view=rev
Log:
CAY-1422 Convert EventManager to an interface, make it injectable

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/EventManagerProvider.java
      - copied, changed from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DefaultEventManager.java
      - copied, changed from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java
      - copied, changed from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventManagerTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/MockEventManager.java
Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventManagerTest.java
Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/Configuration.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/CayenneServerModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DispatchQueue.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataDomainTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataRowStoreTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/SimpleAccessStack.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Apr 11 21:33:00 2010
@@ -35,6 +35,7 @@ CAY-1393 Update velocity to 1.6.3
 CAY-1394 DI-based replacement for JNDI hack
 CAY-1415 Replace WebApplicationContextFilter with a DI-enabled filter
 CAY-1419 File-based ResourceLocator to replace legacy FileConfiguration
+CAY-1422 Convert EventManager to an interface, make it injectable
 
 Bug Fixes Since 3.0:
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/Configuration.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/Configuration.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/Configuration.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/Configuration.java Sun Apr 11 21:33:00 2010
@@ -33,6 +33,7 @@ import org.apache.cayenne.CayenneRuntime
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -180,7 +181,7 @@ public abstract class Configuration {
         // set domain configuration name
         this.setDomainConfigurationName(domainConfigurationName);
 
-        this.eventManager = new EventManager();
+        this.eventManager = new DefaultEventManager();
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/CayenneServerModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/CayenneServerModule.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/CayenneServerModule.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/CayenneServerModule.java Sun Apr 11 21:33:00 2010
@@ -50,6 +50,7 @@ import org.apache.cayenne.dba.sybase.Syb
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.di.Scopes;
+import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.resource.ClassLoaderResourceLocator;
 import org.apache.cayenne.resource.ResourceLocator;
 
@@ -98,6 +99,9 @@ public class CayenneServerModule impleme
         binder.bind(ConfigurationNameMapper.class).to(
                 DefaultConfigurationNameMapper.class).in(Scopes.SINGLETON);
 
+        binder.bind(EventManager.class).toProvider(EventManagerProvider.class).in(
+                Scopes.SINGLETON);
+
         // a service to provide the main stack DataDomain
         binder.bind(DataDomain.class).toProvider(DataDomainProvider.class).in(
                 Scopes.SINGLETON);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java Sun Apr 11 21:33:00 2010
@@ -35,6 +35,7 @@ import org.apache.cayenne.configuration.
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Provider;
+import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.resource.ResourceLocator;
@@ -71,6 +72,9 @@ public class DataDomainProvider implemen
 
     @Inject
     protected AdhocObjectFactory objectFactory;
+    
+    @Inject
+    protected EventManager eventManager;
 
     protected volatile DataDomain dataDomain;
 
@@ -154,6 +158,7 @@ public class DataDomainProvider implemen
 
         DataChannelDescriptor descriptor = tree.getRootNode();
         DataDomain dataDomain = new DataDomain(descriptor.getName());
+        dataDomain.setEventManager(eventManager);
         dataDomain.initWithProperties(descriptor.getProperties());
 
         for (DataMap dataMap : descriptor.getDataMaps()) {

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/EventManagerProvider.java (from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/EventManagerProvider.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/EventManagerProvider.java&p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java&r1=932955&r2=932996&rev=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/EventManagerProvider.java Sun Apr 11 21:33:00 2010
@@ -16,46 +16,21 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
+package org.apache.cayenne.configuration.server;
 
-package org.apache.cayenne.access;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.cayenne.DataRow;
-import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.ConfigurationException;
+import org.apache.cayenne.di.Provider;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventManager;
 
 /**
- * A "lightweight" DataRowStore.
+ * Creates an EventManager.
  * 
+ * @since 3.1
  */
-public class MockDataRowStore extends DataRowStore {
-
-    private static final Map TEST_DEFAULTS = new HashMap();
-
-    static {
-        TEST_DEFAULTS.put(DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, new Integer(10));
-        TEST_DEFAULTS.put(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, Boolean.FALSE);
-    }
-
-    public MockDataRowStore() {
-        super("mock DataRowStore", TEST_DEFAULTS, new EventManager());
-    }
-
-    /**
-     * A backdoor to add test snapshots.
-     */
-    public void putSnapshot(ObjectId id, DataRow snapshot) {
-        snapshots.put(id, snapshot);
-    }
+public class EventManagerProvider implements Provider<EventManager> {
 
-    public void putSnapshot(ObjectId id, Map snapshot) {
-        snapshots.put(id, new DataRow(snapshot));
+    public EventManager get() throws ConfigurationException {
+        return new DefaultEventManager();
     }
-
-    public void putEmptySnapshot(ObjectId id) {
-        snapshots.put(id, new DataRow(2));
-    }
-
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DefaultEventManager.java (from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DefaultEventManager.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DefaultEventManager.java&p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java&r1=932955&r2=932996&rev=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DefaultEventManager.java Sun Apr 11 21:33:00 2010
@@ -16,7 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
 package org.apache.cayenne.event;
 
 import java.util.ArrayList;
@@ -31,13 +30,13 @@ import org.apache.cayenne.CayenneRuntime
 import org.apache.cayenne.util.Invocation;
 
 /**
- * This class acts as bridge between an Object that wants to inform others about its
- * current state or a change thereof (Publisher) and a list of objects interested in the
- * Subject (Listeners).
+ * A default implementation of {@link EventManager}.
+ * 
+ * @since 3.1
  */
-public class EventManager {
+public class DefaultEventManager implements EventManager {
 
-    public static final int DEFAULT_DISPATCH_THREAD_COUNT = 5;
+    static final int DEFAULT_DISPATCH_THREAD_COUNT = 5;
 
     // keeps weak references to subjects
     protected Map<EventSubject, DispatchQueue> subjects;
@@ -49,7 +48,7 @@ public class EventManager {
     /**
      * Creates a multithreaded EventManager using default thread count.
      */
-    public EventManager() {
+    public DefaultEventManager() {
         this(DEFAULT_DISPATCH_THREAD_COUNT);
     }
 
@@ -58,7 +57,7 @@ public class EventManager {
      * dispatching. To create a single-threaded EventManager, use thread count of zero or
      * less.
      */
-    public EventManager(int dispatchThreadCount) {
+    public DefaultEventManager(int dispatchThreadCount) {
         this.subjects = Collections
                 .synchronizedMap(new WeakHashMap<EventSubject, DispatchQueue>());
         this.eventQueue = Collections.synchronizedList(new LinkedList<Dispatch>());
@@ -141,7 +140,7 @@ public class EventManager {
 
         if (singleThread) {
             throw new IllegalStateException(
-                    "EventManager is configured to be single-threaded.");
+                    "DefaultEventManager is configured to be single-threaded.");
         }
 
         this.addListener(listener, methodName, eventParameterClass, subject, null, false);
@@ -177,7 +176,7 @@ public class EventManager {
 
         if (singleThread) {
             throw new IllegalStateException(
-                    "EventManager is configured to be single-threaded.");
+                    "DefaultEventManager is configured to be single-threaded.");
         }
 
         addListener(listener, methodName, eventParameterClass, subject, sender, false);
@@ -220,8 +219,8 @@ public class EventManager {
     }
 
     /**
-     * Unregister the specified listener from all event subjects handled by this
-     * <code>EventManager</code> instance.
+     * Unregister the specified listener from all event subjects handled by this manager
+     * instance.
      * 
      * @param listener the object to be unregistered
      * @return <code>true</code> if <code>listener</code> could be removed for any
@@ -371,7 +370,7 @@ public class EventManager {
         }
 
         void fire() {
-            EventManager.this.dispatchEvent(Dispatch.this);
+            DefaultEventManager.this.dispatchEvent(Dispatch.this);
         }
 
         boolean fire(Invocation invocation) {
@@ -443,14 +442,14 @@ public class EventManager {
                 // is empty, just wait
                 Dispatch dispatch = null;
 
-                synchronized (EventManager.this.eventQueue) {
-                    if (EventManager.this.eventQueue.size() > 0) {
-                        dispatch = EventManager.this.eventQueue.remove(0);
+                synchronized (DefaultEventManager.this.eventQueue) {
+                    if (DefaultEventManager.this.eventQueue.size() > 0) {
+                        dispatch = DefaultEventManager.this.eventQueue.remove(0);
                     }
                     else {
                         try {
                             // wake up occasionally to check whether EM has been stopped
-                            EventManager.this.eventQueue.wait(3 * 60 * 1000);
+                            DefaultEventManager.this.eventQueue.wait(3 * 60 * 1000);
                         }
                         catch (InterruptedException e) {
                             // ignore interrupts...

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DispatchQueue.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DispatchQueue.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DispatchQueue.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/DispatchQueue.java Sun Apr 11 21:33:00 2010
@@ -28,7 +28,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.WeakHashMap;
 
-import org.apache.cayenne.event.EventManager.Dispatch;
+import org.apache.cayenne.event.DefaultEventManager.Dispatch;
 import org.apache.cayenne.util.Invocation;
 
 /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/event/EventManager.java Sun Apr 11 21:33:00 2010
@@ -19,67 +19,19 @@
 
 package org.apache.cayenne.event;
 
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.EventObject;
-import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
 
-import org.apache.cayenne.CayenneRuntimeException;
-import org.apache.cayenne.util.Invocation;
+import org.apache.cayenne.event.DefaultEventManager.Dispatch;
 
 /**
  * This class acts as bridge between an Object that wants to inform others about its
  * current state or a change thereof (Publisher) and a list of objects interested in the
  * Subject (Listeners).
+ * 
+ * @since 3.1 before 3.1 this was a concrete class.
  */
-public class EventManager {
-
-    public static final int DEFAULT_DISPATCH_THREAD_COUNT = 5;
-
-    // keeps weak references to subjects
-    protected Map<EventSubject, DispatchQueue> subjects;
-    protected List<Dispatch> eventQueue;
-    protected boolean singleThread;
-    protected volatile boolean stopped;
-    List<DispatchThread> dispatchThreads;
-
-    /**
-     * Creates a multithreaded EventManager using default thread count.
-     */
-    public EventManager() {
-        this(DEFAULT_DISPATCH_THREAD_COUNT);
-    }
-
-    /**
-     * Creates an EventManager starting the specified number of threads for multithreaded
-     * dispatching. To create a single-threaded EventManager, use thread count of zero or
-     * less.
-     */
-    public EventManager(int dispatchThreadCount) {
-        this.subjects = Collections
-                .synchronizedMap(new WeakHashMap<EventSubject, DispatchQueue>());
-        this.eventQueue = Collections.synchronizedList(new LinkedList<Dispatch>());
-        this.singleThread = dispatchThreadCount <= 0;
-
-        if (!singleThread) {
-            dispatchThreads = new ArrayList<DispatchThread>(dispatchThreadCount);
-
-            String prefix = "cayenne-edt-" + hashCode() + "-";
-
-            // start dispatch threads
-            for (int i = 0; i < dispatchThreadCount; i++) {
-                DispatchThread thread = new DispatchThread(prefix + i);
-                dispatchThreads.add(thread);
-                thread.start();
-            }
-        }
-        else {
-            dispatchThreads = Collections.emptyList();
-        }
-    }
+public interface EventManager {
 
     /**
      * Returns true if this EventManager is single-threaded. If so it will throw an
@@ -88,9 +40,7 @@ public class EventManager {
      * 
      * @since 1.2
      */
-    public boolean isSingleThreaded() {
-        return singleThread;
-    }
+    boolean isSingleThreaded();
 
     /**
      * Returns a list of currently queued events. Queue is returned by copy. This method
@@ -99,11 +49,7 @@ public class EventManager {
      * 
      * @since 1.1
      */
-    public List<Dispatch> getEventQueue() {
-        synchronized (eventQueue) {
-            return new ArrayList<Dispatch>(eventQueue);
-        }
-    }
+    List<Dispatch> getEventQueue();
 
     /**
      * Stops event threads. After the EventManager is stopped, it can not be restarted and
@@ -111,41 +57,24 @@ public class EventManager {
      * 
      * @since 3.0
      */
-    public void shutdown() {
-        this.stopped = true;
-
-        for (DispatchThread thread : dispatchThreads) {
-            thread.interrupt();
-        }
-    }
+    void shutdown();
 
     /**
      * Register an <code>EventListener</code> for events sent by any sender.
      * 
-     * @throws RuntimeException if <code>methodName</code> is not found
-     * @see #addListener(Object, String, Class, EventSubject, Object)
+     * @throws RuntimeException if <code>methodName</code> is not found.
      */
-    public void addListener(
+    void addListener(
             Object listener,
             String methodName,
             Class<?> eventParameterClass,
-            EventSubject subject) {
-        this.addListener(listener, methodName, eventParameterClass, subject, null, true);
-    }
+            EventSubject subject);
 
-    public void addNonBlockingListener(
+    void addNonBlockingListener(
             Object listener,
             String methodName,
             Class<?> eventParameterClass,
-            EventSubject subject) {
-
-        if (singleThread) {
-            throw new IllegalStateException(
-                    "EventManager is configured to be single-threaded.");
-        }
-
-        this.addListener(listener, methodName, eventParameterClass, subject, null, false);
-    }
+            EventSubject subject);
 
     /**
      * Register an <code>EventListener</code> for events sent by a specific sender.
@@ -159,104 +88,34 @@ public class EventManager {
      *            <code>null</code> means 'any sender'.
      * @throws RuntimeException if <code>methodName</code> is not found
      */
-    public void addListener(
+    void addListener(
             Object listener,
             String methodName,
             Class<?> eventParameterClass,
             EventSubject subject,
-            Object sender) {
-        addListener(listener, methodName, eventParameterClass, subject, sender, true);
-    }
+            Object sender);
 
-    public void addNonBlockingListener(
+    void addNonBlockingListener(
             Object listener,
             String methodName,
             Class<?> eventParameterClass,
             EventSubject subject,
-            Object sender) {
-
-        if (singleThread) {
-            throw new IllegalStateException(
-                    "EventManager is configured to be single-threaded.");
-        }
-
-        addListener(listener, methodName, eventParameterClass, subject, sender, false);
-    }
-
-    protected void addListener(
-            Object listener,
-            String methodName,
-            Class<?> eventParameterClass,
-            EventSubject subject,
-            Object sender,
-            boolean blocking) {
-
-        if (listener == null) {
-            throw new IllegalArgumentException("Listener must not be null.");
-        }
-
-        if (eventParameterClass == null) {
-            throw new IllegalArgumentException("Event class must not be null.");
-        }
-
-        if (subject == null) {
-            throw new IllegalArgumentException("Subject must not be null.");
-        }
-
-        try {
-            Invocation invocation = (blocking) ? new Invocation(
-                    listener,
-                    methodName,
-                    eventParameterClass) : new NonBlockingInvocation(
-                    listener,
-                    methodName,
-                    eventParameterClass);
-            dispatchQueueForSubject(subject, true).addInvocation(invocation, sender);
-        }
-        catch (NoSuchMethodException nsm) {
-            throw new CayenneRuntimeException("Error adding listener, method name: "
-                    + methodName, nsm);
-        }
-    }
+            Object sender);
 
     /**
-     * Unregister the specified listener from all event subjects handled by this
-     * <code>EventManager</code> instance.
+     * Unregister the specified listener from all event subjects handled by this manager
+     * instance.
      * 
      * @param listener the object to be unregistered
      * @return <code>true</code> if <code>listener</code> could be removed for any
      *         existing subjects, else returns <code>false</code>.
      */
-    public boolean removeListener(Object listener) {
-        if (listener == null) {
-            return false;
-        }
-
-        boolean didRemove = false;
-
-        synchronized (subjects) {
-            if (!subjects.isEmpty()) {
-                for (EventSubject subject : subjects.keySet()) {
-                    didRemove |= this.removeListener(listener, subject);
-                }
-            }
-        }
-
-        return didRemove;
-    }
+    boolean removeListener(Object listener);
 
     /**
      * Removes all listeners for a given subject.
      */
-    public boolean removeAllListeners(EventSubject subject) {
-        if (subject != null) {
-            synchronized (subjects) {
-                return subjects.remove(subject) != null;
-            }
-        }
-
-        return false;
-    }
+    boolean removeAllListeners(EventSubject subject);
 
     /**
      * Unregister the specified listener for the events about the given subject.
@@ -266,9 +125,7 @@ public class EventManager {
      * @return <code>true</code> if <code>listener</code> could be removed for the given
      *         subject, else returns <code>false</code>.
      */
-    public boolean removeListener(Object listener, EventSubject subject) {
-        return this.removeListener(listener, subject, null);
-    }
+    boolean removeListener(Object listener, EventSubject subject);
 
     /**
      * Unregister the specified listener for the events about the given subject and the
@@ -281,18 +138,7 @@ public class EventManager {
      * @return <code>true</code> if <code>listener</code> could be removed for the given
      *         subject, else returns <code>false</code>.
      */
-    public boolean removeListener(Object listener, EventSubject subject, Object sender) {
-        if (listener == null || subject == null) {
-            return false;
-        }
-
-        DispatchQueue subjectQueue = dispatchQueueForSubject(subject, false);
-        if (subjectQueue == null) {
-            return false;
-        }
-
-        return subjectQueue.removeInvocations(listener, sender);
-    }
+    boolean removeListener(Object listener, EventSubject subject, Object sender);
 
     /**
      * Sends an event to all registered objects about a particular subject. Event is sent
@@ -303,9 +149,7 @@ public class EventManager {
      * @param subject the subject about which observers will be notified
      * @throws IllegalArgumentException if event or subject are null
      */
-    public void postEvent(EventObject event, EventSubject subject) {
-        dispatchEvent(new Dispatch(event, subject));
-    }
+    void postEvent(EventObject event, EventSubject subject);
 
     /**
      * Sends an event to all registered objects about a particular subject. Event is
@@ -317,159 +161,5 @@ public class EventManager {
      * @throws IllegalArgumentException if event or subject are null
      * @since 1.1
      */
-    public void postNonBlockingEvent(EventObject event, EventSubject subject) {
-        if (singleThread) {
-            throw new IllegalStateException(
-                    "EventManager is configured to be single-threaded.");
-        }
-
-        // add dispatch to the queue and return
-        synchronized (eventQueue) {
-            eventQueue.add(new Dispatch(event, subject));
-            eventQueue.notifyAll();
-        }
-    }
-
-    private void dispatchEvent(Dispatch dispatch) {
-        DispatchQueue dispatchQueue = dispatchQueueForSubject(dispatch.subject, false);
-        if (dispatchQueue != null) {
-            dispatchQueue.dispatchEvent(dispatch);
-        }
-    }
-
-    // returns a subject's mapping from senders to registered listener invocations
-    private DispatchQueue dispatchQueueForSubject(EventSubject subject, boolean create) {
-        synchronized (subjects) {
-            DispatchQueue listenersStore = subjects.get(subject);
-            if (create && listenersStore == null) {
-                listenersStore = new DispatchQueue();
-                subjects.put(subject, listenersStore);
-            }
-            return listenersStore;
-        }
-    }
-
-    // represents a posted event
-    class Dispatch {
-
-        EventObject[] eventArgument;
-        EventSubject subject;
-
-        Dispatch(EventObject event, EventSubject subject) {
-            this(new EventObject[] {
-                event
-            }, subject);
-        }
-
-        Dispatch(EventObject[] eventArgument, EventSubject subject) {
-            this.eventArgument = eventArgument;
-            this.subject = subject;
-        }
-
-        Object getSender() {
-            return eventArgument[0].getSource();
-        }
-
-        void fire() {
-            EventManager.this.dispatchEvent(Dispatch.this);
-        }
-
-        boolean fire(Invocation invocation) {
-            if (invocation instanceof NonBlockingInvocation) {
-
-                // do minimal checks first...
-                if (invocation.getTarget() == null) {
-                    return false;
-                }
-
-                // inject single invocation dispatch into the queue
-                synchronized (eventQueue) {
-                    eventQueue.add(new InvocationDispatch(
-                            eventArgument,
-                            subject,
-                            invocation));
-                    eventQueue.notifyAll();
-                }
-
-                return true;
-            }
-            else {
-                return invocation.fire(eventArgument);
-            }
-        }
-    }
-
-    // represents a posted event that should be sent to a single known listener
-    class InvocationDispatch extends Dispatch {
-
-        Invocation target;
-
-        InvocationDispatch(EventObject[] eventArgument, EventSubject subject,
-                Invocation target) {
-            super(eventArgument, subject);
-            this.target = target;
-        }
-
-        @Override
-        void fire() {
-            // there is no way to kill the invocation if it is bad...
-            // so don't check for status
-            target.fire(eventArgument);
-        }
-    }
-
-    // subclass exists only to tag invocations that should be
-    // dispatched in a separate thread
-    final class NonBlockingInvocation extends Invocation {
-
-        public NonBlockingInvocation(Object target, String methodName,
-                Class<?> parameterType) throws NoSuchMethodException {
-            super(target, methodName, parameterType);
-        }
-    }
-
-    final class DispatchThread extends Thread {
-
-        DispatchThread(String name) {
-            super(name);
-            setDaemon(true);
-        }
-
-        @Override
-        public void run() {
-            while (!stopped) {
-
-                // get event from the queue, if the queue
-                // is empty, just wait
-                Dispatch dispatch = null;
-
-                synchronized (EventManager.this.eventQueue) {
-                    if (EventManager.this.eventQueue.size() > 0) {
-                        dispatch = EventManager.this.eventQueue.remove(0);
-                    }
-                    else {
-                        try {
-                            // wake up occasionally to check whether EM has been stopped
-                            EventManager.this.eventQueue.wait(3 * 60 * 1000);
-                        }
-                        catch (InterruptedException e) {
-                            // ignore interrupts...
-                        }
-                    }
-                }
-
-                // dispatch outside of synchronized block
-                if (!stopped && dispatch != null) {
-                    // this try/catch is needed to prevent DispatchThread
-                    // from dying on dispatch errors
-                    try {
-                        dispatch.fire();
-                    }
-                    catch (Throwable th) {
-                        // ignoring exception
-                    }
-                }
-            }
-        }
-    }
+    void postNonBlockingEvent(EventObject event, EventSubject subject);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java Sun Apr 11 21:33:00 2010
@@ -29,6 +29,7 @@ import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.QueryResponse;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventBridge;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.event.EventSubject;
@@ -69,7 +70,7 @@ public class ClientChannel implements Da
     }
 
     public ClientChannel(ClientConnection connection, boolean channelEventsEnabled) {
-        this(connection, channelEventsEnabled, new EventManager(2));
+        this(connection, channelEventsEnabled, new DefaultEventManager(2));
     }
 
     public ClientChannel(ClientConnection connection, boolean channelEventsEnabled,

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextTest.java Sun Apr 11 21:33:00 2010
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.graph.CompoundDiff;
 import org.apache.cayenne.graph.GraphDiff;
@@ -34,8 +35,8 @@ import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.query.Query;
-import org.apache.cayenne.remote.MockClientConnection;
 import org.apache.cayenne.remote.ClientChannel;
+import org.apache.cayenne.remote.MockClientConnection;
 import org.apache.cayenne.testdo.mt.ClientMtTable1;
 import org.apache.cayenne.testdo.mt.MtTable1;
 import org.apache.cayenne.unit.AccessStack;
@@ -159,7 +160,7 @@ public class CayenneContextTest extends 
     public void testCommitChangesNew() {
         final CompoundDiff diff = new CompoundDiff();
         final Object newObjectId = new ObjectId("test", "key", "generated");
-        final EventManager eventManager = new EventManager(0);
+        final EventManager eventManager = new DefaultEventManager(0);
 
         // test that ids that are passed back are actually propagated to the right
         // objects...
@@ -326,7 +327,7 @@ public class CayenneContextTest extends 
                 .getGlobalAttribute1Direct());
         assertEquals(PersistenceState.COMMITTED, hollow.getPersistenceState());
     }
-    
+
     public void testBeforeHollowDeleteShouldChangeStateToCommited() {
 
         ObjectId gid = new ObjectId("MtTable1", "a", "b");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricTest.java Sun Apr 11 21:33:00 2010
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.art.Artist;
 import org.apache.cayenne.DataRow;
-import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.unit.CayenneCase;
@@ -48,7 +48,7 @@ public class DataContextSharedCacheEmpir
         DataRowStore cache = new DataRowStore(
                 "cacheTest",
                 Collections.EMPTY_MAP,
-                new EventManager());
+                new DefaultEventManager());
 
         c1 = new DataContext(getDomain(), new ObjectStore(cache));
         c2 = new DataContext(getDomain(), new ObjectStore(cache));

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataDomainTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataDomainTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataDomainTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataDomainTest.java Sun Apr 11 21:33:00 2010
@@ -30,7 +30,7 @@ import org.apache.cayenne.cache.MockQuer
 import org.apache.cayenne.cache.MockQueryCacheFactory;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.cache.QueryCacheFactory;
-import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.unit.CayenneCase;
@@ -344,7 +344,7 @@ public class DataDomainTest extends Caye
         DataRowStore cache = new DataRowStore(
                 "Y",
                 Collections.EMPTY_MAP,
-                new EventManager()) {
+                new DefaultEventManager()) {
 
             @Override
             public void shutdown() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataRowStoreTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataRowStoreTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataRowStoreTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataRowStoreTest.java Sun Apr 11 21:33:00 2010
@@ -26,7 +26,7 @@ import java.util.Map;
 import org.apache.art.Artist;
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.unit.CayenneCase;
 
 /**
@@ -37,7 +37,7 @@ public class DataRowStoreTest extends Ca
         DataRowStore cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
-                new EventManager());
+                new DefaultEventManager());
         assertEquals("cacheXYZ", cache.getName());
         assertNotNull(cache.getSnapshotEventSubject());
         assertTrue(cache.getSnapshotEventSubject().getSubjectName().contains("cacheXYZ"));
@@ -51,7 +51,10 @@ public class DataRowStoreTest extends Ca
         props.put(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, String
                 .valueOf(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT));
 
-        DataRowStore cache = new DataRowStore("cacheXYZ", props, new EventManager());
+        DataRowStore cache = new DataRowStore(
+                "cacheXYZ",
+                props,
+                new DefaultEventManager());
         assertEquals("cacheXYZ", cache.getName());
         assertEquals(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                 .isNotifyingRemoteListeners());
@@ -61,7 +64,7 @@ public class DataRowStoreTest extends Ca
         DataRowStore cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
-                new EventManager());
+                new DefaultEventManager());
 
         assertEquals(DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                 .isNotifyingRemoteListeners());
@@ -78,7 +81,10 @@ public class DataRowStoreTest extends Ca
         Map props = new HashMap();
         props.put(DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, String.valueOf(2));
 
-        DataRowStore cache = new DataRowStore("cacheXYZ", props, new EventManager());
+        DataRowStore cache = new DataRowStore(
+                "cacheXYZ",
+                props,
+                new DefaultEventManager());
         assertEquals(2, cache.maximumSize());
         assertEquals(0, cache.size());
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataRowStore.java Sun Apr 11 21:33:00 2010
@@ -24,7 +24,7 @@ import java.util.Map;
 
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.MockEventManager;
 
 /**
  * A "lightweight" DataRowStore.
@@ -40,7 +40,7 @@ public class MockDataRowStore extends Da
     }
 
     public MockDataRowStore() {
-        super("mock DataRowStore", TEST_DEFAULTS, new EventManager());
+        super("mock DataRowStore", TEST_DEFAULTS, new MockEventManager());
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java Sun Apr 11 21:33:00 2010
@@ -52,6 +52,8 @@ import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.MockEventManager;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.resource.ResourceLocator;
@@ -108,10 +110,13 @@ public class DataDomainProviderTest exte
                 Collections.singletonMap(
                         RuntimeProperties.CONFIGURATION_LOCATION,
                         testConfigName));
+        
+        final EventManager eventManager = new MockEventManager();
 
         Module testModule = new Module() {
 
             public void configure(Binder binder) {
+                binder.bind(EventManager.class).toInstance(eventManager);
                 binder.bind(ResourceLocator.class).toInstance(locator);
                 binder.bind(RuntimeProperties.class).toInstance(testProperties);
                 binder.bind(ConfigurationNameMapper.class).to(
@@ -157,6 +162,7 @@ public class DataDomainProviderTest exte
                 provider.get());
 
         DataDomain domain = (DataDomain) channel;
+        assertSame(eventManager, domain.getEventManager());
         assertEquals(2, domain.getDataMaps().size());
         assertTrue(domain.getDataMaps().contains(map1));
         assertTrue(domain.getDataMaps().contains(map2));

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java (from r932955, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventManagerTest.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java&p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventManagerTest.java&r1=932955&r2=932996&rev=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventManagerTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java Sun Apr 11 21:33:00 2010
@@ -27,28 +27,28 @@ import junit.framework.TestCase;
 
 import org.apache.cayenne.unit.util.ThreadedTestHelper;
 
-public class EventManagerTest extends TestCase implements EventListener {
+public class DefaultEventManagerTest extends TestCase implements EventListener {
 
     // used for counting received events on the class
-    public static int _numberOfReceivedEventsForClass;
+    public static int numberOfReceivedEventsForClass;
 
     // used for counting received events per listener instance
-    public int _numberOfReceivedEvents;
+    public int numberOfReceivedEvents;
 
     // the event manager used for testing
-    private EventManager _eventManager;
+    private EventManager eventManager;
 
     @Override
     public void setUp() {
-        _eventManager = new EventManager();
-        _numberOfReceivedEvents = 0;
-        _numberOfReceivedEventsForClass = 0;
+        eventManager = new DefaultEventManager();
+        numberOfReceivedEvents = 0;
+        numberOfReceivedEventsForClass = 0;
     }
 
     public void testSubjectListenerWouldRegisterListener() {
 
-        MockListener listener = new MockListener(_eventManager);
-        _eventManager.addListener(
+        MockListener listener = new MockListener(eventManager);
+        eventManager.addListener(
                 listener,
                 "processEvent",
                 EventObject.class,
@@ -60,19 +60,19 @@ public class EventManagerTest extends Te
         // add more than one listener to see that dispatch can proceed after one of the
         // listeners recats to event
 
-        _eventManager.addListener(
-                new MockListener(_eventManager),
+        eventManager.addListener(
+                new MockListener(eventManager),
                 "processEvent",
                 EventObject.class,
                 MockListener.mockSubject);
 
-        _eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
+        eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
     }
 
     public void testObjectListenerWouldRegisterListener() {
 
-        MockListener listener = new MockListener(_eventManager, this);
-        _eventManager.addListener(
+        MockListener listener = new MockListener(eventManager, this);
+        eventManager.addListener(
                 listener,
                 "processEvent",
                 EventObject.class,
@@ -85,20 +85,20 @@ public class EventManagerTest extends Te
         // add more than one listener to see that dispatch can proceed after one of the
         // listeners recats to event
 
-        _eventManager.addListener(
-                new MockListener(_eventManager, this),
+        eventManager.addListener(
+                new MockListener(eventManager, this),
                 "processEvent",
                 EventObject.class,
                 MockListener.mockSubject,
                 this);
 
-        _eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
+        eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
     }
 
     public void testNullListener() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
-            _eventManager.addListener(null, null, null, subject);
+            eventManager.addListener(null, null, null, subject);
             Assert.fail();
         }
 
@@ -110,7 +110,7 @@ public class EventManagerTest extends Te
     public void testNullNotification() {
         // null notification
         try {
-            _eventManager.addListener(this, "testNullObserver", CayenneEvent.class, null);
+            eventManager.addListener(this, "testNullObserver", CayenneEvent.class, null);
             Assert.fail();
         }
 
@@ -121,7 +121,7 @@ public class EventManagerTest extends Te
         // invalid event class
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "");
-            _eventManager.addListener(this, "testNullObserver", null, subject);
+            eventManager.addListener(this, "testNullObserver", null, subject);
             Assert.fail();
         }
 
@@ -132,7 +132,7 @@ public class EventManagerTest extends Te
         // empty string notification
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "");
-            _eventManager.addListener(
+            eventManager.addListener(
                     this,
                     "testNullObserver",
                     CayenneEvent.class,
@@ -148,7 +148,7 @@ public class EventManagerTest extends Te
     public void testNonexistingMethod() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
-            _eventManager.addListener(
+            eventManager.addListener(
                     this,
                     "thisMethodDoesNotExist",
                     CayenneEvent.class,
@@ -164,7 +164,7 @@ public class EventManagerTest extends Te
     public void testInvalidArgumentTypes() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
-            _eventManager.addListener(
+            eventManager.addListener(
                     this,
                     "seeTheWrongMethod",
                     CayenneEvent.class,
@@ -179,8 +179,8 @@ public class EventManagerTest extends Te
 
     public void testNonretainedListener() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
-                new EventManagerTest(),
+        eventManager.addListener(
+                new DefaultEventManagerTest(),
                 "seeNotification",
                 CayenneEvent.class,
                 subject);
@@ -189,14 +189,14 @@ public class EventManagerTest extends Te
         System.gc();
         System.gc();
 
-        _eventManager.postEvent(new CayenneEvent(this), subject);
-        Assert.assertEquals(0, _numberOfReceivedEventsForClass);
+        eventManager.postEvent(new CayenneEvent(this), subject);
+        Assert.assertEquals(0, numberOfReceivedEventsForClass);
     }
 
     public void testValidSubclassOfRegisteredEventClass() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
-        _eventManager.postEvent(new MyCayenneEvent(this), subject);
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
+        eventManager.postEvent(new MyCayenneEvent(this), subject);
 
         assertReceivedEvents(1, this);
     }
@@ -205,31 +205,31 @@ public class EventManagerTest extends Te
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
 
         // we register a method that takes a CayenneEvent or subclass thereof..
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
 
         // ..but post a subclass of EventObject that is not compatible with CayenneEvent
-        _eventManager.postEvent(new EventObject(this), subject);
+        eventManager.postEvent(new EventObject(this), subject);
 
         assertReceivedEvents(0, this);
     }
 
     public void testSuccessfulNotificationDefaultSender() throws Exception {
-        EventManagerTest listener1 = this;
-        EventManagerTest listener2 = new EventManagerTest();
+        DefaultEventManagerTest listener1 = this;
+        DefaultEventManagerTest listener2 = new DefaultEventManagerTest();
 
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 listener1,
                 "seeNotification",
                 CayenneEvent.class,
                 subject);
-        _eventManager.addListener(
+        eventManager.addListener(
                 listener2,
                 "seeNotification",
                 CayenneEvent.class,
                 subject);
 
-        _eventManager.postEvent(new CayenneEvent(this), subject);
+        eventManager.postEvent(new CayenneEvent(this), subject);
 
         assertReceivedEvents(1, listener1);
         assertReceivedEvents(1, listener2);
@@ -238,13 +238,13 @@ public class EventManagerTest extends Te
 
     public void testSuccessfulNotificationIndividualSender() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        _eventManager.postEvent(new CayenneEvent(this), subject);
+        eventManager.postEvent(new CayenneEvent(this), subject);
 
         assertReceivedEvents(1, this);
         assertReceivedEventsForClass(1);
@@ -252,14 +252,14 @@ public class EventManagerTest extends Te
 
     public void testSuccessfulNotificationIndividualSenderTwice() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
-        _eventManager.addListener(
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        _eventManager.postEvent(new CayenneEvent(this), subject);
+        eventManager.postEvent(new CayenneEvent(this), subject);
 
         assertReceivedEvents(2, this);
         assertReceivedEventsForClass(2);
@@ -267,23 +267,23 @@ public class EventManagerTest extends Te
 
     public void testSuccessfulNotificationBothDefaultAndIndividualSender()
             throws Exception {
-        EventManagerTest listener1 = this;
-        EventManagerTest listener2 = new EventManagerTest();
+        DefaultEventManagerTest listener1 = this;
+        DefaultEventManagerTest listener2 = new DefaultEventManagerTest();
 
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 listener1,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 listener1);
-        _eventManager.addListener(
+        eventManager.addListener(
                 listener2,
                 "seeNotification",
                 CayenneEvent.class,
                 subject);
 
-        _eventManager.postEvent(new CayenneEvent(this), subject);
+        eventManager.postEvent(new CayenneEvent(this), subject);
 
         assertReceivedEvents(1, listener1);
         assertReceivedEvents(1, listener2);
@@ -292,116 +292,116 @@ public class EventManagerTest extends Te
 
     public void testRemoveOnEmptyList() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        Assert.assertFalse(_eventManager.removeListener(this, subject));
+        Assert.assertFalse(eventManager.removeListener(this, subject));
     }
 
     public void testRemoveOnNullSubject() {
-        Assert.assertFalse(_eventManager.removeListener(this, null));
+        Assert.assertFalse(eventManager.removeListener(this, null));
     }
 
     public void testRemoveFromDefaultQueue() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
-        Assert.assertTrue(_eventManager.removeListener(this, subject));
-        Assert.assertFalse(_eventManager.removeListener(this));
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
+        Assert.assertTrue(eventManager.removeListener(this, subject));
+        Assert.assertFalse(eventManager.removeListener(this));
     }
 
     public void testRemoveSpecificQueue() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(_eventManager.removeListener(this, subject));
-        Assert.assertFalse(_eventManager.removeListener(this));
+        Assert.assertTrue(eventManager.removeListener(this, subject));
+        Assert.assertFalse(eventManager.removeListener(this));
     }
 
     public void testRemoveSpecificSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(_eventManager.removeListener(this, subject, this));
-        Assert.assertFalse(_eventManager.removeListener(this));
+        Assert.assertTrue(eventManager.removeListener(this, subject, this));
+        Assert.assertFalse(eventManager.removeListener(this));
     }
 
     public void testRemoveNullSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(_eventManager.removeListener(this, subject, null));
-        Assert.assertFalse(_eventManager.removeListener(this));
+        Assert.assertTrue(eventManager.removeListener(this, subject, null));
+        Assert.assertFalse(eventManager.removeListener(this));
     }
 
     public void testRemoveNonexistingSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertFalse(_eventManager.removeListener(this, subject, "foo"));
-        Assert.assertTrue(_eventManager.removeListener(this));
+        Assert.assertFalse(eventManager.removeListener(this, subject, "foo"));
+        Assert.assertTrue(eventManager.removeListener(this));
     }
 
     public void testRemoveAll() {
         EventSubject subject1 = EventSubject.getSubject(this.getClass(), "XXX1");
         EventSubject subject2 = EventSubject.getSubject(this.getClass(), "XXX2");
         EventSubject subject3 = EventSubject.getSubject(this.getClass(), "XXX3");
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject1);
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject2);
-        _eventManager.addListener(
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject1);
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject2);
+        eventManager.addListener(
                 this,
                 "seeNotification",
                 CayenneEvent.class,
                 subject3,
                 this);
 
-        Assert.assertTrue(_eventManager.removeListener(this));
-        Assert.assertFalse(_eventManager.removeListener(this));
-        Assert.assertFalse(_eventManager.removeListener(this, subject1));
-        Assert.assertFalse(_eventManager.removeListener(this, subject2));
-        Assert.assertFalse(_eventManager.removeListener(this, subject3));
+        Assert.assertTrue(eventManager.removeListener(this));
+        Assert.assertFalse(eventManager.removeListener(this));
+        Assert.assertFalse(eventManager.removeListener(this, subject1));
+        Assert.assertFalse(eventManager.removeListener(this, subject2));
+        Assert.assertFalse(eventManager.removeListener(this, subject3));
     }
 
     public void testSubjectGarbageCollection() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        _eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
+        eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
 
         // let go of the subject & (hopefully) release queue
         subject = null;
         System.gc();
         System.gc();
 
-        Assert.assertFalse(_eventManager.removeListener(this));
+        Assert.assertFalse(eventManager.removeListener(this));
     }
 
     // notification method
     public void seeNotification(CayenneEvent event) {
-        _numberOfReceivedEvents++;
-        _numberOfReceivedEventsForClass++;
+        numberOfReceivedEvents++;
+        numberOfReceivedEventsForClass++;
     }
 
     // allows just enough time for the event threads to run
     private static void assertReceivedEvents(
             final int expected,
-            final EventManagerTest listener) throws Exception {
+            final DefaultEventManagerTest listener) throws Exception {
 
         ThreadedTestHelper helper = new ThreadedTestHelper() {
 
             @Override
             protected void assertResult() throws Exception {
-                assertEquals(expected, listener._numberOfReceivedEvents);
+                assertEquals(expected, listener.numberOfReceivedEvents);
             }
         };
         helper.assertWithTimeout(5000);
@@ -413,7 +413,7 @@ public class EventManagerTest extends Te
 
             @Override
             protected void assertResult() throws Exception {
-                assertEquals(expected, _numberOfReceivedEventsForClass);
+                assertEquals(expected, numberOfReceivedEventsForClass);
             }
         };
         helper.assertWithTimeout(5000);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventBridgeTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventBridgeTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/EventBridgeTest.java Sun Apr 11 21:33:00 2010
@@ -31,7 +31,8 @@ import org.apache.cayenne.unit.util.Thre
 public class EventBridgeTest extends TestCase {
 
     public void testConstructor() throws Exception {
-        EventSubject local = EventSubject.getSubject(EventBridgeTest.class, "testInstall");
+        EventSubject local = EventSubject
+                .getSubject(EventBridgeTest.class, "testInstall");
         String external = "externalSubject";
         TestBridge bridge = new TestBridge(local, external);
 
@@ -42,11 +43,12 @@ public class EventBridgeTest extends Tes
     }
 
     public void testStartup() throws Exception {
-        EventSubject local = EventSubject.getSubject(EventBridgeTest.class, "testInstall");
+        EventSubject local = EventSubject
+                .getSubject(EventBridgeTest.class, "testInstall");
         String external = "externalSubject";
         TestBridge bridge = new TestBridge(local, external);
 
-        EventManager manager = new EventManager();
+        EventManager manager = new DefaultEventManager();
         bridge.startup(manager, EventBridge.RECEIVE_LOCAL_EXTERNAL);
 
         assertSame(manager, bridge.eventManager);
@@ -54,7 +56,7 @@ public class EventBridgeTest extends Tes
         assertEquals(0, bridge.shutdownCalls);
 
         // try startup again
-        EventManager newManager = new EventManager();
+        EventManager newManager = new DefaultEventManager();
         bridge.startup(newManager, EventBridge.RECEIVE_LOCAL_EXTERNAL);
 
         assertSame(newManager, bridge.eventManager);
@@ -63,11 +65,12 @@ public class EventBridgeTest extends Tes
     }
 
     public void testShutdown() throws Exception {
-        EventSubject local = EventSubject.getSubject(EventBridgeTest.class, "testInstall");
+        EventSubject local = EventSubject
+                .getSubject(EventBridgeTest.class, "testInstall");
         String external = "externalSubject";
         TestBridge bridge = new TestBridge(local, external);
 
-        EventManager manager = new EventManager();
+        EventManager manager = new DefaultEventManager();
         bridge.startup(manager, EventBridge.RECEIVE_LOCAL_EXTERNAL);
         bridge.shutdown();
 
@@ -84,7 +87,7 @@ public class EventBridgeTest extends Tes
         String external = "externalSubject";
         final TestBridge bridge = new TestBridge(local, external);
 
-        EventManager manager = new EventManager(2);
+        EventManager manager = new DefaultEventManager(2);
         bridge.startup(manager, EventBridge.RECEIVE_LOCAL_EXTERNAL);
 
         final SnapshotEvent eventWithNoSubject = new SnapshotEvent(

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/MockEventManager.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/MockEventManager.java?rev=932996&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/MockEventManager.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/event/MockEventManager.java Sun Apr 11 21:33:00 2010
@@ -0,0 +1,92 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.event;
+
+import java.util.EventObject;
+import java.util.List;
+
+import org.apache.cayenne.event.DefaultEventManager.Dispatch;
+
+
+public class MockEventManager implements EventManager {
+
+    public void addListener(
+            Object listener,
+            String methodName,
+            Class<?> eventParameterClass,
+            EventSubject subject) {
+    }
+
+    public void addListener(
+            Object listener,
+            String methodName,
+            Class<?> eventParameterClass,
+            EventSubject subject,
+            Object sender) {
+    }
+
+    public void addNonBlockingListener(
+            Object listener,
+            String methodName,
+            Class<?> eventParameterClass,
+            EventSubject subject) {
+    }
+
+    public void addNonBlockingListener(
+            Object listener,
+            String methodName,
+            Class<?> eventParameterClass,
+            EventSubject subject,
+            Object sender) {
+    }
+
+    public List<Dispatch> getEventQueue() {
+        return null;
+    }
+
+    public boolean isSingleThreaded() {
+        return false;
+    }
+
+    public void postEvent(EventObject event, EventSubject subject) {
+    }
+
+    public void postNonBlockingEvent(EventObject event, EventSubject subject) {
+    }
+
+    public boolean removeAllListeners(EventSubject subject) {
+        return false;
+    }
+
+    public boolean removeListener(Object listener) {
+        return false;
+    }
+
+    public boolean removeListener(Object listener, EventSubject subject) {
+        return false;
+    }
+
+    public boolean removeListener(Object listener, EventSubject subject, Object sender) {
+        return false;
+    }
+
+    public void shutdown() {
+    }
+
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelTest.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelTest.java Sun Apr 11 21:33:00 2010
@@ -32,13 +32,12 @@ import org.apache.cayenne.PersistenceSta
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.QueryResponse;
 import org.apache.cayenne.event.CayenneEvent;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventBridge;
-import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.remote.ClientChannel;
 import org.apache.cayenne.unit.CayenneCase;
 import org.apache.cayenne.util.GenericResponse;
 
@@ -186,7 +185,7 @@ public class ClientChannelTest extends C
         }
 
         try {
-            new ClientChannel(connection, false, new EventManager(2), false);
+            new ClientChannel(connection, false, new DefaultEventManager(2), false);
             fail("Channel didn't throw on broken EventBridge");
         }
         catch (CayenneRuntimeException e) {
@@ -194,7 +193,7 @@ public class ClientChannelTest extends C
         }
 
         try {
-            new ClientChannel(connection, false, new EventManager(2), true);
+            new ClientChannel(connection, false, new DefaultEventManager(2), true);
         }
         catch (CayenneRuntimeException e) {
             fail("Channel threw on broken EventBridge");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/SimpleAccessStack.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/SimpleAccessStack.java?rev=932996&r1=932995&r2=932996&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/SimpleAccessStack.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/SimpleAccessStack.java Sun Apr 11 21:33:00 2010
@@ -26,14 +26,13 @@ import org.apache.cayenne.access.DataDom
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.UnitTestDomain;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
-import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Procedure;
 import org.apache.cayenne.query.Query;
 
 /**
  * Default implementation of the AccessStack that has a single DataNode per DataMap.
- * 
  */
 public class SimpleAccessStack extends AbstractAccessStack implements AccessStack {
 
@@ -46,7 +45,7 @@ public class SimpleAccessStack extends A
         this.dataSetFactory = dataSetFactory;
         this.resources = resources;
         this.domain = new UnitTestDomain("domain");
-        domain.setEventManager(new EventManager(2));
+        domain.setEventManager(new DefaultEventManager(2));
         for (DataMap map : maps) {
             initNode(map);
         }



Mime
View raw message