Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

jredis atuo reconnect after lose the connect.

  • Loading branch information...
commit bb062bcc5aacebee40539b89becf0b197f5cf03c 0 parents
arden authored
74 build.xml
... ... @@ -0,0 +1,74 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!-- You may freely edit this file. See commented blocks below for -->
  3 +<!-- some examples of how to customize the build. -->
  4 +<!-- (If you delete it and reopen the project it will be recreated.) -->
  5 +<!-- By default, only the Clean and Build commands use this build script. -->
  6 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
  7 +<!-- the Compile on Save feature is turned off for the project. -->
  8 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  9 +<!-- in the project's Project Properties dialog box.-->
  10 +<project name="jredis-auto-connect" default="default" basedir=".">
  11 + <description>Builds, tests, and runs the project jredis-auto-connect.</description>
  12 + <import file="nbproject/build-impl.xml"/>
  13 + <!--
  14 +
  15 + There exist several targets which are by default empty and which can be
  16 + used for execution of your tasks. These targets are usually executed
  17 + before and after some main targets. They are:
  18 +
  19 + -pre-init: called before initialization of project properties
  20 + -post-init: called after initialization of project properties
  21 + -pre-compile: called before javac compilation
  22 + -post-compile: called after javac compilation
  23 + -pre-compile-single: called before javac compilation of single file
  24 + -post-compile-single: called after javac compilation of single file
  25 + -pre-compile-test: called before javac compilation of JUnit tests
  26 + -post-compile-test: called after javac compilation of JUnit tests
  27 + -pre-compile-test-single: called before javac compilation of single JUnit test
  28 + -post-compile-test-single: called after javac compilation of single JUunit test
  29 + -pre-jar: called before JAR building
  30 + -post-jar: called after JAR building
  31 + -post-clean: called after cleaning build products
  32 +
  33 + (Targets beginning with '-' are not intended to be called on their own.)
  34 +
  35 + Example of inserting an obfuscator after compilation could look like this:
  36 +
  37 + <target name="-post-compile">
  38 + <obfuscate>
  39 + <fileset dir="${build.classes.dir}"/>
  40 + </obfuscate>
  41 + </target>
  42 +
  43 + For list of available properties check the imported
  44 + nbproject/build-impl.xml file.
  45 +
  46 +
  47 + Another way to customize the build is by overriding existing main targets.
  48 + The targets of interest are:
  49 +
  50 + -init-macrodef-javac: defines macro for javac compilation
  51 + -init-macrodef-junit: defines macro for junit execution
  52 + -init-macrodef-debug: defines macro for class debugging
  53 + -init-macrodef-java: defines macro for class execution
  54 + -do-jar-with-manifest: JAR building (if you are using a manifest)
  55 + -do-jar-without-manifest: JAR building (if you are not using a manifest)
  56 + run: execution of project
  57 + -javadoc-build: Javadoc generation
  58 + test-report: JUnit report generation
  59 +
  60 + An example of overriding the target for project execution could look like this:
  61 +
  62 + <target name="run" depends="jredis-auto-connect-impl.jar">
  63 + <exec dir="bin" executable="launcher.exe">
  64 + <arg file="${dist.jar}"/>
  65 + </exec>
  66 + </target>
  67 +
  68 + Notice that the overridden target depends on the jar target and not only on
  69 + the compile target as the regular run target does. Again, for a list of available
  70 + properties which you can use, check the target you are overriding in the
  71 + nbproject/build-impl.xml file.
  72 +
  73 + -->
  74 +</project>
BIN  lib/jrails-1.0.jar
Binary file not shown
BIN  lib/jredis-core-all-1.0-rc1-jar-with-dependencies.jar
Binary file not shown
3  manifest.mf
... ... @@ -0,0 +1,3 @@
  1 +Manifest-Version: 1.0
  2 +X-COMMENT: Main-Class will be added automatically by build
  3 +
