summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-12-17 04:00:55 (EST)
committerEike Stepper2006-12-17 04:00:55 (EST)
commitb09c1d9d15f34a6951514ead4744207316281174 (patch)
tree2af0d629833ff024ee093503a46caf67d0ccc423
parentfb48550aacf08f7a327a0699ce35ac64a38c1f0c (diff)
downloadcdo-b09c1d9d15f34a6951514ead4744207316281174.zip
cdo-b09c1d9d15f34a6951514ead4744207316281174.tar.gz
cdo-b09c1d9d15f34a6951514ead4744207316281174.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java6
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java30
3 files changed, 17 insertions, 20 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
index c6b919a..1bc496c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
@@ -115,7 +115,8 @@ public class SignalTest extends AbstractOMTest
{
ExecutorService threadPool = Executors.newCachedThreadPool();
IRegistry<String, ProtocolFactory> registry = new HashMapRegistry();
- registry.register(new TestSignalProtocol.Factory());
+ TestSignalProtocol.Factory factory = new TestSignalProtocol.Factory();
+ registry.put(factory.getID(), factory);
acceptor.setReceiveExecutor(threadPool);
acceptor.setProtocolFactoryRegistry(registry);
@@ -136,7 +137,8 @@ public class SignalTest extends AbstractOMTest
{
ExecutorService threadPool = Executors.newCachedThreadPool();
IRegistry<String, ProtocolFactory> registry = new HashMapRegistry();
- registry.register(new TestSignalProtocol.Factory());
+ TestSignalProtocol.Factory factory = new TestSignalProtocol.Factory();
+ registry.put(factory.getID(), factory);
acceptor.setReceiveExecutor(threadPool);
acceptor.setProtocolFactoryRegistry(registry);
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index c31d411..dea782a 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -28,6 +28,7 @@ Export-Package: org.eclipse.internal.net4j.transport;version="0.8.0",
org.eclipse.net4j.util.om.log;version="0.8.0",
org.eclipse.net4j.util.om.trace;version="0.8.0",
org.eclipse.net4j.util.registry;version="0.8.0",
+ org.eclipse.net4j.util.registry.delegating;version="0.8.0",
org.eclipse.net4j.util.stream;version="0.8.0"
Eclipse-LazyStart: true
Require-Bundle: org.eclipse.core.runtime;resolution:=optional
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java
index 93b8691..8b8c808 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java
@@ -108,11 +108,7 @@ public abstract class AbstractRegistry<K, V> implements IRegistry<K, V>
public synchronized V put(K key, V value)
{
V result = getTransaction().put(key, value);
- if (autoCommit)
- {
- commit();
- }
-
+ autoCommit();
return result;
}
@@ -132,10 +128,7 @@ public abstract class AbstractRegistry<K, V> implements IRegistry<K, V>
transaction.put(e.getKey(), e.getValue());
}
- if (autoCommit)
- {
- commit();
- }
+ autoCommit();
}
}
@@ -146,11 +139,7 @@ public abstract class AbstractRegistry<K, V> implements IRegistry<K, V>
public synchronized V remove(Object key)
{
V result = getTransaction().remove(key);
- if (autoCommit)
- {
- commit();
- }
-
+ autoCommit();
return result;
}
@@ -169,10 +158,7 @@ public abstract class AbstractRegistry<K, V> implements IRegistry<K, V>
transaction.remove(key);
}
- if (autoCommit)
- {
- commit();
- }
+ autoCommit();
}
}
@@ -284,6 +270,14 @@ public abstract class AbstractRegistry<K, V> implements IRegistry<K, V>
}
}
+ protected void autoCommit()
+ {
+ if (autoCommit)
+ {
+ commit();
+ }
+ }
+
protected abstract Map<K, V> getMap();
/**