Author: bdonlan
Date: 2005-11-14 16:28:46 -0500 (Mon, 14 Nov 2005)
New Revision: 920

Added:
   trunk/clients/javer3/Javer3/
   trunk/clients/javer3/Javer3/build.xml
   trunk/clients/javer3/Javer3/manifest.mf
   trunk/clients/javer3/Javer3/nbproject/
   trunk/clients/javer3/Javer3/nbproject/build-impl.xml
   trunk/clients/javer3/Javer3/nbproject/genfiles.properties
   trunk/clients/javer3/Javer3/nbproject/private/
   trunk/clients/javer3/Javer3/nbproject/private/cache/
   trunk/clients/javer3/Javer3/nbproject/private/cache/.refactorit/
   trunk/clients/javer3/Javer3/nbproject/private/cache/.refactorit/cache.bin
   trunk/clients/javer3/Javer3/nbproject/private/private.properties
   trunk/clients/javer3/Javer3/nbproject/project.properties
   trunk/clients/javer3/Javer3/nbproject/project.xml
   trunk/clients/javer3/Javer3/src/
   trunk/clients/javer3/Javer3/src/javer3/
   trunk/clients/javer3/Javer3/src/javer3/HaverClient.java
   trunk/clients/javer3/Javer3/src/javer3/Main.java
   trunk/clients/javer3/Javer3/src/javer3/Message.java
   trunk/clients/javer3/Javer3/src/javer3/ObjectQueue.java
   trunk/clients/javer3/Javer3/src/javer3/Receiver.java
   trunk/clients/javer3/Javer3/test/
Log:
Initial import of work-in-progress javer3

Added: trunk/clients/javer3/Javer3/build.xml
===================================================================
--- trunk/clients/javer3/Javer3/build.xml       2005-11-14 04:23:17 UTC (rev 
919)
+++ trunk/clients/javer3/Javer3/build.xml       2005-11-14 21:28:46 UTC (rev 
920)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<project name="Javer3" default="default" basedir=".">
+    <description>Builds, tests, and runs the project Javer3.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project 
properties
+      -post-init:                called after initialization of project 
properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single 
JUnit test
+      -post-compile-test-single: called after javac compilation of single 
JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like 
this:
+
+        <target name="run" depends="Javer3-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only 
on 
+    the compile target as the regular run target does. Again, for a list of 
available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+</project>


Property changes on: trunk/clients/javer3/Javer3/build.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/manifest.mf
===================================================================
--- trunk/clients/javer3/Javer3/manifest.mf     2005-11-14 04:23:17 UTC (rev 
919)
+++ trunk/clients/javer3/Javer3/manifest.mf     2005-11-14 21:28:46 UTC (rev 
920)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+