883 nbproject/build-impl.xml
... ... @@ -0,0 +1,883 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 +*** GENERATED FROM project.xml - DO NOT EDIT ***
  4 +*** EDIT ../build.xml INSTEAD ***
  5 +
  6 +For the purpose of easier reading the script
  7 +is divided into following sections:
  8 +
  9 + - initialization
  10 + - compilation
  11 + - jar
  12 + - execution
  13 + - debugging
  14 + - javadoc
  15 + - junit compilation
  16 + - junit execution
  17 + - junit debugging
  18 + - applet
  19 + - cleanup
  20 +
  21 + -->
  22 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jredis-auto-connect-impl">
  23 + <fail message="Please build using Ant 1.7.1 or higher.">
  24 + <condition>
  25 + <not>
  26 + <antversion atleast="1.7.1"/>
  27 + </not>
  28 + </condition>
  29 + </fail>
  30 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  31 + <!--
  32 + ======================
  33 + INITIALIZATION SECTION
  34 + ======================
  35 + -->
  36 + <target name="-pre-init">
  37 + <!-- Empty placeholder for easier customization. -->
  38 + <!-- You can override this target in the ../build.xml file. -->
  39 + </target>
  40 + <target depends="-pre-init" name="-init-private">
  41 + <property file="nbproject/private/config.properties"/>
  42 + <property file="nbproject/private/configs/${config}.properties"/>
  43 + <property file="nbproject/private/private.properties"/>
  44 + </target>
  45 + <target depends="-pre-init,-init-private" name="-init-user">
  46 + <property file="${user.properties.file}"/>
  47 + <!-- The two properties below are usually overridden -->
  48 + <!-- by the active platform. Just a fallback. -->
  49 + <property name="default.javac.source" value="1.4"/>
  50 + <property name="default.javac.target" value="1.4"/>
  51 + </target>
  52 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
  53 + <property file="nbproject/configs/${config}.properties"/>
  54 + <property file="nbproject/project.properties"/>
  55 + </target>
  56 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  57 + <available file="${manifest.file}" property="manifest.available"/>
  58 + <available file="${application.splash}" property="splashscreen.available"/>
  59 + <condition property="main.class.available">
  60 + <and>
  61 + <isset property="main.class"/>
  62 + <not>
  63 + <equals arg1="${main.class}" arg2="" trim="true"/>
  64 + </not>
  65 + </and>
  66 + </condition>
  67 + <condition property="manifest.available+main.class">
  68 + <and>
  69 + <isset property="manifest.available"/>
  70 + <isset property="main.class.available"/>
  71 + </and>
  72 + </condition>
  73 + <condition property="do.mkdist">
  74 + <and>
  75 + <isset property="libs.CopyLibs.classpath"/>
  76 + <not>
  77 + <istrue value="${mkdist.disabled}"/>
  78 + </not>
  79 + </and>
  80 + </condition>
  81 + <condition property="manifest.available+main.class+mkdist.available">
  82 + <and>
  83 + <istrue value="${manifest.available+main.class}"/>
  84 + <isset property="do.mkdist"/>
  85 + </and>
  86 + </condition>
  87 + <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
  88 + <and>
  89 + <istrue value="${manifest.available+main.class+mkdist.available}"/>
  90 + <istrue value="${splashscreen.available}"/>
  91 + </and>
  92 + </condition>
  93 + <condition property="do.archive">
  94 + <not>
  95 + <istrue value="${jar.archive.disabled}"/>
  96 + </not>
  97 + </condition>
  98 + <condition property="do.archive+manifest.available">
  99 + <and>
  100 + <isset property="manifest.available"/>
  101 + <istrue value="${do.archive}"/>
  102 + </and>
  103 + </condition>
  104 + <condition property="do.archive+manifest.available+main.class">
  105 + <and>
  106 + <istrue value="${manifest.available+main.class}"/>
  107 + <istrue value="${do.archive}"/>
  108 + </and>
  109 + </condition>
  110 + <condition property="do.archive+manifest.available+main.class+mkdist.available">
  111 + <and>
  112 + <istrue value="${manifest.available+main.class+mkdist.available}"/>
  113 + <istrue value="${do.archive}"/>
  114 + </and>
  115 + </condition>
  116 + <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
  117 + <and>
  118 + <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
  119 + <istrue value="${do.archive}"/>
  120 + </and>
  121 + </condition>
  122 + <condition property="have.tests">
  123 + <or>
  124 + <available file="${test.src.dir}"/>
  125 + </or>
  126 + </condition>
  127 + <condition property="have.sources">
  128 + <or>
  129 + <available file="${src.dir}"/>
  130 + </or>
  131 + </condition>
  132 + <condition property="netbeans.home+have.tests">
  133 + <and>
  134 + <isset property="netbeans.home"/>
  135 + <isset property="have.tests"/>
  136 + </and>
  137 + </condition>
  138 + <condition property="no.javadoc.preview">
  139 + <and>
  140 + <isset property="javadoc.preview"/>
  141 + <isfalse value="${javadoc.preview}"/>
  142 + </and>
  143 + </condition>
  144 + <property name="run.jvmargs" value=""/>
  145 + <property name="javac.compilerargs" value=""/>
  146 + <property name="work.dir" value="${basedir}"/>
  147 + <condition property="no.deps">
  148 + <and>
  149 + <istrue value="${no.dependencies}"/>
  150 + </and>
  151 + </condition>
  152 + <property name="javac.debug" value="true"/>
  153 + <property name="javadoc.preview" value="true"/>
  154 + <property name="application.args" value=""/>
  155 + <property name="source.encoding" value="${file.encoding}"/>
  156 + <property name="runtime.encoding" value="${source.encoding}"/>
  157 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  158 + <and>
  159 + <isset property="javadoc.encoding"/>
  160 + <not>
  161 + <equals arg1="${javadoc.encoding}" arg2=""/>
  162 + </not>
  163 + </and>
  164 + </condition>
  165 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
  166 + <property name="includes" value="**"/>
  167 + <property name="excludes" value=""/>
  168 + <property name="do.depend" value="false"/>
  169 + <condition property="do.depend.true">
  170 + <istrue value="${do.depend}"/>
  171 + </condition>
  172 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  173 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  174 + <length length="0" string="${endorsed.classpath}" when="greater"/>
  175 + </condition>
  176 + <property name="javac.fork" value="false"/>
  177 + <property name="jar.index" value="false"/>
  178 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  179 + </target>
  180 + <target name="-post-init">
  181 + <!-- Empty placeholder for easier customization. -->
  182 + <!-- You can override this target in the ../build.xml file. -->
  183 + </target>
  184 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
  185 + <fail unless="src.dir">Must set src.dir</fail>
  186 + <fail unless="test.src.dir">Must set test.src.dir</fail>
  187 + <fail unless="build.dir">Must set build.dir</fail>
  188 + <fail unless="dist.dir">Must set dist.dir</fail>
  189 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  190 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  191 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  192 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  193 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  194 + <fail unless="dist.jar">Must set dist.jar</fail>
  195 + </target>
  196 + <target name="-init-macrodef-property">
  197 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  198 + <attribute name="name"/>
  199 + <attribute name="value"/>
  200 + <sequential>
  201 + <property name="@{name}" value="${@{value}}"/>
  202 + </sequential>
  203 + </macrodef>
  204 + </target>
  205 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  206 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  207 + <attribute default="${src.dir}" name="srcdir"/>
  208 + <attribute default="${build.classes.dir}" name="destdir"/>
  209 + <attribute default="${javac.classpath}" name="classpath"/>
  210 + <attribute default="${javac.processorpath}" name="processorpath"/>
  211 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  212 + <attribute default="${includes}" name="includes"/>
  213 + <attribute default="${excludes}" name="excludes"/>
  214 + <attribute default="${javac.debug}" name="debug"/>
  215 + <attribute default="${empty.dir}" name="sourcepath"/>
  216 + <attribute default="${empty.dir}" name="gensrcdir"/>
  217 + <element name="customize" optional="true"/>
  218 + <sequential>
  219 + <property location="${build.dir}/empty" name="empty.dir"/>
  220 + <mkdir dir="${empty.dir}"/>
  221 + <mkdir dir="@{apgeneratedsrcdir}"/>
  222 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  223 + <src>
  224 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  225 + <include name="*"/>
  226 + </dirset>
  227 + </src>
  228 + <classpath>
  229 + <path path="@{classpath}"/>
  230 + </classpath>
  231 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  232 + <compilerarg line="${javac.compilerargs}"/>
  233 + <compilerarg value="-processorpath"/>
  234 + <compilerarg path="@{processorpath}:${empty.dir}"/>
  235 + <compilerarg line="${ap.processors.internal}"/>
  236 + <compilerarg line="${annotation.processing.processor.options}"/>
  237 + <compilerarg value="-s"/>
  238 + <compilerarg path="@{apgeneratedsrcdir}"/>
  239 + <compilerarg line="${ap.proc.none.internal}"/>
  240 + <customize/>
  241 + </javac>
  242 + </sequential>
  243 + </macrodef>
  244 + </target>
  245 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  246 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  247 + <attribute default="${src.dir}" name="srcdir"/>
  248 + <attribute default="${build.classes.dir}" name="destdir"/>
  249 + <attribute default="${javac.classpath}" name="classpath"/>
  250 + <attribute default="${javac.processorpath}" name="processorpath"/>
  251 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  252 + <attribute default="${includes}" name="includes"/>
  253 + <attribute default="${excludes}" name="excludes"/>
  254 + <attribute default="${javac.debug}" name="debug"/>
  255 + <attribute default="${empty.dir}" name="sourcepath"/>
  256 + <attribute default="${empty.dir}" name="gensrcdir"/>
  257 + <element name="customize" optional="true"/>
  258 + <sequential>
  259 + <property location="${build.dir}/empty" name="empty.dir"/>
  260 + <mkdir dir="${empty.dir}"/>
  261 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  262 + <src>
  263 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  264 + <include name="*"/>
  265 + </dirset>
  266 + </src>
  267 + <classpath>
  268 + <path path="@{classpath}"/>
  269 + </classpath>
  270 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  271 + <compilerarg line="${javac.compilerargs}"/>
  272 + <customize/>
  273 + </javac>
  274 + </sequential>
  275 + </macrodef>
  276 + </target>
  277 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  278 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  279 + <attribute default="${src.dir}" name="srcdir"/>
  280 + <attribute default="${build.classes.dir}" name="destdir"/>
  281 + <attribute default="${javac.classpath}" name="classpath"/>
  282 + <sequential>
  283 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  284 + <classpath>
  285 + <path path="@{classpath}"/>
  286 + </classpath>
  287 + </depend>
  288 + </sequential>
  289 + </macrodef>
  290 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  291 + <attribute default="${build.classes.dir}" name="destdir"/>
  292 + <sequential>
  293 + <fail unless="javac.includes">Must set javac.includes</fail>
  294 + <pathconvert pathsep="," property="javac.includes.binary">
  295 + <path>
  296 + <filelist dir="@{destdir}" files="${javac.includes}"/>
  297 + </path>
  298 + <globmapper from="*.java" to="*.class"/>
  299 + </pathconvert>
  300 + <delete>
  301 + <files includes="${javac.includes.binary}"/>
  302 + </delete>
  303 + </sequential>
  304 + </macrodef>
  305 + </target>
  306 + <target name="-init-macrodef-junit">
  307 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  308 + <attribute default="${includes}" name="includes"/>
  309 + <attribute default="${excludes}" name="excludes"/>
  310 + <attribute default="**" name="testincludes"/>
  311 + <sequential>
  312 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
  313 + <batchtest todir="${build.test.results.dir}">
  314 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  315 + <filename name="@{testincludes}"/>
  316 + </fileset>
  317 + </batchtest>
  318 + <classpath>
  319 + <path path="${run.test.classpath}"/>
  320 + </classpath>
  321 + <syspropertyset>
  322 + <propertyref prefix="test-sys-prop."/>
  323 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
  324 + </syspropertyset>
  325 + <formatter type="brief" usefile="false"/>
  326 + <formatter type="xml"/>
  327 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  328 + <jvmarg line="${run.jvmargs}"/>
  329 + </junit>
  330 + </sequential>
  331 + </macrodef>
  332 + </target>
  333 + <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  334 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  335 + <attribute default="${main.class}" name="name"/>
  336 + <attribute default="${debug.classpath}" name="classpath"/>
  337 + <attribute default="" name="stopclassname"/>
  338 + <sequential>
  339 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  340 + <classpath>
  341 + <path path="@{classpath}"/>
  342 + </classpath>
  343 + </nbjpdastart>
  344 + </sequential>
  345 + </macrodef>
  346 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  347 + <attribute default="${build.classes.dir}" name="dir"/>
  348 + <sequential>
  349 + <nbjpdareload>
  350 + <fileset dir="@{dir}" includes="${fix.classes}">
  351 + <include name="${fix.includes}*.class"/>
  352 + </fileset>
  353 + </nbjpdareload>
  354 + </sequential>
  355 + </macrodef>
  356 + </target>
  357 + <target name="-init-debug-args">
  358 + <property name="version-output" value="java version &quot;${ant.java.version}"/>
  359 + <condition property="have-jdk-older-than-1.4">
  360 + <or>
  361 + <contains string="${version-output}" substring="java version &quot;1.0"/>
  362 + <contains string="${version-output}" substring="java version &quot;1.1"/>
  363 + <contains string="${version-output}" substring="java version &quot;1.2"/>
  364 + <contains string="${version-output}" substring="java version &quot;1.3"/>
  365 + </or>
  366 + </condition>
  367 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  368 + <istrue value="${have-jdk-older-than-1.4}"/>
  369 + </condition>
  370 + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  371 + <os family="windows"/>
  372 + </condition>
  373 + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  374 + <isset property="debug.transport"/>
  375 + </condition>
  376 + </target>
  377 + <target depends="-init-debug-args" name="-init-macrodef-debug">
  378 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  379 + <attribute default="${main.class}" name="classname"/>
  380 + <attribute default="${debug.classpath}" name="classpath"/>
  381 + <element name="customize" optional="true"/>
  382 + <sequential>
  383 + <java classname="@{classname}" dir="${work.dir}" fork="true">
  384 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  385 + <jvmarg line="${debug-args-line}"/>
  386 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  387 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  388 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  389 + <jvmarg line="${run.jvmargs}"/>
  390 + <classpath>
  391 + <path path="@{classpath}"/>
  392 + </classpath>
  393 + <syspropertyset>
  394 + <propertyref prefix="run-sys-prop."/>
  395 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
  396 + </syspropertyset>
  397 + <customize/>
  398 + </java>
  399 + </sequential>
  400 + </macrodef>
  401 + </target>
  402 + <target name="-init-macrodef-java">
  403 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  404 + <attribute default="${main.class}" name="classname"/>
  405 + <attribute default="${run.classpath}" name="classpath"/>
  406 + <element name="customize" optional="true"/>
  407 + <sequential>
  408 + <java classname="@{classname}" dir="${work.dir}" fork="true">
  409 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  410 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  411 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  412 + <jvmarg line="${run.jvmargs}"/>
  413 + <classpath>
  414 + <path path="@{classpath}"/>
  415 + </classpath>
  416 + <syspropertyset>
  417 + <propertyref prefix="run-sys-prop."/>
  418 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
  419 + </syspropertyset>
  420 + <customize/>
  421 + </java>
  422 + </sequential>
  423 + </macrodef>
  424 + </target>
  425 + <target name="-init-macrodef-copylibs">
  426 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  427 + <element name="customize" optional="true"/>
  428 + <sequential>
  429 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  430 + <pathconvert property="run.classpath.without.build.classes.dir">
  431 + <path path="${run.classpath}"/>
  432 + <map from="${build.classes.dir.resolved}" to=""/>
  433 + </pathconvert>
  434 + <pathconvert pathsep=" " property="jar.classpath">
  435 + <path path="${run.classpath.without.build.classes.dir}"/>
  436 + <chainedmapper>
  437 + <flattenmapper/>
  438 + <globmapper from="*" to="lib/*"/>
  439 + </chainedmapper>
  440 + </pathconvert>
  441 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  442 + <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  443 + <fileset dir="${build.classes.dir}"/>
  444 + <manifest>
  445 + <attribute name="Class-Path" value="${jar.classpath}"/>
  446 + <customize/>
  447 + </manifest>
  448 + </copylibs>
  449 + </sequential>
  450 + </macrodef>
  451 + </target>
  452 + <target name="-init-presetdef-jar">
  453 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  454 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  455 + <j2seproject1:fileset dir="${build.classes.dir}"/>
  456 + </jar>
  457 + </presetdef>
  458 + </target>
  459 + <target name="-init-ap-cmdline-properties">
  460 + <property name="annotation.processing.enabled" value="true"/>
  461 + <property name="annotation.processing.processors.list" value=""/>
  462 + <property name="annotation.processing.processor.options" value=""/>
  463 + <property name="annotation.processing.run.all.processors" value="true"/>
  464 + <property name="javac.processorpath" value="${javac.classpath}"/>
  465 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  466 + <condition property="ap.supported.internal" value="true">
  467 + <not>
  468 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  469 + </not>
  470 + </condition>
  471 + </target>
  472 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  473 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  474 + <isfalse value="${annotation.processing.run.all.processors}"/>
  475 + </condition>
  476 + <condition else="" property="ap.proc.none.internal" value="-proc:none">
  477 + <isfalse value="${annotation.processing.enabled}"/>
  478 + </condition>
  479 + </target>
  480 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  481 + <property name="ap.cmd.line.internal" value=""/>
  482 + </target>
  483 + <target 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,-init-ap-cmdline" name="init"/>
  484 + <!--
  485 + ===================
  486 + COMPILATION SECTION
  487 + ===================
  488 + -->
  489 + <target name="-deps-jar-init" unless="built-jar.properties">
  490 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  491 + <delete file="${built-jar.properties}" quiet="true"/>
  492 + </target>
  493 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  494 + <echo level="warn" message="Cycle detected: jredis-auto-connect was already built"/>
  495 + </target>
  496 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  497 + <mkdir dir="${build.dir}"/>
  498 + <touch file="${built-jar.properties}" verbose="false"/>
  499 + <property file="${built-jar.properties}" prefix="already.built.jar."/>
  500 + <antcall target="-warn-already-built-jar"/>
  501 + <propertyfile file="${built-jar.properties}">
  502 + <entry key="${basedir}" value=""/>
  503 + </propertyfile>
  504 + </target>
  505 + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  506 + <target depends="init" name="-check-automatic-build">
  507 + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  508 + </target>
  509 + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  510 + <antcall target="clean"/>
  511 + </target>
  512 + <target depends="init,deps-jar" name="-pre-pre-compile">
  513 + <mkdir dir="${build.classes.dir}"/>
  514 + </target>
  515 + <target name="-pre-compile">
  516 + <!-- Empty placeholder for easier customization. -->
  517 + <!-- You can override this target in the ../build.xml file. -->
  518 + </target>
  519 + <target if="do.depend.true" name="-compile-depend">
  520 + <pathconvert property="build.generated.subdirs">
  521 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  522 + <include name="*"/>
  523 + </dirset>
  524 + </pathconvert>
  525 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  526 + </target>
  527 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  528 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  529 + <copy todir="${build.classes.dir}">
  530 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  531 + </copy>
  532 + </target>
  533 + <target if="has.persistence.xml" name="-copy-persistence-xml">
  534 + <mkdir dir="${build.classes.dir}/META-INF"/>
  535 + <copy todir="${build.classes.dir}/META-INF">
  536 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
  537 + </copy>
  538 + </target>
  539 + <target name="-post-compile">
  540 + <!-- Empty placeholder for easier customization. -->
  541 + <!-- You can override this target in the ../build.xml file. -->
  542 + </target>
  543 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  544 + <target name="-pre-compile-single">
  545 + <!-- Empty placeholder for easier customization. -->
  546 + <!-- You can override this target in the ../build.xml file. -->
  547 + </target>
  548 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  549 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  550 + <j2seproject3:force-recompile/>
  551 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  552 + </target>
  553 + <target name="-post-compile-single">
  554 + <!-- Empty placeholder for easier customization. -->
  555 + <!-- You can override this target in the ../build.xml file. -->
  556 + </target>
  557 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  558 + <!--
  559 + ====================
  560 + JAR BUILDING SECTION
  561 + ====================
  562 + -->
  563 + <target depends="init" name="-pre-pre-jar">
  564 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
  565 + <mkdir dir="${dist.jar.dir}"/>
  566 + </target>
  567 + <target name="-pre-jar">
  568 + <!-- Empty placeholder for easier customization. -->
  569 + <!-- You can override this target in the ../build.xml file. -->
  570 + </target>
  571 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
  572 + <j2seproject1:jar/>
  573 + </target>
  574 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
  575 + <j2seproject1:jar manifest="${manifest.file}"/>
  576 + </target>
  577 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  578 + <j2seproject1:jar manifest="${manifest.file}">
  579 + <j2seproject1:manifest>
  580 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  581 + </j2seproject1:manifest>
  582 + </j2seproject1:jar>
  583 + <echo>To run this application from the command line without Ant, try:</echo>
  584 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  585 + <property location="${dist.jar}" name="dist.jar.resolved"/>
  586 + <pathconvert property="run.classpath.with.dist.jar">
  587 + <path path="${run.classpath}"/>
  588 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  589 + </pathconvert>
  590 + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  591 + </target>
  592 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
  593 + <basename file="${application.splash}" property="splashscreen.basename"/>
  594 + <mkdir dir="${build.classes.dir}/META-INF"/>
  595 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  596 + <j2seproject3:copylibs>
  597 + <customize>
  598 + <attribute name="Main-Class" value="${main.class}"/>
  599 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  600 + </customize>
  601 + </j2seproject3:copylibs>
  602 + <echo>To run this application from the command line without Ant, try:</echo>
  603 + <property location="${dist.jar}" name="dist.jar.resolved"/>
  604 + <echo>java -jar "${dist.jar.resolved}"</echo>
  605 + </target>
  606 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
  607 + <j2seproject3:copylibs>
  608 + <customize>
  609 + <attribute name="Main-Class" value="${main.class}"/>
  610 + </customize>
  611 + </j2seproject3:copylibs>
  612 + <echo>To run this application from the command line without Ant, try:</echo>
  613 + <property location="${dist.jar}" name="dist.jar.resolved"/>
  614 + <echo>java -jar "${dist.jar.resolved}"</echo>
  615 + </target>
  616 + <target name="-post-jar">
  617 + <!-- Empty placeholder for easier customization. -->
  618 + <!-- You can override this target in the ../build.xml file. -->
  619 + </target>
  620 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  621 + <!--
  622 + =================
  623 + EXECUTION SECTION
  624 + =================
  625 + -->
  626 + <target depends="init,compile" description="Run a main class." name="run">
  627 + <j2seproject1:java>
  628 + <customize>
  629 + <arg line="${application.args}"/>
  630 + </customize>
  631 + </j2seproject1:java>
  632 + </target>
  633 + <target name="-do-not-recompile">
  634 + <property name="javac.includes.binary" value=""/>
  635 + </target>
  636 + <target depends="init,compile-single" name="run-single">
  637 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  638 + <j2seproject1:java classname="${run.class}"/>
  639 + </target>
  640 + <target depends="init,compile-test-single" name="run-test-with-main">
  641 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  642 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  643 + </target>
  644 + <!--
  645 + =================
  646 + DEBUGGING SECTION
  647 + =================
  648 + -->
  649 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  650 + <j2seproject1:nbjpdastart name="${debug.class}"/>
  651 + </target>
  652 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  653 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  654 + </target>
  655 + <target depends="init,compile" name="-debug-start-debuggee">
  656 + <j2seproject3:debug>
  657 + <customize>
  658 + <arg line="${application.args}"/>
  659 + </customize>
  660 + </j2seproject3:debug>
  661 + </target>
  662 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  663 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  664 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  665 + </target>
  666 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  667 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  668 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  669 + <j2seproject3:debug classname="${debug.class}"/>
  670 + </target>
  671 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  672 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  673 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  674 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  675 + </target>
  676 + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  677 + <target depends="init" name="-pre-debug-fix">
  678 + <fail unless="fix.includes">Must set fix.includes</fail>
  679 + <property name="javac.includes" value="${fix.includes}.java"/>
  680 + </target>
  681 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  682 + <j2seproject1:nbjpdareload/>
  683 + </target>
  684 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  685 + <!--
  686 + ===============
  687 + JAVADOC SECTION
  688 + ===============
  689 + -->
  690 + <target depends="init" if="have.sources" name="-javadoc-build">
  691 + <mkdir dir="${dist.javadoc.dir}"/>
  692 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  693 + <classpath>
  694 + <path path="${javac.classpath}"/>
  695 + </classpath>
  696 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  697 + <filename name="**/*.java"/>
  698 + </fileset>
  699 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  700 + <include name="**/*.java"/>
  701 + </fileset>
  702 + </javadoc>
  703 + </target>
  704 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  705 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  706 + </target>
  707 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  708 + <!--
  709 + =========================
  710 + JUNIT COMPILATION SECTION
  711 + =========================
  712 + -->
  713 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  714 + <mkdir dir="${build.test.classes.dir}"/>
  715 + </target>
  716 + <target name="-pre-compile-test">
  717 + <!-- Empty placeholder for easier customization. -->
  718 + <!-- You can override this target in the ../build.xml file. -->
  719 + </target>
  720 + <target if="do.depend.true" name="-compile-test-depend">
  721 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  722 + </target>
  723 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  724 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  725 + <copy todir="${build.test.classes.dir}">
  726 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  727 + </copy>
  728 + </target>
  729 + <target name="-post-compile-test">
  730 + <!-- Empty placeholder for easier customization. -->
  731 + <!-- You can override this target in the ../build.xml file. -->
  732 + </target>
  733 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  734 + <target name="-pre-compile-test-single">
  735 + <!-- Empty placeholder for easier customization. -->
  736 + <!-- You can override this target in the ../build.xml file. -->
  737 + </target>
  738 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  739 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  740 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  741 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  742 + <copy todir="${build.test.classes.dir}">
  743 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  744 + </copy>
  745 + </target>
  746 + <target name="-post-compile-test-single">
  747 + <!-- Empty placeholder for easier customization. -->
  748 + <!-- You can override this target in the ../build.xml file. -->
  749 + </target>
  750 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  751 + <!--
  752 + =======================
  753 + JUNIT EXECUTION SECTION
  754 + =======================
  755 + -->
  756 + <target depends="init" if="have.tests" name="-pre-test-run">
  757 + <mkdir dir="${build.test.results.dir}"/>
  758 + </target>
  759 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  760 + <j2seproject3:junit testincludes="**/*Test.java"/>
  761 + </target>
  762 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  763 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  764 + </target>
  765 + <target depends="init" if="have.tests" name="test-report"/>
  766 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  767 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  768 + <target depends="init" if="have.tests" name="-pre-test-run-single">
  769 + <mkdir dir="${build.test.results.dir}"/>
  770 + </target>
  771 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  772 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  773 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
  774 + </target>
  775 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  776 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  777 + </target>
  778 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  779 + <!--
  780 + =======================
  781 + JUNIT DEBUGGING SECTION
  782 + =======================
  783 + -->
  784 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  785 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  786 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  787 + <delete file="${test.report.file}"/>
  788 + <mkdir dir="${build.test.results.dir}"/>
  789 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  790 + <customize>
  791 + <syspropertyset>
  792 + <propertyref prefix="test-sys-prop."/>
  793 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
  794 + </syspropertyset>
  795 + <arg value="${test.class}"/>
  796 + <arg value="showoutput=true"/>
  797 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  798 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  799 + </customize>
  800 + </j2seproject3:debug>
  801 + </target>
  802 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  803 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  804 + </target>
  805 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  806 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  807 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  808 + </target>
  809 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
  810 + <!--
  811 + =========================
  812 + APPLET EXECUTION SECTION
  813 + =========================
  814 + -->
  815 + <target depends="init,compile-single" name="run-applet">
  816 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  817 + <j2seproject1:java classname="sun.applet.AppletViewer">
  818 + <customize>
  819 + <arg value="${applet.url}"/>
  820 + </customize>
  821 + </j2seproject1:java>
  822 + </target>
  823 + <!--
  824 + =========================
  825 + APPLET DEBUGGING SECTION
  826 + =========================
  827 + -->
  828 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  829 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  830 + <j2seproject3:debug classname="sun.applet.AppletViewer">
  831 + <customize>
  832 + <arg value="${applet.url}"/>
  833 + </customize>
  834 + </j2seproject3:debug>
  835 + </target>
  836 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  837 + <!--
  838 + ===============
  839 + CLEANUP SECTION
  840 + ===============
  841 + -->
  842 + <target name="-deps-clean-init" unless="built-clean.properties">
  843 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  844 + <delete file="${built-clean.properties}" quiet="true"/>
  845 + </target>
  846 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  847 + <echo level="warn" message="Cycle detected: jredis-auto-connect was already built"/>
  848 + </target>
  849 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  850 + <mkdir dir="${build.dir}"/>
  851 + <touch file="${built-clean.properties}" verbose="false"/>
  852 + <property file="${built-clean.properties}" prefix="already.built.clean."/>
  853 + <antcall target="-warn-already-built-clean"/>
  854 + <propertyfile file="${built-clean.properties}">
  855 + <entry key="${basedir}" value=""/>
  856 + </propertyfile>
  857 + </target>
  858 + <target depends="init" name="-do-clean">
  859 + <delete dir="${build.dir}"/>
  860 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  861 + </target>
  862 + <target name="-post-clean">
  863 + <!-- Empty placeholder for easier customization. -->
  864 + <!-- You can override this target in the ../build.xml file. -->
  865 + </target>
  866 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  867 + <target name="-check-call-dep">
  868 + <property file="${call.built.properties}" prefix="already.built."/>
  869 + <condition property="should.call.dep">
  870 + <not>
  871 + <isset property="already.built.${call.subproject}"/>
  872 + </not>
  873 + </condition>
  874 + </target>
  875 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  876 + <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  877 + <propertyset>
  878 + <propertyref prefix="transfer."/>
  879 + <mapper from="transfer.*" to="*" type="glob"/>
  880 + </propertyset>
  881 + </ant>
  882 + </target>
  883 +</project>
