[jconch commit] r115 - in trunk: . sandbox/jconch/pipeline sandbox/jconch/pipeline/impl

2 views
Skip to first unread message

codesite...@google.com

unread,
Mar 18, 2008, 3:23:09 PM3/18/08
to jco...@googlegroups.com
Author: robert....@SmokejumperIT.com
Date: Sat Mar 15 17:15:47 2008
New Revision: 115

Added:
trunk/sandbox/jconch/pipeline/Consumer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/Consumer.java
trunk/sandbox/jconch/pipeline/PipeElement.java
- copied, changed from r103, /trunk/src/jconch/pipeline/PipeElement.java
trunk/sandbox/jconch/pipeline/PipeLink.java
- copied, changed from r103, /trunk/src/jconch/pipeline/PipeLink.java
trunk/sandbox/jconch/pipeline/PipeStage.java
- copied, changed from r103, /trunk/src/jconch/pipeline/PipeStage.java
trunk/sandbox/jconch/pipeline/Processor.java
- copied, changed from r103, /trunk/src/jconch/pipeline/Processor.java
trunk/sandbox/jconch/pipeline/Producer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/Producer.java
trunk/sandbox/jconch/pipeline/ThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/ThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/BoundedPipeLink.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/BoundedPipeLink.java
trunk/sandbox/jconch/pipeline/impl/ClosureConsumer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/ClosureConsumer.java
trunk/sandbox/jconch/pipeline/impl/CollectionConsumer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/CollectionConsumer.java
trunk/sandbox/jconch/pipeline/impl/CollectionProducer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/CollectionProducer.java
trunk/sandbox/jconch/pipeline/impl/ExceptionThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/ExceptionThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/ExecutorThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/ExecutorThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/FactoryProducer.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/FactoryProducer.java
trunk/sandbox/jconch/pipeline/impl/InlineThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/InlineThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/SingleThreadThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/SingleThreadThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/SpawningThreadingModel.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/SpawningThreadingModel.java
trunk/sandbox/jconch/pipeline/impl/TransformerProcessor.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/TransformerProcessor.java
trunk/sandbox/jconch/pipeline/impl/TypeSafePipeLink.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/TypeSafePipeLink.java
trunk/sandbox/jconch/pipeline/impl/UnboundedPipeLink.java
- copied, changed from r103, /trunk/src/jconch/pipeline/impl/UnboundedPipeLink.java
Modified:
trunk/jconch.iws

Log:
Updated to using a sandbox for the pipeline stuff (and other experiments)

