bloritsch 2002/10/02 08:39:29
Modified: event build.xml default.properties
event/src/java/org/apache/excalibur/event/command
CommandManager.java
event/src/java/org/apache/excalibur/event/impl
DefaultQueue.java
event/src/java/org/apache/excalibur/mpool
BlockingFixedSizePool.java DefaultPoolManager.java
FixedSizePool.java VariableSizePool.java
Added: event/lib commons-collections-20021002.jar
Log:
make Event dependent on a snapshot of Commons Collections
Revision Changes Path
1.38 +1 -2 jakarta-avalon-excalibur/event/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/event/build.xml,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- build.xml 1 Oct 2002 21:44:32 -0000 1.37
+++ build.xml 2 Oct 2002 15:39:28 -0000 1.38
@@ -11,8 +11,8 @@
<!-- Classpath for product -->
<path id="project.class.path">
+ <pathelement location="${commons-collections.jar}"/>
<pathelement location="${build.classes}"/>
- <pathelement location="${excalibur-collections.jar}"/>
<pathelement location="${excalibur-concurrent.jar}"/>
<pathelement location="${excalibur-thread.jar}"/>
<pathelement location="${excalibur-scratchpad.jar}"/>
@@ -44,7 +44,6 @@
<target name="dependencies" description="Check dependencies"
unless="skip.dependencies">
<ant antfile="${depchecker.prefix}/depchecker.xml" target="checkCommon"/>
- <ant antfile="${depchecker.prefix}/depchecker.xml"
target="checkCollections"/>
<ant antfile="${depchecker.prefix}/depchecker.xml"
target="checkConcurrent"/>
<ant antfile="${depchecker.prefix}/depchecker.xml" target="checkFramework"/>
<ant antfile="${depchecker.prefix}/depchecker.xml" target="checkThread"/>
1.22 +2 -4 jakarta-avalon-excalibur/event/default.properties
Index: default.properties
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/event/default.properties,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- default.properties 1 Oct 2002 21:27:43 -0000 1.21
+++ default.properties 2 Oct 2002 15:39:28 -0000 1.22
@@ -21,10 +21,8 @@
excalibur-thread.lib=${excalibur-thread.home}
excalibur-thread.jar=${excalibur-thread.lib}/excalibur-thread-1.0.jar
-# ----- Excalibur Collections, version 1.0 or later -----
-excalibur-collections.home=${basedir}/../collections/dist
-excalibur-collections.lib=${excalibur-collections.home}
-excalibur-collections.jar=${excalibur-collections.lib}/excalibur-collections-1.0.jar
+# ----- Commons Collections, version 1.0 or later -----
+commons-collections.jar=lib/commons-collections-20021002.jar
# ----- Excalibur Concurrent, version 1.0 or later -----
excalibur-concurrent.home=${basedir}/../concurrent/dist
1.1
jakarta-avalon-excalibur/event/lib/commons-collections-20021002.jar
<<Binary file>>
1.20 +3 -3
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/CommandManager.java
Index: CommandManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/CommandManager.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- CommandManager.java 2 Oct 2002 01:46:57 -0000 1.19
+++ CommandManager.java 2 Oct 2002 15:39:28 -0000 1.20
@@ -54,8 +54,8 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import org.apache.avalon.excalibur.collections.Buffer;
-import org.apache.avalon.excalibur.collections.VariableSizeBuffer;
+import org.apache.commons.collections.Buffer;
+import org.apache.commons.collections.UnboundedFifoBuffer;
import org.apache.avalon.excalibur.concurrent.Mutex;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.excalibur.event.EventHandler;
@@ -240,7 +240,7 @@
private static final class CommandEventHandler implements EventHandler
{
private final Map m_signalHandlers;
- private final Buffer m_delayedCommands = new VariableSizeBuffer();
+ private final Buffer m_delayedCommands = new UnboundedFifoBuffer();
protected CommandEventHandler( Map signalHandlers )
{
1.4 +4 -4
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/impl/DefaultQueue.java
Index: DefaultQueue.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/impl/DefaultQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultQueue.java 2 Oct 2002 01:46:58 -0000 1.3
+++ DefaultQueue.java 2 Oct 2002 15:39:29 -0000 1.4
@@ -49,8 +49,8 @@
*/
package org.apache.excalibur.event.impl;
-import org.apache.avalon.excalibur.collections.Buffer;
-import org.apache.avalon.excalibur.collections.VariableSizeBuffer;
+import org.apache.commons.collections.Buffer;
+import org.apache.commons.collections.UnboundedFifoBuffer;
import org.apache.avalon.excalibur.concurrent.Mutex;
import org.apache.excalibur.event.PreparedEnqueue;
import org.apache.excalibur.event.SinkException;
@@ -85,12 +85,12 @@
if( size > 0 )
{
- m_elements = new VariableSizeBuffer( size );
+ m_elements = new UnboundedFifoBuffer( size );
maxSize = size;
}
else
{
- m_elements = new VariableSizeBuffer();
+ m_elements = new UnboundedFifoBuffer();
maxSize = -1;
}
1.7 +5 -5
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/BlockingFixedSizePool.java
Index: BlockingFixedSizePool.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/BlockingFixedSizePool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- BlockingFixedSizePool.java 2 Oct 2002 01:46:58 -0000 1.6
+++ BlockingFixedSizePool.java 2 Oct 2002 15:39:29 -0000 1.7
@@ -49,9 +49,9 @@
*/
package org.apache.excalibur.mpool;
-import org.apache.avalon.excalibur.collections.Buffer;
-import org.apache.avalon.excalibur.collections.BufferUnderflowException;
-import org.apache.avalon.excalibur.collections.FixedSizeBuffer;
+import org.apache.commons.collections.BufferUnderflowException;
+import org.apache.commons.collections.BoundedFifoBuffer;
+import org.apache.commons.collections.Buffer;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
@@ -85,7 +85,7 @@
throws Exception
{
m_timeout = ( timeout < 1 ) ? 0 : timeout;
- m_buffer = new FixedSizeBuffer( size );
+ m_buffer = new BoundedFifoBuffer( size );
m_maxSize = size;
m_factory = factory;
}
1.4 +8 -6
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/DefaultPoolManager.java
Index: DefaultPoolManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/DefaultPoolManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultPoolManager.java 27 Sep 2002 19:45:42 -0000 1.3
+++ DefaultPoolManager.java 2 Oct 2002 15:39:29 -0000 1.4
@@ -51,7 +51,9 @@
import java.util.Iterator;
import java.util.Random;
-import org.apache.avalon.excalibur.collections.BucketMap;
+import java.util.Map;
+
+import org.apache.commons.collections.StaticBucketMap;
import org.apache.excalibur.event.Sink;
import org.apache.excalibur.event.command.RepeatedCommand;
@@ -68,8 +70,8 @@
{
private final long m_managerKey;
private final Random m_keyGenerator;
- private final BucketMap m_keyMap = new BucketMap();
- private final BucketMap m_factoryMap = new BucketMap();
+ private final Map m_keyMap = new StaticBucketMap();
+ private final Map m_factoryMap = new StaticBucketMap();
public DefaultPoolManager()
{
@@ -123,12 +125,12 @@
private static final class PoolManagerCommand implements RepeatedCommand
{
- private final BucketMap m_map;
+ private final Map m_map;
private final int m_min = 4;
private final int m_max = 256;
private final int m_grow = 4;
- protected PoolManagerCommand( BucketMap map )
+ protected PoolManagerCommand( Map map )
{
m_map = map;
}
1.9 +4 -5
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/FixedSizePool.java
Index: FixedSizePool.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/FixedSizePool.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FixedSizePool.java 28 Sep 2002 09:42:48 -0000 1.8
+++ FixedSizePool.java 2 Oct 2002 15:39:29 -0000 1.9
@@ -49,9 +49,8 @@
*/
package org.apache.excalibur.mpool;
-import org.apache.avalon.excalibur.collections.Buffer;
-import org.apache.avalon.excalibur.collections.FixedSizeBuffer;
-import org.apache.avalon.excalibur.concurrent.Mutex;
+import org.apache.commons.collections.Buffer;
+import org.apache.commons.collections.BoundedFifoBuffer;
import org.apache.avalon.framework.activity.Disposable;
/**
@@ -72,7 +71,7 @@
public FixedSizePool( ObjectFactory factory, int size )
throws Exception
{
- m_buffer = new FixedSizeBuffer( size );
+ m_buffer = new BoundedFifoBuffer( size );
m_factory = factory;
for( int i = 0; i < size; i++ )
1.8 +4 -4
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/VariableSizePool.java
Index: VariableSizePool.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/VariableSizePool.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- VariableSizePool.java 2 Oct 2002 01:46:58 -0000 1.7
+++ VariableSizePool.java 2 Oct 2002 15:39:29 -0000 1.8
@@ -49,8 +49,8 @@
*/
package org.apache.excalibur.mpool;
-import org.apache.avalon.excalibur.collections.Buffer;
-import org.apache.avalon.excalibur.collections.VariableSizeBuffer;
+import org.apache.commons.collections.Buffer;
+import org.apache.commons.collections.UnboundedFifoBuffer;
import org.apache.avalon.framework.activity.Disposable;
/**
@@ -84,7 +84,7 @@
public VariableSizePool( ObjectFactory factory, int size, long key )
throws Exception
{
- m_buffer = new VariableSizeBuffer( size );
+ m_buffer = new UnboundedFifoBuffer( size );
m_factory = factory;
m_key = key;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>