8 nbproject/genfiles.properties
... ... @@ -0,0 +1,8 @@
  1 +build.xml.data.CRC32=074da0ae
  2 +build.xml.script.CRC32=b102c1a2
  3 +build.xml.stylesheet.CRC32=28e38971@1.38.1.45
  4 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
  5 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
  6 +nbproject/build-impl.xml.data.CRC32=074da0ae
  7 +nbproject/build-impl.xml.script.CRC32=93195a2d
  8 +nbproject/build-impl.xml.stylesheet.CRC32=78c6a6ee@1.38.1.45
2  nbproject/private/private.properties
... ... @@ -0,0 +1,2 @@
  1 +compile.on.save=true
  2 +user.properties.file=C:\\Users\\arden\\.netbeans\\6.9\\build.properties
76 nbproject/project.properties
... ... @@ -0,0 +1,76 @@
  1 +annotation.processing.enabled=true
  2 +annotation.processing.enabled.in.editor=false
  3 +annotation.processing.processor.options=
  4 +annotation.processing.processors.list=
  5 +annotation.processing.run.all.processors=true
  6 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
  7 +build.classes.dir=${build.dir}/classes
  8 +build.classes.excludes=**/*.java,**/*.form
  9 +# This directory is removed when the project is cleaned:
  10 +build.dir=build
  11 +build.generated.dir=${build.dir}/generated
  12 +build.generated.sources.dir=${build.dir}/generated-sources
  13 +# Only compile against the classpath explicitly listed here:
  14 +build.sysclasspath=ignore
  15 +build.test.classes.dir=${build.dir}/test/classes
  16 +build.test.results.dir=${build.dir}/test/results
  17 +# Uncomment to specify the preferred debugger connection transport:
  18 +#debug.transport=dt_socket
  19 +debug.classpath=\
  20 + ${run.classpath}
  21 +debug.test.classpath=\
  22 + ${run.test.classpath}
  23 +# This directory is removed when the project is cleaned:
  24 +dist.dir=dist
  25 +dist.jar=${dist.dir}/jredis-auto-connect.jar
  26 +dist.javadoc.dir=${dist.dir}/javadoc
  27 +excludes=
  28 +file.reference.jrails-1.0.jar=lib\\jrails-1.0.jar
  29 +file.reference.jredis-core-all-1.0-rc1-jar-with-dependencies.jar=lib\\jredis-core-all-1.0-rc1-jar-with-dependencies.jar
  30 +includes=**
  31 +jar.compress=false
  32 +javac.classpath=\
  33 + ${file.reference.jrails-1.0.jar}:\
  34 + ${file.reference.jredis-core-all-1.0-rc1-jar-with-dependencies.jar}
  35 +# Space-separated list of extra javac options
  36 +javac.compilerargs=
  37 +javac.deprecation=false
  38 +javac.processorpath=\
  39 + ${javac.classpath}
  40 +javac.source=1.5
  41 +javac.target=1.5
  42 +javac.test.classpath=\
  43 + ${javac.classpath}:\
  44 + ${build.classes.dir}:\
  45 + ${libs.junit.classpath}:\
  46 + ${libs.junit_4.classpath}
  47 +javac.test.processorpath=\
  48 + ${javac.test.classpath}
  49 +javadoc.additionalparam=
  50 +javadoc.author=false
  51 +javadoc.encoding=${source.encoding}
  52 +javadoc.noindex=false
  53 +javadoc.nonavbar=false
  54 +javadoc.notree=false
  55 +javadoc.private=false
  56 +javadoc.splitindex=true
  57 +javadoc.use=true
  58 +javadoc.version=false
  59 +javadoc.windowtitle=
  60 +main.class=
  61 +manifest.file=manifest.mf
  62 +meta.inf.dir=${src.dir}/META-INF
  63 +platform.active=default_platform
  64 +run.classpath=\
  65 + ${javac.classpath}:\
  66 + ${build.classes.dir}
  67 +# Space-separated list of JVM arguments used when running the project
  68 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  69 +# or test-sys-prop.name=value to set system properties for unit tests):
  70 +run.jvmargs=
  71 +run.test.classpath=\
  72 + ${javac.test.classpath}:\
  73 + ${build.test.classes.dir}
  74 +source.encoding=UTF-8
  75 +src.dir=src
  76 +test.src.dir=test