Added: trunk/clients/javer3/Javer3/nbproject/build-impl.xml
===================================================================
--- trunk/clients/javer3/Javer3/nbproject/build-impl.xml        2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/nbproject/build-impl.xml        2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,489 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+-->
+<project name="Javer3-impl" default="default" basedir=".." 
xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2"; 
xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1";>
+    <target name="default" depends="test,jar,javadoc" description="Build and 
test whole project."/>
+    <!-- 
+    ======================
+    INITIALIZATION SECTION 
+    ======================
+    -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-init-private" depends="-pre-init">
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target name="-init-user" depends="-pre-init,-init-private">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target name="-init-project" depends="-pre-init,-init-private,-init-user">
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target name="-do-init" 
depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <isfalse value="${javadoc.preview}"/>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-init-check" 
depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set 
build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set 
build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set 
build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" 
uri="http://www.netbeans.org/ns/j2se-project/1";>
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="[EMAIL PROTECTED]"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-javac">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/2";>
+            <attribute name="srcdir" default="${src.dir}"/>
+            <attribute name="destdir" default="${build.classes.dir}"/>
+            <attribute name="classpath" default="${javac.classpath}"/>
+            <attribute name="debug" default="${javac.debug}"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <javac srcdir="@{srcdir}" destdir="@{destdir}" 
debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" 
target="${javac.target}" includeantruntime="false">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/2";>
+            <attribute name="includes" default="**/*Test.java"/>
+            <sequential>
+                <junit showoutput="true" fork="true" dir="${basedir}" 
failureproperty="tests.failed" errorproperty="tests.failed">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" includes="@{includes}"/>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper type="glob" from="test-sys-prop.*" to="*"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" 
uri="http://www.netbeans.org/ns/j2se-project/1";>
+            <attribute name="name" default="${main.class}"/>
+            <attribute name="classpath" default="${debug.classpath}"/>
+            <attribute name="stopclassname" default=""/>
+            <sequential>
+                <nbjpdastart transport="dt_socket" 
addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" 
uri="http://www.netbeans.org/ns/j2se-project/1";>
+            <attribute name="dir" default="${build.classes.dir}"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset includes="${fix.includes}*.class" dir="@{dir}"/>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/2";>
+            <attribute name="classname" default="${main.class}"/>
+            <attribute name="classpath" default="${debug.classpath}"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java fork="true" classname="@{classname}" dir="${work.dir}">
+                    <jvmarg value="-Xdebug"/>
+                    <jvmarg value="-Xnoagent"/>
+                    <jvmarg value="-Djava.compiler=none"/>
+                    <jvmarg 
value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper type="glob" from="run-sys-prop.*" to="*"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1";>
+            <attribute name="classname" default="${main.class}"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java fork="true" classname="@{classname}" dir="${work.dir}">
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper type="glob" from="run-sys-prop.*" to="*"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1";>
+            <jar jarfile="${dist.jar}" compress="${jar.compress}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="init" 
depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
+    <!--
+    ===================
+    COMPILATION SECTION
+    ===================
+    -->
+    <target name="deps-jar" depends="init" unless="no.deps"/>
+    <target name="-pre-pre-compile" depends="init,deps-jar">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-do-compile" 
depends="init,deps-jar,-pre-pre-compile,-pre-compile">
+        <j2seproject2:javac/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="compile" 
depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" 
description="Compile project."/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
+        <fail unless="javac.includes">Must select some files in the IDE or set 
javac.includes</fail>
+        <j2seproject2:javac>
+            <customize>
+                <patternset includes="${javac.includes}"/>
+            </customize>
+        </j2seproject2:javac>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="compile-single" 
depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
+    <!--
+    ====================
+    JAR BUILDING SECTION
+    ====================
+    -->
+    <target name="-pre-pre-jar" depends="init">
+        <dirname property="dist.jar.dir" file="${dist.jar}"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-do-jar-without-manifest" 
depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
+        <j2seproject1:jar/>
+    </target>
+    <target name="-do-jar-with-manifest" 
depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" 
unless="manifest.available+main.class">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target name="-do-jar-with-mainclass" 
depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" 
value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+    </target>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="jar" 
depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-post-jar"
 description="Build JAR."/>