Modified: trunk/jconch.iws
==============================================================================
--- trunk/jconch.iws (original)
+++ trunk/jconch.iws Sat Mar 15 17:15:47 2008
@@ -16,35 +16,27 @@
</component>
<component name="ChangeListManager">
<list default="true" name="Default" comment="">
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline" afterPath="" />
- <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Java.iml"
afterPath="$PROJECT_DIR$/Java.iml" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/PipeLink.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/TransformerProcessor.java"
afterPath="" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/BoundedPipeLink.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/FactoryProducer.java" />
<change type="MODIFICATION"
beforePath="$PROJECT_DIR$/jconch.iws"
afterPath="$PROJECT_DIR$/jconch.iws" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/ExceptionThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/UnboundedPipeLink.java"
afterPath="" />
- <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/InlineThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/Processor.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/CollectionProducer.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/SingleThreadThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/FactoryProducer.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/ExecutorThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/PipeElement.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/BoundedPipeLink.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/TypeSafePipeLink.java"
afterPath="" />
- <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/ThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/test/jconch/cache/CacheMapTest.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/Producer.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/Consumer.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl" afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/CollectionConsumer.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/SpawningThreadingModel.java"
afterPath="" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/impl/ClosureConsumer.java"
afterPath="" />
- <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox" />
- <change type="DELETED"
beforePath="$PROJECT_DIR$/src/jconch/pipeline/PipeStage.java"
afterPath="" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionProducer.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/Producer.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/TypeSafePipeLink.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/PipeElement.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/ExecutorThreadingModel.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/Consumer.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/ExceptionThreadingModel.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/SpawningThreadingModel.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionConsumer.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/PipeLink.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/UnboundedPipeLink.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/InlineThreadingModel.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/ClosureConsumer.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/TransformerProcessor.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/ThreadingModel.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/PipeStage.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/Processor.java" />
+ <change type="NEW" beforePath=""
afterPath="$PROJECT_DIR$/sandbox/jconch/pipeline/impl/SingleThreadThreadingModel.java" />
</list>
<ignored path="jconch.iws" />
<ignored path=".idea/workspace.xml" />
@@ -107,99 +99,91 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="GroovyCacheMapUsage.groovy" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/GroovyCacheMapUsage.groovy">
+ <file leaf-file-name="ObjectCacheMapTest.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/jconch/cache/ObjectCacheMapTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="0" selection-start="133"
selection-end="133" vertical-scroll-proportion="0.10271041">
+ <state line="89" column="30" selection-start="2980"
selection-end="2980" vertical-scroll-proportion="0.34950072">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="ObjectCacheMapTest.java" pinned="false"
current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/test/jconch/cache/ObjectCacheMapTest.java">
+ <file leaf-file-name="Consumer.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Consumer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="89" column="30" selection-start="2980"
selection-end="2980" vertical-scroll-proportion="0.3837375">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
+ <state line="11" column="0" selection-start="256"
selection-end="256" vertical-scroll-proportion="0.15406562">
+ <folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="ObjectCacheMap.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/cache/ObjectCacheMap.java">
+ <file leaf-file-name="CollectionConsumer.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionConsumer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="43" selection-start="462"
selection-end="473" vertical-scroll-proportion="0.17118402">
+ <state line="52" column="25" selection-start="1545"
selection-end="1545" vertical-scroll-proportion="0.7703281">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="DuoKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/DuoKey.java">
+ <file leaf-file-name="CollectionProducer.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionProducer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="49" selection-start="569"
selection-end="569" vertical-scroll-proportion="0.42796007">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="69" column="25" selection-start="1794"
selection-end="1794" vertical-scroll-proportion="0.8116976">
+ <folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="TriKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/TriKey.java">
+ <file leaf-file-name="Processor.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Processor.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="13" selection-start="189"
selection-end="189" vertical-scroll-proportion="0.11982881">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="34" column="14" selection-start="820"
selection-end="820" vertical-scroll-proportion="0.2125535">
+ <folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="SimpleTriKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleTriKey.java">
+ <file leaf-file-name="TransformerProcessor.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/TransformerProcessor.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="4" selection-start="202"
selection-end="202" vertical-scroll-proportion="0.10271041">
+ <state line="30" column="8" selection-start="1044"
selection-end="1044" vertical-scroll-proportion="0.44507846">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="SimpleQuadKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleQuadKey.java">
+ <file leaf-file-name="PipeStage.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/PipeStage.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="4" selection-start="211"
selection-end="211" vertical-scroll-proportion="0.10271041">
+ <state line="41" column="46" selection-start="1122"
selection-end="1122" vertical-scroll-proportion="0.2125535">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="QuadKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/QuadKey.java">
+ <file leaf-file-name="FactoryProducer.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/FactoryProducer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="18" column="73" selection-start="564"
selection-end="564" vertical-scroll-proportion="0.29101285">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="50" column="12" selection-start="1470"
selection-end="1470" vertical-scroll-proportion="0.5206847">
+ <folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="JConchMultiKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/JConchMultiKey.java">
+ <file leaf-file-name="Producer.java" pinned="false"
current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Producer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="59" column="100" selection-start="1686"
selection-end="1686" vertical-scroll-proportion="0.8469388">
+ <state line="141" column="12" selection-start="4313"
selection-end="4313" vertical-scroll-proportion="0.65763193">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="SimpleDuoKey.java" pinned="false"
current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleDuoKey.java">
+ <file leaf-file-name="PipeLink.java" pinned="false"
current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/PipeLink.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="5" selection-start="320"
selection-end="320" vertical-scroll-proportion="0.17118402">
+ <state line="218" column="16" selection-start="7194"
selection-end="7194" vertical-scroll-proportion="0.2125535">
<folding />
</state>
</provider>
@@ -576,12 +560,12 @@
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1440" height="874" extended-state="0" />
- <editor active="false" />
+ <editor active="true" />
<layout>
<window_info id="UI Designer" active="false" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.33" order="0" />
<window_info id="IDEtalk" active="false" anchor="right"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.33" order="0" />
<window_info id="TODO" active="false" anchor="bottom"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.33" order="7" />
- <window_info id="Project" active="true" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true"
weight="0.25" order="1" />
+ <window_info id="Project" active="false" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true"
weight="0.25" order="1" />
<window_info id="Find" active="false" anchor="bottom"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.3288948" order="1" />
<window_info id="Structure" active="false" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.25" order="2" />
<window_info id="Messages" active="false" anchor="bottom"
auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false"
weight="0.3262317" order="8" />
@@ -613,7 +597,7 @@
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="Updated to the
ObjectCacheMap, since that's what the unit tests are actually talking
about." />
+ <option name="LAST_COMMIT_MESSAGE" value="Updated to using a
sandbox for the pipeline stuff (and other experiments)" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
@@ -631,6 +615,7 @@
<MESSAGE value="Put in an example of using a typed multikey." />
<MESSAGE value="Updated various examples." />
<MESSAGE value="Updated to the ObjectCacheMap, since that's what
the unit tests are actually talking about." />
+ <MESSAGE value="Updated to using a sandbox for the pipeline stuff
(and other experiments)" />
</component>
<component name="VssConfiguration">
<option name="CLIENT_PATH" value="" />
@@ -679,123 +664,117 @@
</buildFile>
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/build.xml">
+ <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleTriKey.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="96" column="17" selection-start="3092"
selection-end="3092" vertical-scroll-proportion="0.5833333">
+ <state line="6" column="4" selection-start="202"
selection-end="202" vertical-scroll-proportion="0.16035634">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/NeedsADatabaseEntityLookup.java">
+ <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleQuadKey.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="42" column="13" selection-start="1159"
selection-end="1159" vertical-scroll-proportion="0.9464286">
+ <state line="6" column="4" selection-start="211"
selection-end="211" vertical-scroll-proportion="0.16035634">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/NeedsADnsLookup.java">
+ <entry file="file://$PROJECT_DIR$/src/jconch/multikey/QuadKey.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="18" column="8" selection-start="628"
selection-end="628" vertical-scroll-proportion="0.375">
- <folding />
+ <state line="18" column="73" selection-start="564"
selection-end="564" vertical-scroll-proportion="0.454343">
+ <folding>
+ <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
+ </folding>
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/UniKey.java">
+ <entry file="file://$PROJECT_DIR$/src/jconch/multikey/JConchMultiKey.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="7" column="0" selection-start="109"
selection-end="109" vertical-scroll-proportion="0.10271041">
+ <state line="59" column="100" selection-start="1686"
selection-end="1686" vertical-scroll-proportion="1.3387097">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/NeedsToDoValidation.java">
+ <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleDuoKey.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="7" column="13" selection-start="154"
selection-end="154" vertical-scroll-proportion="0.06847361">
+ <state line="10" column="5" selection-start="320"
selection-end="320" vertical-scroll-proportion="0.26726058">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/UsingTypedMultiKey.java">
+ <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/GroovyCacheMapUsage.groovy">
<provider selected="true" editor-type-id="text-editor">
- <state line="44" column="22" selection-start="1592"
selection-end="1592" vertical-scroll-proportion="0.7189729">
+ <state line="6" column="0" selection-start="133"
selection-end="133" vertical-scroll-proportion="0.10271041">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/DuoKey.java">
+ <entry file="file://$PROJECT_DIR$/test/jconch/cache/ObjectCacheMapTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="49" selection-start="569"
selection-end="569" vertical-scroll-proportion="0.42796007">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="89" column="30" selection-start="2980"
selection-end="2980" vertical-scroll-proportion="0.34950072">
+ <folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/TriKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Consumer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="13" selection-start="189"
selection-end="189" vertical-scroll-proportion="0.11982881">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="11" column="0" selection-start="256"
selection-end="256" vertical-scroll-proportion="0.15406562">
+ <folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleTriKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionConsumer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="4" selection-start="202"
selection-end="202" vertical-scroll-proportion="0.10271041">
+ <state line="52" column="25" selection-start="1545"
selection-end="1545" vertical-scroll-proportion="0.7703281">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleQuadKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/CollectionProducer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="4" selection-start="211"
selection-end="211" vertical-scroll-proportion="0.10271041">
+ <state line="69" column="25" selection-start="1794"
selection-end="1794" vertical-scroll-proportion="0.8116976">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/QuadKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Processor.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="18" column="73" selection-start="564"
selection-end="564" vertical-scroll-proportion="0.29101285">
- <folding>
- <marker date="1205533504000" expanded="true"
signature="33:73" placeholder="..." />
- </folding>
+ <state line="34" column="14" selection-start="820"
selection-end="820" vertical-scroll-proportion="0.2125535">
+ <folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/JConchMultiKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/TransformerProcessor.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="59" column="100" selection-start="1686"
selection-end="1686" vertical-scroll-proportion="0.8469388">
+ <state line="30" column="8" selection-start="1044"
selection-end="1044" vertical-scroll-proportion="0.44507846">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/multikey/SimpleDuoKey.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/PipeStage.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="5" selection-start="320"
selection-end="320" vertical-scroll-proportion="0.17118402">
+ <state line="41" column="46" selection-start="1122"
selection-end="1122" vertical-scroll-proportion="0.2125535">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/eg/eg/jconch/cachemap/GroovyCacheMapUsage.groovy">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/impl/FactoryProducer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="0" selection-start="133"
selection-end="133" vertical-scroll-proportion="0.10271041">
+ <state line="50" column="12" selection-start="1470"
selection-end="1470" vertical-scroll-proportion="0.5206847">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/jconch/cache/ObjectCacheMap.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/Producer.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="43" selection-start="462"
selection-end="473" vertical-scroll-proportion="0.17118402">
+ <state line="141" column="12" selection-start="4313"
selection-end="4313" vertical-scroll-proportion="0.65763193">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/test/jconch/cache/ObjectCacheMapTest.java">
+ <entry file="file://$PROJECT_DIR$/sandbox/jconch/pipeline/PipeLink.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="89" column="30" selection-start="2980"
selection-end="2980" vertical-scroll-proportion="0.3837375">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
+ <state line="218" column="16" selection-start="7194"
selection-end="7194" vertical-scroll-proportion="0.2125535">
+ <folding />
</state>
</provider>
</entry>