15 nbproject/project.xml
... ... @@ -0,0 +1,15 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://www.netbeans.org/ns/project/1">
  3 + <type>org.netbeans.modules.java.j2seproject</type>
  4 + <configuration>
  5 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
  6 + <name>jredis-auto-connect</name>
  7 + <source-roots>
  8 + <root id="src.dir"/>
  9 + </source-roots>
  10 + <test-roots>
  11 + <root id="test.src.dir"/>
  12 + </test-roots>
  13 + </data>
  14 + </configuration>
  15 +</project>
68 src/com/tujiao/jredis/RedisClient.java
... ... @@ -0,0 +1,68 @@
  1 +/*
  2 + * To change this template, choose Tools | Templates
  3 + * and open the template in the editor.
  4 + */
  5 +package com.tujiao.jredis;
  6 +
  7 +import com.jrails.commons.utils.PropertiesUtils;
  8 +import com.jrails.modules.spring.ServiceLocator;
  9 +import org.jredis.ri.alphazero.connection.DefaultConnectionSpec;
  10 +import org.jredis.connector.ConnectionSpec;
  11 +import org.jredis.JRedis;
  12 +import org.jredis.ri.alphazero.JRedisClient;
  13 +
  14 +/**
  15 + *
  16 + * @author arden
  17 + */
  18 +public class RedisClient implements Runnable {
  19 + private static String host = "121.11.69.53";
  20 + private static int port = 6379;
  21 + private static JRedis jredis = null;
  22 + private static final int retryConnectTimes = 3;
  23 +
  24 + static {
  25 + try {
  26 + // 启动自动重连功能
  27 + RedisReconnect.start();
  28 + } catch (Exception e) {
  29 + e.printStackTrace();
  30 + }
  31 + }
  32 +
  33 + public static JRedis getRedisClient() {
  34 + if (jredis == null) {
  35 + connect();
  36 + }
  37 + return jredis;
  38 + }
  39 +
  40 + private static JRedis connect() {
  41 + try {
  42 + ConnectionSpec spec = DefaultConnectionSpec.newSpec(host, port, 0, null);
  43 + spec.setReconnectCnt(retryConnectTimes);
  44 + jredis = new JRedisClient(spec);
  45 + } catch (Exception e) {
  46 + e.printStackTrace();
  47 + }
  48 + return jredis;
  49 + }
  50 +
  51 + @Override
  52 + public void run() {
  53 + for (;;) {
  54 + try {
  55 + Thread.sleep(1000);
  56 + jredis.ping();
  57 + } catch (Exception e) {
  58 + try {
  59 + jredis.quit();
  60 + } catch (Exception ex) {
  61 + ex.printStackTrace();
  62 + }
  63 + jredis = connect();
  64 + e.printStackTrace();
  65 + }
  66 + }
  67 + }
  68 +}
19 src/com/tujiao/jredis/RedisReconnect.java
... ... @@ -0,0 +1,19 @@
  1 +/*
  2 + * To change this template, choose Tools | Templates
  3 + * and open the template in the editor.
  4 + */
  5 +