+    <!--
+    =================
+    EXECUTION SECTION
+    =================
+    -->
+    <target name="run" depends="init,compile" description="Run a main class.">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="run-single" depends="init,compile-single">
+        <fail unless="run.class">Must select one file in the IDE or set 
run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <!--
+    =================
+    DEBUGGING SECTION
+    =================
+    -->
+    <target name="-debug-start-debugger" if="netbeans.home" depends="init">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target name="-debug-start-debuggee" depends="init,compile">
+        <j2seproject2:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject2:debug>
+    </target>
+    <target name="debug" if="netbeans.home" 
depends="init,compile,-debug-start-debugger,-debug-start-debuggee" 
description="Debug project in IDE."/>
+    <target name="-debug-start-debugger-stepinto" if="netbeans.home" 
depends="init">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target name="debug-stepinto" if="netbeans.home" 
depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
+    <target name="-debug-start-debuggee-single" if="netbeans.home" 
depends="init,compile-single">
+        <fail unless="debug.class">Must select one file in the IDE or set 
debug.class</fail>
+        <j2seproject2:debug classname="${debug.class}"/>
+    </target>
+    <target name="debug-single" if="netbeans.home" 
depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
+    <target name="-pre-debug-fix" depends="init">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target name="-do-debug-fix" if="netbeans.home" 
depends="init,-pre-debug-fix,compile-single">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target name="debug-fix" if="netbeans.home" 
depends="init,-pre-debug-fix,-do-debug-fix"/>
+    <!--
+    ===============
+    JAVADOC SECTION
+    ===============
+    -->
+    <target name="-javadoc-build" depends="init">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" 
notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" 
noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" 
author="${javadoc.author}" version="${javadoc.version}" 
windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" 
additionalparam="${javadoc.additionalparam}" failonerror="true">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <sourcepath>
+                <pathelement location="${src.dir}"/>
+            </sourcepath>
+            <fileset dir="${src.dir}"/>
+        </javadoc>
+    </target>
+    <target name="-javadoc-browse" if="netbeans.home" 
unless="no.javadoc.preview" depends="init,-javadoc-build">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" 
description="Build Javadoc."/>
+    <!--
+    =========================
+    JUNIT COMPILATION SECTION
+    =========================
+    -->
+    <target name="-pre-pre-compile-test" if="have.tests" 
depends="init,compile">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-do-compile-test" if="have.tests" 
depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
+        <j2seproject2:javac srcdir="${test.src.dir}" 
destdir="${build.test.classes.dir}" debug="true" 
classpath="${javac.test.classpath}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="**/*.java"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="compile-test" 
depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-do-compile-test-single" if="have.tests" 
depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set 
javac.includes</fail>
+        <j2seproject2:javac srcdir="${test.src.dir}" 
destdir="${build.test.classes.dir}" debug="true" 
classpath="${javac.test.classpath}">
+            <customize>
+                <patternset includes="${javac.includes}"/>
+            </customize>
+        </j2seproject2:javac>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="compile-test-single" 
depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
+    <!--
+    =======================
+    JUNIT EXECUTION SECTION
+    =======================
+    -->
+    <target name="-pre-test-run" if="have.tests" depends="init">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target name="-do-test-run" if="have.tests" 
depends="init,compile-test,-pre-test-run">
+        <j2seproject2:junit/>
+    </target>
+    <target name="-post-test-run" if="have.tests" 
depends="init,compile-test,-pre-test-run,-do-test-run">
+        <fail if="tests.failed">Some tests failed; see details above.</fail>
+    </target>
+    <target name="test-report" if="have.tests" depends="init"/>
+    <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
+    <target name="test" 
depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse"
 description="Run unit tests."/>
+    <target name="-pre-test-run-single" if="have.tests" depends="init">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target name="-do-test-run-single" if="have.tests" 
depends="init,compile-test-single,-pre-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set 
test.includes</fail>
+        <j2seproject2:junit includes="${test.includes}"/>
+    </target>
+    <target name="-post-test-run-single" if="have.tests" 
depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
+        <fail if="tests.failed">Some tests failed; see details above.</fail>
+    </target>
+    <target name="test-single" 
depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single"
 description="Run single unit test."/>
+    <!--
+    =======================
+    JUNIT DEBUGGING SECTION
+    =======================
+    -->
+    <target name="-debug-start-debuggee-test" if="have.tests" 
depends="init,compile-test">
+        <fail unless="test.class">Must select one file in the IDE or set 
test.class</fail>
+        <j2seproject2:debug classname="junit.textui.TestRunner" 
classpath="${debug.test.classpath}">
+            <customize>
+                <arg line="${test.class}"/>
+            </customize>
+        </j2seproject2:debug>
+    </target>
+    <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" 
depends="init,compile-test">
+        <j2seproject1:nbjpdastart name="${test.class}" 
classpath="${debug.test.classpath}"/>
+    </target>
+    <target name="debug-test" 
depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
+    <target name="-do-debug-fix-test" if="netbeans.home" 
depends="init,-pre-debug-fix,compile-test-single">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="debug-fix-test" if="netbeans.home" 
depends="init,-pre-debug-fix,-do-debug-fix-test"/>
+    <!--
+    =========================
+    APPLET EXECUTION SECTION
+    =========================
+    -->
+    <target name="run-applet" depends="init,compile-single">
+        <fail unless="applet.url">Must select one file in the IDE or set 
applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+    =========================
+    APPLET DEBUGGING  SECTION
+    =========================
+    -->
+    <target name="-debug-start-debuggee-applet" if="netbeans.home" 
depends="init,compile-single">
+        <fail unless="applet.url">Must select one file in the IDE or set 
applet.url</fail>
+        <j2seproject2:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject2:debug>
+    </target>
+    <target name="debug-applet" if="netbeans.home" 
depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
+    <!--
+    ===============
+    CLEANUP SECTION
+    ===============
+    -->
+    <target name="deps-clean" depends="init" unless="no.deps"/>
+    <target name="-do-clean" depends="init">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" 
description="Clean build products."/>
+</project>


Property changes on: trunk/clients/javer3/Javer3/nbproject/build-impl.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/nbproject/genfiles.properties
===================================================================
--- trunk/clients/javer3/Javer3/nbproject/genfiles.properties   2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/nbproject/genfiles.properties   2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=7d2417b2
+build.xml.script.CRC32=c07f6a34
+build.xml.stylesheet.CRC32=e2435cb5
+# This file is used by a NetBeans-based IDE to track changes in generated 
files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never 
regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=7d2417b2
+nbproject/build-impl.xml.script.CRC32=efe376a3
+nbproject/build-impl.xml.stylesheet.CRC32=3b89b5a6


Property changes on: trunk/clients/javer3/Javer3/nbproject/genfiles.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/nbproject/private/cache/.refactorit/cache.bin
===================================================================

Added: trunk/clients/javer3/Javer3/nbproject/private/private.properties
===================================================================
--- trunk/clients/javer3/Javer3/nbproject/private/private.properties    
2005-11-14 04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/nbproject/private/private.properties    
2005-11-14 21:28:46 UTC (rev 920)
@@ -0,0 +1,4 @@
+application.args=
+javac.debug=true
+javadoc.preview=true
+user.properties.file=/home/bdonlan/.netbeans/4.1/build.properties


Property changes on: 
trunk/clients/javer3/Javer3/nbproject/private/private.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/nbproject/project.properties
===================================================================
--- trunk/clients/javer3/Javer3/nbproject/project.properties    2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/nbproject/project.properties    2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,54 @@
+application.args=
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/Javer3.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=${default.javac.source}
+javac.target=${default.javac.target}
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=javer3.Main
+manifest.file=manifest.mf
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value 
instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+src.dir=src
+test.src.dir=test


Property changes on: trunk/clients/javer3/Javer3/nbproject/project.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/nbproject/project.xml
===================================================================
--- trunk/clients/javer3/Javer3/nbproject/project.xml   2005-11-14 04:23:17 UTC 
(rev 919)
+++ trunk/clients/javer3/Javer3/nbproject/project.xml   2005-11-14 21:28:46 UTC 
(rev 920)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1";>
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/2";>
+            <name>Javer3</name>
+            <minimum-ant-version>1.6</minimum-ant-version>
+            <source-roots>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+    </configuration>
+</project>


Property changes on: trunk/clients/javer3/Javer3/nbproject/project.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/src/javer3/HaverClient.java
===================================================================
--- trunk/clients/javer3/Javer3/src/javer3/HaverClient.java     2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/src/javer3/HaverClient.java     2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,352 @@
+/*
+ * HaverClient.java
+ *
+ * Created on November 13, 2005, 11:31 PM
+ *
+ * To change this template, choose Tools | Options and locate the template 
under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package javer3;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.lang.reflect.*;
+
+/**
+ *
+ * @author bdonlan
+ */
+public class HaverClient {
+    
+    protected final HaverClient _me = this;
+    
+    private Object lock = new Object();
+    static final int ST_IDLE  = 0; // Not connected, not connecting
+    static final int ST_CONN  = 1; // Connecting
+    static final int ST_HELO  = 2; // Protocol handshake
+    static final int ST_IDENT = 3; // C: IDENT sent
+    static final int ST_READY = 10; // Ready for action
+    
+    public static final String version = "Javer/0.03";
+    
+    Set clients = new HashSet();
+    
+    int state = ST_IDLE;
+    Writer current_writer = null;
+    
+    IOException ex = null;
+    
+    String uid = null; // XXX?
+    
+    /* We don't have a 'disconnecting' state - the writer thread handles that.
+     * We just send the appropriate message down and reset the appropriate
+     * variables. Disconnect errors are handled by the reader thread.
+     *
+     * If an exception occurs in the writer, set ex to that exception, and 
close
+     * the socket. The reader will pick up and dispatch the exception.
+     *
+     * Note that the writer is responsible for spawning the reader. If an
+     * exception occurs early, it must dispatch it on its own.
+     */
+    
+    private class Reader implements Runnable {
+        Socket _s;
+        
+        public void run() {
+            IOException e_ = null;
+            try {
+                BufferedReader r =
+                        new BufferedReader(
+                         new InputStreamReader(
+                          _s.getInputStream()
+                        ));
+                while (true) {
+                    String line = r.readLine();
+                    if (line == null)
+                        return;
+                    handleLine(line);
+                }
+            } catch (IOException e) {
+                e_ = e;
+            } finally {
+                synchronized(lock) {
+                    if (e_ == null)
+                        e_ = ex;
+                    ex = null;
+                    dispatch(new ExceptionDisconnect(_me, e_));
+                    if (current_writer != null)
+                        current_writer.close();
+                    current_writer = null;
+                    state = ST_IDLE;
+                    return;
+                }
+            }
+        }
+        
+        Reader(Socket s) {
+            _s = s;
+        }
+    }
+    
+    private class Writer implements Runnable {
+        private class WM_Line {
+            String s;
+            WM_Line(String _s) { s = _s; }
+        }
+    
+        private class WM_EOF {}
+        
+        private java.net.Socket s;
+        private String host;
+        private int port;
+        
+        private ObjectQueue q = new ObjectQueue();
+        
+        public void run() {
+            assert state == ST_CONN && current_writer == this;
+            ex = null;
+            try {
+                if (s == null) {
+                    s = new Socket(host, port);
+                }
+                host = null;
+                
+                new Thread(new Reader(s)).start();
+            }
+            catch (IOException e) {
+                dispatch(new ConnectIOException(_me, e));
+                synchronized (lock) { state = ST_IDLE; }
+                return;
+            }
+            try {
+                synchronized (lock) {
+                    state = ST_HELO;
+                }
+                OutputStreamWriter osw = new OutputStreamWriter(
+                        s.getOutputStream());
+                PrintWriter w = new PrintWriter(
+                        new BufferedWriter(osw)
+                        );
+                
+                println("HAVER\t" + version);
+                
+                while (true) {
+                    Object o;
+                    try {
+                        o = q.block();
+                    } catch (InterruptedException e) {
+                        continue;
+                    }
+                    if (o instanceof WM_Line) {
+                        String l = ((WM_Line)o).s;
+                        System.out.println("C: " + l);
+                        w.println(l);
+                        if (!q.hasData())
+                            w.flush();
+                    } else if (o instanceof WM_EOF) {
+                        synchronized(lock) {
+                            ex = null;
+                            w.close();
+                            try { s.close(); } catch (IOException e) { }
+                            current_writer = null;
+                            return;
+                        }
+                    }
+                }
+            } catch(IOException e) {
+                synchronized (lock) {
+                    if (current_writer != this) { return; }
+                    ex = e;
+                    try { s.close(); } catch (Throwable t) {}
+                }
+            }
+        }
+        
+        Writer(String h, int p) {
+            host = h;
+            port = p;
+            s    = null;
+        }
+        
+        Writer(Socket _s) {
+            s = _s;
+        }
+        
+        void println(String ln) {
+            q.post(new WM_Line(ln));
+        }
+        
+        void close() {
+            q.post(new WM_EOF());
+        }
+    }
+    
+    public void connect(String host, int port, String uid) {
+        synchronized (lock) {
+            if (state != ST_IDLE)
+                throw new IllegalStateException("Already connected or 
connecting");
+            state = ST_CONN;
+            assert current_writer == null;
+            current_writer = new Writer(host, port);
+            new Thread(current_writer).start();
+            this.uid = uid;
+        }
+    }
+    
+    static String[] decodeLine(String line) {
+        int ptr = 0;
+        Vector v = new Vector();
+        
+        while (true) {
+            int next = line.indexOf("\t", ptr);
+            if (next == -1)
+                break;
+            v.add(line.substring(ptr, next));
+            ptr = next + 1;
+        }
+        v.add(line.substring(ptr));
+        
+        String a[] = new String[v.size()];
+        Iterator i = v.iterator();
+        int j = 0;
+        while (i.hasNext())
+            a[j++] = (String)i.next();
+        return a;
+    }
+    
+    static String encodeLine(String[] line) {
+        StringBuffer buf = new StringBuffer();
+        
+        for (int i = 0; i < line.length; i++) {
+            if (i != 0)
+                buf.append('\t');
+            buf.append(line[i]);
+        }
+        
+        return buf.toString();
+    }
+            
+    
+    /** Creates a new instance of HaverClient */
+    public HaverClient() {
+    }
+    
+    void dispatch(Message m) {
+        synchronized (clients) {
+            Iterator i = clients.iterator();
+            while (i.hasNext()) {
+                Receiver r = (Receiver)i.next();
+                try {
+                    r.dispatchMessage(m);
+                } catch (Throwable t) {
+                    t.printStackTrace();
+                }
+            }
+        }
+    }
+    
+    public void register(Receiver r) {
+        synchronized(clients) {
+            clients.add(r);
+        }
+    }
+    
+    public void unregister(Receiver r) {
+        synchronized (clients) {
+            clients.remove(r);
+        }
+    }
+    
+    void handleLine(String s) {
+        System.out.println("S: " + s);
+        
+        String[] bits = decodeLine(s);
+        
+        /*
+         * Flattering child you shall know me,
+         *   see why in shadow I hide.
+         * Look at your face in the mirror,
+         *   I am there inside!
+         */
+        String meth = bits[0].toUpperCase() + "_handler";
+        Class[] args = { String[].class };
+        
+        try {
+            Method m = this.getClass().getDeclaredMethod(meth, args);
+            m.invoke(this, new Object[] { bits });
+        } catch (NoSuchMethodException e) {}
+          catch (SecurityException e) {
+              System.err.println("Security exception while reflecting, 
shouldn't happen");
+              e.printStackTrace();
+          }
+          catch (IllegalAccessException e) {
+              System.err.println("Access exception while reflecting, shouldn't 
happen");
+              e.printStackTrace();
+          }
+          catch (IllegalArgumentException e) {
+              System.err.println("Argument exception while reflecting, 
shouldn't happen");
+              e.printStackTrace();
+          }
+          catch (InvocationTargetException ie) {
+              ie.getTargetException().printStackTrace();
+          }
+          catch (Throwable t) {
+              System.err.println("WTF, some other kind of exception while 
reflecting:");
+              t.printStackTrace();
+          }
+    }
+    
+    void sendLine(String[] args) {
+        if (current_writer == null) {
+            new Exception("Warn: sendLine with null writer").printStackTrace();
+            return;
+        }
+        current_writer.println(encodeLine(args));
+    }
+    
+    void HAVER_handler(String[] args) {
+        synchronized (lock) {
+            // XXX what if this fails
+            sendLine(new String[] { "IDENT", uid });
+            state = ST_IDENT;
+        }
+    }
+    
+    void HELLO_handler(String[] args) {
+        synchronized (lock) {
+            state = ST_READY;
+        }
+        dispatch(new ConnectMessage(this));
+    }
+    
+    void JOIN_handler(String[] args) {
+        String chan = args[1];
+        String who  = args[2];
+        boolean me  = who.equals(uid);
+        
+        dispatch(new JoinedChannel(this, who, chan, me));
+    }
+    
+    public void join(String channel) {
+        sendLine(new String[] { "JOIN", channel });
+    }
+    
+    void PART_handler(String[] args) {
+        String chan = args[1];
+        String who  = args[2];
+        boolean me  = who.equals(uid);
+        
+        dispatch(new PartedChannel(this, who, chan, me));
+    }
+    
+    public void part(String channel) {
+        sendLine(new String[] { "PART", channel });
+    }
+    
+    void PING_handler(String[] args) {
+        String[] response = { "PONG", args[1] };
+        sendLine(response);
+    }
+}


Property changes on: trunk/clients/javer3/Javer3/src/javer3/HaverClient.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/src/javer3/Main.java
===================================================================
--- trunk/clients/javer3/Javer3/src/javer3/Main.java    2005-11-14 04:23:17 UTC 
(rev 919)
+++ trunk/clients/javer3/Javer3/src/javer3/Main.java    2005-11-14 21:28:46 UTC 
(rev 920)
@@ -0,0 +1,43 @@
+/*
+ * Main.java
+ *
+ * Created on November 13, 2005, 11:24 PM
+ *
+ * To change this template, choose Tools | Options and locate the template 
under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package javer3;
+
+/**
+ *
+ * @author bdonlan
+ */
+public class Main implements Receiver {
+    
+    HaverClient cli;
+    
+    public void dispatchMessage(Message m) {
+        System.out.println("MSG: " + m.toString());
+        if (m instanceof ConnectMessage) {
+            cli.join("lobby");
+        }
+    }
+    
+    /** Creates a new instance of Main */
+    public Main() {
+        cli = new HaverClient();
+        cli.register(this);
+        cli.connect("hardison.net", 7575, "JaverTest");
+    }
+    
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        // TODO code application logic here
+        new Main();
+    }
+    
+}


Property changes on: trunk/clients/javer3/Javer3/src/javer3/Main.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/src/javer3/Message.java
===================================================================
--- trunk/clients/javer3/Javer3/src/javer3/Message.java 2005-11-14 04:23:17 UTC 
(rev 919)
+++ trunk/clients/javer3/Javer3/src/javer3/Message.java 2005-11-14 21:28:46 UTC 
(rev 920)
@@ -0,0 +1,111 @@
+/*
+ * Message.java
+ *
+ * Created on November 13, 2005, 11:31 PM
+ *
+ * To change this template, choose Tools | Options and locate the template 
under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package javer3;
+import java.io.IOException;
+
+/**
+ *
+ * @author bdonlan
+ */
+public abstract class Message {
+    private HaverClient _src;
+    Message(HaverClient src) { _src = src; }
+    
+    public final HaverClient getMessageSource() { return _src; }
+}
+
+class ConnectMessage extends Message {
+    ConnectMessage(HaverClient src) { super(src); }
+}
+
+class ConnectFailed extends Message {
+    ConnectFailed(HaverClient src) { super(src); }
+}
+
+class ConnectIOException extends ConnectFailed {
+    private IOException _e;
+    
+    ConnectIOException(HaverClient src, IOException e) {
+        super(src); _e = e;
+    }
+    
+    public IOException getException() { return _e; }
+}
+
+class ConnectRejected extends ConnectFailed {
+    private String _type;
+    ConnectRejected(HaverClient src, String type) {
+        super(src); _type = type;
+    }
+    
+    public String getType() { return _type; }
+}
+
+class DisconnectMessage extends Message {
+    DisconnectMessage(HaverClient src) { super(src); }
+}
+
+class GracefulDisconnect extends DisconnectMessage {
+    GracefulDisconnect(HaverClient src) { super(src); }
+}
+
+class ServerDisconnect extends DisconnectMessage {
+    private String _type, _detail;
+    
+    ServerDisconnect(HaverClient src, String type, String detail) {
+        super(src);
+        _type = type;
+        _detail = detail;
+    }
+    
+    public String getType() { return _type; }
+    public String getDetail() { return _detail; }
+}
+
+class ExceptionDisconnect extends DisconnectMessage {
+    IOException _e;
+    
+    ExceptionDisconnect(HaverClient src, IOException e) { super(src); _e = e; }
+    public IOException getException() { return _e; }
+}
+
+
+class JoinedChannel extends Message {
+    String who, where;
+    boolean me;
+    
+    JoinedChannel(HaverClient src, String _who, String _where, boolean _me) {
+        super(src);
+        who = _who;
+        where = _where;
+        me = _me;
+    }
+    
+    public String getWho() { return who; }
+    public String getWhere() { return where; }
+    public boolean isMe() { return me; }
+}
+
+class PartedChannel extends Message {
+    String who, where;
+    boolean me;
+    
+    PartedChannel(HaverClient src, String _who, String _where, boolean _me) {
+        super(src);
+        who = _who;
+        where = _where;
+        me = _me;
+    }
+    
+    public String getWho() { return who; }
+    public String getWhere() { return where; }
+    public boolean isMe() { return me; }
+}
\ No newline at end of file


Property changes on: trunk/clients/javer3/Javer3/src/javer3/Message.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/src/javer3/ObjectQueue.java
===================================================================
--- trunk/clients/javer3/Javer3/src/javer3/ObjectQueue.java     2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/src/javer3/ObjectQueue.java     2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,59 @@
+/*
+ * ObjectQueue.java
+ *
+ * Created on May 27, 2005, 3:03 PM
+ */
+
+package javer3;
+import java.util.*;
+
+/**
+ *
+ * @author bdonlan
+ */
+public class ObjectQueue {
+    LinkedList theQueue = new LinkedList();
+    
+    /** Creates a new instance of ObjectQueue */
+    public ObjectQueue() {
+    }
+    
+    public Object block(long millis) throws InterruptedException {
+        synchronized (theQueue) {
+            if (theQueue.isEmpty()) {
+                theQueue.wait(millis);
+            }
+            if (theQueue.isEmpty()) {
+                System.err.println("ObjectQueue: Awakened with nothing to show 
for it...");
+                return null;
+            }
+            Object o = theQueue.removeFirst();
+            return o;
+        }
+    }
+    
+    public Object block() throws InterruptedException {
+        return block(0);
+    }
+    
+    public boolean hasData() {
+        synchronized (theQueue) {
+            return !theQueue.isEmpty();
+        }
+    }
+    
+    public Object poll() {
+        synchronized (theQueue) {
+            if (theQueue.isEmpty())
+                return null;
+            return theQueue.removeFirst();
+        }
+    }
+    
+    public void post(Object o) {
+        synchronized (theQueue) {
+            theQueue.addLast(o);
+            theQueue.notify();
+        }
+    }
+}


Property changes on: trunk/clients/javer3/Javer3/src/javer3/ObjectQueue.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/clients/javer3/Javer3/src/javer3/Receiver.java
===================================================================
--- trunk/clients/javer3/Javer3/src/javer3/Receiver.java        2005-11-14 
04:23:17 UTC (rev 919)
+++ trunk/clients/javer3/Javer3/src/javer3/Receiver.java        2005-11-14 
21:28:46 UTC (rev 920)
@@ -0,0 +1,19 @@
+/*
+ * Receiver.java
+ *
+ * Created on November 14, 2005, 12:21 AM
+ *
+ * To change this template, choose Tools | Options and locate the template 
under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package javer3;
+
+/**
+ *
+ * @author bdonlan
+ */
+public interface Receiver {
+    public void dispatchMessage(Message m);
+}


Property changes on: trunk/clients/javer3/Javer3/src/javer3/Receiver.java
___________________________________________________________________
Name: svn:eol-style
   + native


Reply via email to