Copied: trunk/sandbox/jconch/pipeline/Consumer.java (from r103, /trunk/src/jconch/pipeline/Consumer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/Consumer.java (original)
+++ trunk/sandbox/jconch/pipeline/Consumer.java Sat Mar 15 17:15:47 2008
@@ -1,15 +1,13 @@
package jconch.pipeline;

-import java.util.concurrent.atomic.AtomicBoolean;
-
import org.apache.commons.lang.NullArgumentException;

+import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* The base implementation of a pipe that consumes elements without producing
* anything.
- *
- * @param T
- * The type that is produced.
+ *
* @author Robert Fischer
*/
public abstract class Consumer<T> extends PipeStage {
@@ -31,13 +29,10 @@

/**
* Creates a new instance of <code>Consumer</code>.
- *
- * @param threading
- * The model for this consumer to use.
- * @param in
- * The link into this stage.
- * @throws NullArgumentException
- * If either argument is <code>null</code>
+ *
+ * @param threading The model for this consumer to use.
+ * @param in The link into this stage.
+ * @throws NullArgumentException If either argument is <code>null</code>
*/
protected Consumer(final ThreadingModel threading, final
PipeLink<T> in) {
super(threading);
@@ -52,9 +47,8 @@

/**
* Responsible for consuming items.
- *
- * @param item
- * The item to consume; never <code>null</code>
+ *
+ * @param item The item to consume; never <code>null</code>
*/
public abstract void consumeItem(final T item);

@@ -105,7 +99,7 @@

/**
* In addition to the super implementation, it checks for error conditions.
- *
+ * <p/>
* {@inheritDoc}
*/
@Override
@@ -115,7 +109,7 @@

/**
* Provides the pipe link that is being drawn from.
- *
+ *
* @return The inbound pipe link.
*/
public PipeLink<T> getLinkIn() {

Copied: trunk/sandbox/jconch/pipeline/PipeElement.java (from r103, /trunk/src/jconch/pipeline/PipeElement.java)
==============================================================================
--- /trunk/src/jconch/pipeline/PipeElement.java (original)
+++ trunk/sandbox/jconch/pipeline/PipeElement.java Sat Mar 15 17:15:47 2008
@@ -2,7 +2,7 @@

/**
* An element in a pipeline.
- *
+ *
* @author Robert
*/
public interface PipeElement {

Copied: trunk/sandbox/jconch/pipeline/PipeLink.java (from r103, /trunk/src/jconch/pipeline/PipeLink.java)
==============================================================================
--- /trunk/src/jconch/pipeline/PipeLink.java (original)
+++ trunk/sandbox/jconch/pipeline/PipeLink.java Sat Mar 15 17:15:47 2008
@@ -1,16 +1,17 @@
package jconch.pipeline;

-import static java.lang.Math.*;
+import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.lang.NullArgumentException;

-import java.util.*;
+import static java.lang.Math.max;
+import java.util.Collections;
+import java.util.Set;
+import java.util.WeakHashMap;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;

-import org.apache.commons.collections.set.MapBackedSet;
-import org.apache.commons.lang.NullArgumentException;
-
/**
* <p>
* A link in the stages of the pipeline. This class takes
responsibility for all
@@ -33,7 +34,7 @@
* source will place elements into the link, and a sink will draw
elements from
* it. These registries are used for tracking status.
* </p>
- *
+ *
* @author Robert Fischer
*/
public class PipeLink<T> implements PipeElement {
@@ -63,11 +64,9 @@

/**
* Constructor.
- *
- * @param queue
- * The queue to use.
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ *
+ * @param queue The queue to use.
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
protected PipeLink(final BlockingQueue<T> queue) {
if (queue == null) {
@@ -78,10 +77,9 @@

/**
* Registers a source for this pipe link.
- *
+ *
* @param source
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
public void registerSource(final Producer<T> source) {
if (source == null) {
@@ -111,12 +109,10 @@

/**
* Adds an element into the link, if at all possible.
- *
- * @param in
- * The element to add.
+ *
+ * @param in The element to add.
* @return <code>true</code> if the add succeeded
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
public boolean add(final T in) {
if (in == null) {
@@ -134,7 +130,7 @@

/**
* Gets the timeout on fetch operations of the instance.
- *
+ *
* @return the fetch timeout.
*/
public long getFetchTimeout() {
@@ -144,11 +140,9 @@
/**
* Sets the fetch timeout of the instance. Positive values represent
* milliseconds to wait, and 0 means to not wait at all.
- *
- * @param fetchTimeout
- * the fetch timeout to set
- * @throws IllegalArgumentException
- * If the argument is < 0.
+ *
+ * @param newFetchTimeout the fetch timeout to set
+ * @throws IllegalArgumentException If the argument is < 0.
*/
public void setFetchTimeout(final long newFetchTimeout) {
if (newFetchTimeout < 0) {
@@ -161,7 +155,7 @@
* Removes an element from the link, if any is available. This
method may
* block for up to {@link #getFetchTimeout()} milliseconds for a
value to
* become available.
- *
+ *
* @return The removed element, or <code>null</code> if the link
is empty.
*/
public T get() {
@@ -208,7 +202,7 @@

/**
* Gets the timeout on add operations of the instance.
- *
+ *
* @return the add timeout.
*/
public long getAddTimeout() {
@@ -218,11 +212,9 @@
/**
* Sets the add timeout of the instance. Positive values represent
* milliseconds to wait, and 0 means to not wait at all.
- *
- * @param fetchTimeout
- * the add timeout to set
- * @throws IllegalArgumentException
- * If the argument is < 0.
+ *
+ * @param timeout the add timeout to set
+ * @throws IllegalArgumentException If the argument is < 0.
*/
public void setAddTimeout(final long timeout) {
if (timeout < 0) {
@@ -233,7 +225,7 @@

/**
* Provides the number of elements currently in the queue.
- *
+ *
* @return The minimum of the number of queued elements and
* {@link Integer#MAX_VALUE}
*/
@@ -244,7 +236,7 @@
/**
* Provides an estimate of the number of elements the queue could
* additionally hold.
- *
+ *
* @return An estimate of the capcity of the queue, or
* {@link Integer#MAX_VALUE} if it is unbounded.
*/

Copied: trunk/sandbox/jconch/pipeline/PipeStage.java (from r103, /trunk/src/jconch/pipeline/PipeStage.java)
==============================================================================
--- /trunk/src/jconch/pipeline/PipeStage.java (original)
+++ trunk/sandbox/jconch/pipeline/PipeStage.java Sat Mar 15 17:15:47 2008
@@ -1,12 +1,12 @@
package jconch.pipeline;

-import java.util.concurrent.atomic.AtomicBoolean;
-
import org.apache.commons.lang.NullArgumentException;

+import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* The base interface for a stage in the pipeline.
- *
+ *
* @author Robert Fischer
*/
public abstract class PipeStage implements PipeElement {
@@ -20,11 +20,9 @@

/**
* Constructor.
- *
- * @param threading
- * The threading approach.
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ *
+ * @param threading The threading approach.
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
protected PipeStage(final ThreadingModel threading) {
if (threading == null) {
@@ -47,7 +45,7 @@

/**
* Whether this pipline stage has been started or not.
- *
+ *
* @return If we have already started this pipeline stage.
*/
public boolean isStarted() {
@@ -56,33 +54,30 @@

/**
* Executes one round of processing for this pipeline stage.
- *
- * @throws IllegalStateException
- * If there is nothing left to execute.
+ *
+ * @throws IllegalStateException If there is nothing left to execute.
*/
public abstract void execute();

/**
* If the pipeline is not supposed to handle any more elements, either
* because of an error or because a producer is exhausted.
- *
+ *
* @return If the pipeline is done producing/consuming elements.
*/
public abstract boolean isFinished();

/**
* Called when an exception occurs in execution.
- *
- * @param msg
- * The message describing the problem (may be <code>null</code>)
- * @param e
- * The exception which is the problem.
+ *
+ * @param msg The message describing the problem (may be <code>null</code>)
+ * @param e The exception which is the problem.
*/
public abstract void logMessage(final String msg, final Exception e);

/**
* Gets the threading model of the instance.
- *
+ *
* @return the threading model
*/
public ThreadingModel getThreadingModel() {

Copied: trunk/sandbox/jconch/pipeline/Processor.java (from r103, /trunk/src/jconch/pipeline/Processor.java)
==============================================================================
--- /trunk/src/jconch/pipeline/Processor.java (original)
+++ trunk/sandbox/jconch/pipeline/Processor.java Sat Mar 15 17:15:47 2008
@@ -1,21 +1,24 @@
package jconch.pipeline;

-import java.util.*;
-
-import jconch.pipeline.impl.*;
-
+import jconch.pipeline.impl.CollectionConsumer;
+import jconch.pipeline.impl.CollectionProducer;
+import jconch.pipeline.impl.ExceptionThreadingModel;
import org.apache.commons.collections.buffer.UnboundedFifoBuffer;

+import java.util.Collection;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
/**
* <p>
* A processing pipe in the pipeline.
* </p>
- *
+ *
+ * @author Robert Fischer
* @param <IN_T>
- * The input type.
+ * The input type.
* @param <OUT_T>
- * The output type.
- * @author Robert Fischer
+ * The output type.
*/
public abstract class Processor<IN_T, OUT_T> extends PipeStage {

@@ -25,7 +28,7 @@

/**
* Creates a new intance of <code>Processor</code>.
- *
+ *
* @param threading
*/
@SuppressWarnings("unchecked")
@@ -48,9 +51,8 @@

/**
* The argument that implements the processing for this class.
- *
- * @param item
- * The item to process.
+ *
+ * @param item The item to process.
* @return The processed item, or <code>null</code> to drop it.
*/
public abstract OUT_T process(final IN_T item);
@@ -94,7 +96,7 @@

/**
* Provides the pipeline link out.
- *
+ *
* @return The link that the producer feeds into; never <code>null</code>.
*/
public PipeLink<OUT_T> getLinkOut() {
@@ -103,7 +105,7 @@

/**
* Provides the pipe link that is being drawn from.
- *
+ *
* @return The inbound pipe link.
*/
protected PipeLink<IN_T> getLinkIn() {

Copied: trunk/sandbox/jconch/pipeline/Producer.java (from r103, /trunk/src/jconch/pipeline/Producer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/Producer.java (original)
+++ trunk/sandbox/jconch/pipeline/Producer.java Sat Mar 15 17:15:47 2008
@@ -1,17 +1,19 @@
package jconch.pipeline;

-import static org.apache.commons.collections.SetUtils.*;
-
-import java.util.*;
-
+import static org.apache.commons.collections.SetUtils.synchronizedSet;
+import static org.apache.commons.collections.SetUtils.typedSet;
import org.apache.commons.lang.NullArgumentException;

+import java.util.EnumSet;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
/**
* The base implementation of a pipe that produces new elements to retrieve.
- *
- * @param <OUT_T>
- * The type of the object that is produced by this element.
+ *
* @author Robert Fischer
+ * @param <OUT_T>
+ * The type of the object that is produced by this element.
*/
public abstract class Producer<OUT_T> extends PipeStage {

@@ -20,8 +22,8 @@
*/
private enum Errs {
failedAdd("Previously failed an add"), alreadyExhausted("This
producer is exhausted"), errorsInProduction(
- "There was an exception when we produced a previous
item"), createdNull(
- "Previously created null element");
+ "There was an exception when we produced a previous
item"), createdNull(
+ "Previously created null element");

final String message;

@@ -44,13 +46,10 @@

/**
* Constructor.
- *
- * @param threading
- * The threading model.
- * @param link
- * The link we produce things into.
- * @throws NullArgumentException
- * If either argument is <code>null</code>.
+ *
+ * @param threading The threading model.
+ * @param link The link we produce things into.
+ * @throws NullArgumentException If either argument is <code>null</code>.
*/
protected Producer(final ThreadingModel threading, final
PipeLink<OUT_T> link) {
super(threading);
@@ -63,7 +62,7 @@

/**
* Provides the pipeline link out.
- *
+ *
* @return The link that the producer feeds into; never <code>null</code>.
*/
public PipeLink<OUT_T> getLinkOut() {
@@ -72,7 +71,7 @@

/**
* Method that must be implemented to queue the producer.
- *
+ *
* @return The next item for the producer, or <code>null</code> if there
* are no more elements.
*/
@@ -80,7 +79,7 @@

/**
* In addition to the basic checks, checks for error conditions.
- *
+ * <p/>
* {@inheritDoc}
*/
@Override
@@ -148,7 +147,7 @@
* Determines if the pipeline stage will not produce any more
elements. This
* may be called more than once, and once it returns true, it
shall always
* return true.
- *
+ *
* @return If the stage is exhausted.
*/
protected abstract boolean isExhausted();

Copied: trunk/sandbox/jconch/pipeline/ThreadingModel.java (from r103, /trunk/src/jconch/pipeline/ThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/ThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/ThreadingModel.java Sat Mar 15
17:15:47 2008
@@ -5,18 +5,16 @@
/**
* Implements a threading model for a pipeline. A threading model
abstracts out
* the way in which pipelines are processed.
- *
+ *
* @author Robert Fischer
*/
public interface ThreadingModel {

- /**
- * Wraps the execution of the pipeline in the appropriate threading.
- *
- * @param toRun
- * The stage to run.
- * @throws NullArgumentException
- * If the argument is <code>null</code>
- */
- void execute(final PipeStage toRun);
+ /**
+ * Wraps the execution of the pipeline in the appropriate threading.
+ *
+ * @param toRun The stage to run.
+ * @throws NullArgumentException If the argument is <code>null</code>
+ */
+ void execute(final PipeStage toRun);
}

Copied: trunk/sandbox/jconch/pipeline/impl/BoundedPipeLink.java (from
r103, /trunk/src/jconch/pipeline/impl/BoundedPipeLink.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/BoundedPipeLink.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/BoundedPipeLink.java Sat Mar 15
17:15:47 2008
@@ -1,24 +1,22 @@
package jconch.pipeline.impl;

-import java.util.concurrent.LinkedBlockingQueue;
-
import jconch.pipeline.PipeLink;

+import java.util.concurrent.LinkedBlockingQueue;
+
/**
* A pipe link with a specified upper bound on the queue length.
*/
public class BoundedPipeLink<T> extends PipeLink<T> {

- /**
- * Constructor.
- *
- * @param maxElements
- * The maximum number of elements.
- * @throws IllegalArgumentException
- * If the argument is not greater than zero.
- */
- public BoundedPipeLink(final int maxElements) {
- super(new LinkedBlockingQueue<T>(maxElements));
- }
+ /**
+ * Constructor.
+ *
+ * @param maxElements The maximum number of elements.
+ * @throws IllegalArgumentException If the argument is not greater
than zero.
+ */
+ public BoundedPipeLink(final int maxElements) {
+ super(new LinkedBlockingQueue<T>(maxElements));
+ }

}

Copied: trunk/sandbox/jconch/pipeline/impl/ClosureConsumer.java (from
r103, /trunk/src/jconch/pipeline/impl/ClosureConsumer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/ClosureConsumer.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/ClosureConsumer.java Sat Mar 15
17:15:47 2008
@@ -1,13 +1,14 @@
package jconch.pipeline.impl;

-import jconch.pipeline.*;
-
+import jconch.pipeline.Consumer;
+import jconch.pipeline.PipeLink;
+import jconch.pipeline.ThreadingModel;
import org.apache.commons.collections.Closure;
import org.apache.commons.lang.NullArgumentException;

/**
* A {@link Closure}-based implementation of a {@link Consumer}.
- *
+ *
* @author Robert Fischer
*/
public abstract class ClosureConsumer<T> extends Consumer<T> {
@@ -19,15 +20,11 @@

/**
* Constructor.
- *
- * @param sink
- * The implementation of the consumption.
- * @param threading
- * The model for this consumer to use.
- * @param in
- * The link into this stage.
- * @throws NullArgumentException
- * If any argument is <code>null</code>
+ *
+ * @param sink The implementation of the consumption.
+ * @param threading The model for this consumer to use.
+ * @param in The link into this stage.
+ * @throws NullArgumentException If any argument is <code>null</code>
*/
public ClosureConsumer(final Closure sink, final ThreadingModel
threading, final PipeLink<T> in) {
super(threading, in);

Copied: trunk/sandbox/jconch/pipeline/impl/CollectionConsumer.java
(from r103, /trunk/src/jconch/pipeline/impl/CollectionConsumer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/CollectionConsumer.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/CollectionConsumer.java Sat Mar
15 17:15:47 2008
@@ -1,62 +1,57 @@
package jconch.pipeline.impl;

-import java.util.Collection;
-
import jconch.pipeline.Consumer;
import jconch.pipeline.PipeLink;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.buffer.UnboundedFifoBuffer;
import org.apache.commons.lang.NullArgumentException;

+import java.util.Collection;
+
/**
* A consumer which collects elements into a collection.
- *
+ *
* @author Robert Fischer
*/
public abstract class CollectionConsumer<T> extends Consumer<T> {

- private final Collection<T> c;
+ private final Collection<T> c;

- public CollectionConsumer(final ThreadingModel threading,
- final PipeLink<T> in) {
- this(new UnboundedFifoBuffer(), threading, in);
- }
-
- /**
- * Constructor.
- *
- * @param out
- * The collection to be populated.
- * @param threading
- * The threading model to use.
- * @param in
- * The pipeline link to draw from.
- * @throws NullArgumentException
- * If any argument is <code>null</code>
- */
- public CollectionConsumer(final Collection<T> out,
- final ThreadingModel threading, final PipeLink<T> in) {
- super(threading, in);
- if (out == null) {
- throw new NullArgumentException("out");
- }
- this.c = CollectionUtils.synchronizedCollection(out);
- }
-
- @Override
- public void consumeItem(T item) {
- if (item != null) {
- this.c.add(item);
- }
- }
-
- /**
- * Gets the collection backing the instance.
- */
- public Collection<T> getCollection() {
- return c;
- }
+ public CollectionConsumer(final ThreadingModel threading,
+ final PipeLink<T> in) {
+ this(new UnboundedFifoBuffer(), threading, in);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param out The collection to be populated.
+ * @param threading The threading model to use.
+ * @param in The pipeline link to draw from.
+ * @throws NullArgumentException If any argument is <code>null</code>
+ */
+ public CollectionConsumer(final Collection<T> out,
+ final ThreadingModel threading, final
PipeLink<T> in) {
+ super(threading, in);
+ if (out == null) {
+ throw new NullArgumentException("out");
+ }
+ this.c = CollectionUtils.synchronizedCollection(out);
+ }
+
+ @Override
+ public void consumeItem(T item) {
+ if (item != null) {
+ this.c.add(item);
+ }
+ }
+
+ /**
+ * Gets the collection backing the instance.
+ */
+ public Collection<T> getCollection() {
+ return c;
+ }

}

Copied: trunk/sandbox/jconch/pipeline/impl/CollectionProducer.java
(from r103, /trunk/src/jconch/pipeline/impl/CollectionProducer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/CollectionProducer.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/CollectionProducer.java Sat Mar
15 17:15:47 2008
@@ -1,79 +1,74 @@
package jconch.pipeline.impl;

-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
import jconch.pipeline.PipeLink;
import jconch.pipeline.Producer;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.buffer.UnboundedFifoBuffer;
import org.apache.commons.lang.NullArgumentException;

+import java.util.Collection;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
/**
* A producer which provides elements from a given collection.
- *
+ *
* @author Robert Fischer
*/
public abstract class CollectionProducer<T> extends Producer<T> {

- private final Collection<T> elts;
+ private final Collection<T> elts;

- /**
- * Constructor.
- *
- * @param data
- * The collection to draw elements from.
- * @throws NullArgumentException
- * If the argument is <code>null</code>
- */
- public CollectionProducer(final Collection<T> data,
- final ThreadingModel model, final PipeLink<T> out) {
- super(model, out);
- if (data == null) {
- throw new NullArgumentException("data");
- }
- elts = CollectionUtils.synchronizedCollection(data);
- }
-
- /**
- * Determines if the producer is done producing elements.
- *
- * @return If the collection is empty.
- */
- @Override
- protected boolean isExhausted() {
- synchronized (elts) {
- return elts.isEmpty();
- }
- }
-
- /**
- *
- * @return
- */
- @Override
- public T produceItem() {
- try {
- final T out;
- synchronized (elts) {
- final Iterator<T> it = elts.iterator();
- out = it.next();
- it.remove();
- }
- return out;
- } catch (NoSuchElementException nsee) {
- return null;
- }
- }
-
- /**
- * Gets the collection backing the instance.
- */
- public Collection<T> getCollection() {
- return elts;
- }
+ /**
+ * Constructor.
+ *
+ * @param data The collection to draw elements from.
+ * @throws NullArgumentException If the argument is <code>null</code>
+ */
+ public CollectionProducer(final Collection<T> data,
+ final ThreadingModel model, final
PipeLink<T> out) {
+ super(model, out);
+ if (data == null) {
+ throw new NullArgumentException("data");
+ }
+ elts = CollectionUtils.synchronizedCollection(data);
+ }
+
+ /**
+ * Determines if the producer is done producing elements.
+ *
+ * @return If the collection is empty.
+ */
+ @Override
+ protected boolean isExhausted() {
+ synchronized (elts) {
+ return elts.isEmpty();
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public T produceItem() {
+ try {
+ final T out;
+ synchronized (elts) {
+ final Iterator<T> it = elts.iterator();
+ out = it.next();
+ it.remove();
+ }
+ return out;
+ } catch (NoSuchElementException nsee) {
+ return null;
+ }
+ }
+
+ /**
+ * Gets the collection backing the instance.
+ */
+ public Collection<T> getCollection() {
+ return elts;
+ }

}

Copied: trunk/sandbox/jconch/pipeline/impl/ExceptionThreadingModel.java
(from r103, /trunk/src/jconch/pipeline/impl/ExceptionThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/ExceptionThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/ExceptionThreadingModel.java Sat
Mar 15 17:15:47 2008
@@ -9,8 +9,7 @@
public class ExceptionThreadingModel implements ThreadingModel {

/**
- * @throws RuntimeException
- * Always.
+ * @throws RuntimeException Always.
*/
public void execute(final PipeStage toRun) {
throw new RuntimeException();

Copied: trunk/sandbox/jconch/pipeline/impl/ExecutorThreadingModel.java
(from r103, /trunk/src/jconch/pipeline/impl/ExecutorThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/ExecutorThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/ExecutorThreadingModel.java Sat
Mar 15 17:15:47 2008
@@ -1,15 +1,14 @@
package jconch.pipeline.impl;

-import java.util.concurrent.Executor;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.atomic.AtomicLong;
-
import jconch.pipeline.PipeStage;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.lang.NullArgumentException;
import org.apache.commons.lang.time.DateUtils;

+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
* <p>
* A wrapper around {@link ThreadingModel} which allows the user to
leverage the
@@ -26,11 +25,11 @@
* detect if a {@link ThreadPoolExecutor} is being used and will call
* {@link ThreadPoolExecutor#shutdown()} to enable an orderly shutdown.
* </p>
- *
+ * <p/>
* <p>
* <a href="ExecutorThreadingModel.java.html">View Source</a>
* </p>
- *
+ *
* @author Robert Fischer
*/
public class ExecutorThreadingModel implements ThreadingModel {
@@ -42,11 +41,9 @@
/**
* Constructor. This uses the given implementation, and a default delay
* between spawns.
- *
- * @param impl
- * The underlying implementation for execution.
- * @throws NullArgumentException
- * If the argument is <code>null</code>.
+ *
+ * @param impl The underlying implementation for execution.
+ * @throws NullArgumentException If the argument is <code>null</code>.
*/
public ExecutorThreadingModel(final Executor impl) {
if (impl == null) {
@@ -60,11 +57,9 @@
* call to {@link PipeStage#execute()} is wrapped in its own
* {@link Runnable} that is passed to the {@link Executor} implementation
* provided.
- *
- * @param toRun
- * The stage to execute.
- * @throws NullArgumentException
- * If the argument is <code>null</code>.
+ *
+ * @param toRun The stage to execute.
+ * @throws NullArgumentException If the argument is <code>null</code>.
*/
public void execute(final PipeStage toRun) {
if (toRun == null) {
@@ -99,7 +94,7 @@

/**
* Gets the period between executor calls for instance.
- *
+ *
* @return the spawn period
*/
public long getSpawnPeriod() {
@@ -109,9 +104,8 @@
/**
* Sets the period between executor calls for instance. Values
less than or
* equal to 0 are treated as 1.
- *
- * @param spawnDelay
- * the new spawn period
+ *
+ * @param spawnDelay the new spawn period
*/
public void setSpawnDelay(final long spawnDelay) {
this.spawnDelay.set(Math.max(spawnDelay, 1));

Copied: trunk/sandbox/jconch/pipeline/impl/FactoryProducer.java (from
r103, /trunk/src/jconch/pipeline/impl/FactoryProducer.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/FactoryProducer.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/FactoryProducer.java Sat Mar 15
17:15:47 2008
@@ -1,20 +1,19 @@
package jconch.pipeline.impl;

-import org.apache.commons.collections.Factory;
-import org.apache.commons.lang.NullArgumentException;
-
import jconch.pipeline.PipeLink;
import jconch.pipeline.Producer;
import jconch.pipeline.ThreadingModel;
+import org.apache.commons.collections.Factory;
+import org.apache.commons.lang.NullArgumentException;

/**
* A {@link Producer} based off of a {@link Factory} implementation.
- *
+ * <p/>
* <b>Implementation Note:</b> Due to <a
* href="http://enfranchisedmind.com/blog/archive/2007/05/17/232" target="v">a
* failing of generics</a>, there is no type-safety available for this
* implementation.
- *
+ *
* @author Robert Fischer
*/
public abstract class FactoryProducer extends Producer {
@@ -31,15 +30,11 @@

/**
* Constructor.
- *
- * @param source
- * The factory that will be called to produce new elements.
- * @param threading
- * The threading model.
- * @param link
- * The link we produce things into.
- * @throws NullArgumentException
- * If any argument is <code>null</code>.
+ *
+ * @param source The factory that will be called to produce new elements.
+ * @param threading The threading model.
+ * @param link The link we produce things into.
+ * @throws NullArgumentException If any argument is <code>null</code>.
*/
protected FactoryProducer(final Factory source, final
ThreadingModel threading, final PipeLink link) {
super(threading, link);

Copied: trunk/sandbox/jconch/pipeline/impl/InlineThreadingModel.java
(from r103, /trunk/src/jconch/pipeline/impl/InlineThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/InlineThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/InlineThreadingModel.java Sat
Mar 15 17:15:47 2008
@@ -2,30 +2,27 @@

import jconch.pipeline.PipeStage;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.lang.NullArgumentException;

/**
* Executes the pipeline stage inline. Does not actually spawn a
thread, but
* simply delegates the execution again.
- *
+ *
* @author Robert Fischer
- *
*/
public class InlineThreadingModel implements ThreadingModel {

- /**
- * Simply calls {@link PipeStage#execute()}.
- *
- * @throws NullArgumentException
- * If the argument is <code>null</code>
- */
- public void execute(final PipeStage toRun) {
- if (toRun == null) {
- throw new NullArgumentException("toRun");
- }
- while (!toRun.isFinished()) {
- toRun.execute();
- }
- }
+ /**
+ * Simply calls {@link PipeStage#execute()}.
+ *
+ * @throws NullArgumentException If the argument is <code>null</code>
+ */
+ public void execute(final PipeStage toRun) {
+ if (toRun == null) {
+ throw new NullArgumentException("toRun");
+ }
+ while (!toRun.isFinished()) {
+ toRun.execute();
+ }
+ }
}

Copied:
trunk/sandbox/jconch/pipeline/impl/SingleThreadThreadingModel.java
(from r103, /trunk/src/jconch/pipeline/impl/SingleThreadThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/SingleThreadThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/SingleThreadThreadingModel.java
Sat Mar 15 17:15:47 2008
@@ -2,21 +2,19 @@

import jconch.pipeline.PipeStage;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.lang.NullArgumentException;

/**
* Runs a single different thread to process the threading.
- *
+ *
* @author Robert Fischer
*/
public class SingleThreadThreadingModel implements ThreadingModel {

/**
* Spawns a thread, and it keeps executing everything.
- *
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ *
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
public void execute(final PipeStage toRun) {
if (toRun == null) {

Copied: trunk/sandbox/jconch/pipeline/impl/SpawningThreadingModel.java
(from r103, /trunk/src/jconch/pipeline/impl/SpawningThreadingModel.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/SpawningThreadingModel.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/SpawningThreadingModel.java Sat
Mar 15 17:15:47 2008
@@ -1,18 +1,16 @@
package jconch.pipeline.impl;

-import java.util.concurrent.atomic.AtomicLong;
-
import jconch.pipeline.PipeStage;
import jconch.pipeline.ThreadingModel;
-
import org.apache.commons.lang.NullArgumentException;
import org.apache.commons.lang.time.DateUtils;

+import java.util.concurrent.atomic.AtomicLong;
+
/**
* Spawns a new thread for each call to execute.
- *
+ *
* @author Robert Fischer
- *
*/
public class SpawningThreadingModel implements ThreadingModel {

@@ -27,11 +25,9 @@

/**
* Constructor.
- *
- * @param waitBetweenSpawns
- * The time to wait between spawns.
- * @throws IllegalArgumentException
- * If the argument <= 0
+ *
+ * @param waitBetweenSpawns The time to wait between spawns.
+ * @throws IllegalArgumentException If the argument <= 0
*/
public SpawningThreadingModel(final long waitBetweenSpawns) {
if (waitBetweenSpawns <= 0) {
@@ -42,9 +38,8 @@

/**
* Spawns a thread that calls {@link PipeStage#execute()}.
- *
- * @throws NullArgumentException
- * If the argument is <code>null</code>
+ *
+ * @throws NullArgumentException If the argument is <code>null</code>
*/
public void execute(final PipeStage toRun) {
if (toRun == null) {

Copied: trunk/sandbox/jconch/pipeline/impl/TransformerProcessor.java
(from r103, /trunk/src/jconch/pipeline/impl/TransformerProcessor.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/TransformerProcessor.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/TransformerProcessor.java Sat
Mar 15 17:15:47 2008
@@ -1,20 +1,19 @@
package jconch.pipeline.impl;

-import org.apache.commons.collections.Transformer;
-import org.apache.commons.lang.NullArgumentException;
-
import jconch.pipeline.PipeLink;
import jconch.pipeline.Processor;
import jconch.pipeline.ThreadingModel;
+import org.apache.commons.collections.Transformer;
+import org.apache.commons.lang.NullArgumentException;

/**
* A {@link Transformer}-based implementation of a {@link Processor}.
- *
+ * <p/>
* <b>Implementation Note:</b> Due to <a
* href="http://enfranchisedmind.com/blog/archive/2007/05/17/232" target="v">a
* failing of generics</a>, there is no type-safety available for this
* implementation.
- *
+ *
* @author Robert Fischer
*/
public abstract class TransformerProcessor extends Processor {
@@ -23,14 +22,12 @@

/**
* Constructor.
- *
- * @param trans
- * The implementation of the processing.
- * @throws NullArgumentException
- * If any argument is <code>null</code>.
+ *
+ * @param trans The implementation of the processing.
+ * @throws NullArgumentException If any argument is <code>null</code>.
*/
protected TransformerProcessor(final Transformer trans, final
ThreadingModel threading, final PipeLink inLink,
- final PipeLink outLink) {
+ final PipeLink outLink) {
super(threading, inLink, outLink);
if (trans == null) {
throw new NullArgumentException("trans");

Copied: trunk/sandbox/jconch/pipeline/impl/TypeSafePipeLink.java (from
r103, /trunk/src/jconch/pipeline/impl/TypeSafePipeLink.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/TypeSafePipeLink.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/TypeSafePipeLink.java Sat Mar 15
17:15:47 2008
@@ -1,18 +1,17 @@
package jconch.pipeline.impl;

-import java.util.concurrent.BlockingQueue;
-
import jconch.pipeline.PipeLink;
-
import org.apache.commons.lang.IllegalClassException;
import org.apache.commons.lang.NullArgumentException;

+import java.util.concurrent.BlockingQueue;
+
/**
* Due to a limitation in Java's generic implementation, there is no
way to go
* from a parameterized type to a {@link Class} instance representing
that type.
* And since type erasure undermines casts to parameterized types,
there is no
* run-time type safety guarantied through parameterized types alone.
- * <p />
+ * <p/>
* This class works around that by taking in a {@link Class} instance
which can
* then be used to perform run-time type checks.
*/
@@ -22,11 +21,9 @@

/**
* {@inheritDoc}
- *
- * @param elementClass
- * The class of elements to be added.
- * @throws NullArgumentException
- * If <code>elementClass</code> is <code>null</code>.
+ *
+ * @param elementClass The class of elements to be added.
+ * @throws NullArgumentException If <code>elementClass</code> is <code>null</code>.
*/
protected TypeSafePipeLink(final BlockingQueue<T> queue, final
Class<T> elementClass) {
super(queue);
@@ -35,10 +32,9 @@

/**
* {@inheritDoc}
- *
- * @throws IllegalClassException
- * If in is not an element of the type represented by
- * {@link #getElementClass()}.
+ *
+ * @throws IllegalClassException If in is not an element of the
type represented by
+ * {@link #getElementClass()}.
*/
@Override
public boolean add(final T in) {
@@ -53,7 +49,7 @@

/**
* Provides the element class.
- *
+ *
* @return The {@link Class} instance representing the contract
that classes
* must adhere to. Never <code>null</code>.
*/

Copied: trunk/sandbox/jconch/pipeline/impl/UnboundedPipeLink.java (from
r103, /trunk/src/jconch/pipeline/impl/UnboundedPipeLink.java)
==============================================================================
--- /trunk/src/jconch/pipeline/impl/UnboundedPipeLink.java (original)
+++ trunk/sandbox/jconch/pipeline/impl/UnboundedPipeLink.java Sat Mar
15 17:15:47 2008
@@ -1,42 +1,42 @@
package jconch.pipeline.impl;

-import java.util.concurrent.LinkedBlockingQueue;
-
import jconch.pipeline.PipeLink;

+import java.util.concurrent.LinkedBlockingQueue;
+
/**
* <p>
* An unbounded link in the pipeline. This is a very fast
implementation of a
* link, but allows potentially unlimited elements to build up, which
can be
* counter-productive to the multithreaded approach.
* </p>
- *
+ * <p/>
* <p>
* <a href="UnboundedPipeLink.java.html">View Source</a>
* </p>
- *
+ *
* @author rfischer
* @version $Date: May 10, 2007 8:07:29 AM $
*/
public class UnboundedPipeLink<T> extends PipeLink<T> {

- /**
- * Creates a new intance of <code>UnboundedPipeLink</code>.
- */
- public UnboundedPipeLink() {
- super(new LinkedBlockingQueue<T>());
- }
+ /**
+ * Creates a new intance of <code>UnboundedPipeLink</code>.
+ */
+ public UnboundedPipeLink() {
+ super(new LinkedBlockingQueue<T>());
+ }

- /**
- * Have to override this because
- * {@link LinkedBlockingQueue#remainingCapacity()} doesn't work as
expected --
- * apparently an unbounded queue runs low on space after you insert
- * elements.
- *
- * {@inheritDoc}
- */
- @Override
- public int getRemainingCapacity() {
- return Integer.MAX_VALUE;
- }
+ /**
+ * Have to override this because
+ * {@link LinkedBlockingQueue#remainingCapacity()} doesn't work as
expected --
+ * apparently an unbounded queue runs low on space after you insert
+ * elements.
+ * <p/>
+ * {@inheritDoc}
+ */
+ @Override
+ public int getRemainingCapacity() {
+ return Integer.MAX_VALUE;
+ }
}

Reply all
Reply to author
Forward
0 new messages