You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2011/09/24 22:16:02 UTC

svn commit: r1175235 [1/5] - in /qpid/trunk: ./ qpid/java/ qpid/java/bdbstore/ qpid/java/bdbstore/bin/ qpid/java/bdbstore/etc/ qpid/java/bdbstore/etc/scripts/ qpid/java/bdbstore/src/ qpid/java/bdbstore/src/main/ qpid/java/bdbstore/src/main/java/ qpid/j...

Author: robbie
Date: Sat Sep 24 20:16:00 2011
New Revision: 1175235

URL: http://svn.apache.org/viewvc?rev=1175235&view=rev
Log:
QPID-3504: add the Java broker bdbstore to the build as an optional module

Added:
    qpid/trunk/qpid/java/bdbstore/
    qpid/trunk/qpid/java/bdbstore/bin/
    qpid/trunk/qpid/java/bdbstore/bin/backup.sh   (contents, props changed)
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile
    qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh   (contents, props changed)
      - copied, changed from r1174842, qpid/trunk/.gitignore
    qpid/trunk/qpid/java/bdbstore/build.xml
    qpid/trunk/qpid/java/bdbstore/etc/
    qpid/trunk/qpid/java/bdbstore/etc/scripts/
    qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh   (with props)
    qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh   (with props)
    qpid/trunk/qpid/java/bdbstore/src/
    qpid/trunk/qpid/java/bdbstore/src/main/
    qpid/trunk/qpid/java/bdbstore/src/main/java/
    qpid/trunk/qpid/java/bdbstore/src/main/java/BDBStoreUpgrade.log4j.xml
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncoding.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackup.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DatabaseVisitor.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/FieldTableEncoding.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentKey.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/keys/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/keys/MessageContentKey_4.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/keys/MessageContentKey_5.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/records/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/records/ExchangeRecord.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/records/QueueRecord.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/testclient/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/testclient/BackupTestClient.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/BindingTuple.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/BindingTupleBindingFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/BindingTuple_4.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageContentKeyTB_4.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageContentKeyTB_5.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageContentKeyTupleBindingFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageMetaDataTB_4.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageMetaDataTB_5.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/MessageMetaDataTupleBindingFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/QueueEntryTB.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/QueueTuple.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/QueueTupleBindingFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/QueueTuple_4.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/QueueTuple_5.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuples/TupleBindingFactory.java
    qpid/trunk/qpid/java/bdbstore/src/resources/
    qpid/trunk/qpid/java/bdbstore/src/resources/backup-log4j.xml
    qpid/trunk/qpid/java/bdbstore/src/test/
    qpid/trunk/qpid/java/bdbstore/src/test/java/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncodingTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/resources/
    qpid/trunk/qpid/java/bdbstore/src/test/resources/upgrade/
    qpid/trunk/qpid/java/bdbstore/src/test/resources/upgrade/bdbstore-to-upgrade/
    qpid/trunk/qpid/java/bdbstore/src/test/resources/upgrade/bdbstore-to-upgrade/test-store/
    qpid/trunk/qpid/java/bdbstore/src/test/resources/upgrade/bdbstore-to-upgrade/test-store/00000000.jdb
    qpid/trunk/qpid/java/build.overrides
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile
    qpid/trunk/qpid/java/lib/bdbstore/
    qpid/trunk/qpid/java/lib/bdbstore/README.txt
    qpid/trunk/qpid/java/systests/etc/config-systests-bdb-settings.xml
      - copied, changed from r1174842, qpid/trunk/qpid/java/systests/build.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-bdb.xml
      - copied, changed from r1174842, qpid/trunk/qpid/java/broker-plugins/experimental/info/build.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb.xml
      - copied, changed from r1174842, qpid/trunk/qpid/java/systests/build.xml
    qpid/trunk/qpid/java/test-profiles/JavaBDBExcludes
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
    qpid/trunk/qpid/java/test-profiles/JavaDerbyExcludes
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-9-1.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-10.testprofile
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-9-1.testprofile
      - copied, changed from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby.0-9-1.testprofile
Modified:
    qpid/trunk/.gitignore
    qpid/trunk/qpid/java/broker-plugins/experimental/info/build.xml
    qpid/trunk/qpid/java/broker/build.xml
    qpid/trunk/qpid/java/build.deps
    qpid/trunk/qpid/java/build.xml
    qpid/trunk/qpid/java/systests/build.xml
    qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-9-1.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby.0-9-1.testprofile

Modified: qpid/trunk/.gitignore
URL: http://svn.apache.org/viewvc/qpid/trunk/.gitignore?rev=1175235&r1=1175234&r2=1175235&view=diff
==============================================================================
--- qpid/trunk/.gitignore (original)
+++ qpid/trunk/.gitignore Sat Sep 24 20:16:00 2011
@@ -53,9 +53,11 @@ release
 .settings
 generated/
 target
+qpid/java/lib/bdbstore
 qpid/java/lib/cobertura
 qpid/java/lib/findbugs
 qpid/java/lib/ivy
+qpid/java/build.overrides
 # Intellij Project files
 *.iml
 *.ipr

Copied: qpid/trunk/qpid/java/bdbstore/bin/backup.sh (from r1174842, qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/bin/backup.sh?p2=qpid/trunk/qpid/java/bdbstore/bin/backup.sh&p1=qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile&r1=1174842&r2=1175235&rev=1175235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile (original)
+++ qpid/trunk/qpid/java/bdbstore/bin/backup.sh Sat Sep 24 20:16:00 2011
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,15 +17,24 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-broker.language=java
-broker.version=v0_10
-broker.type=spawned
-broker.command=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT -c @CONFIG_FILE -l ${test.profiles}/log4j-test.xml
-broker.clean=${test.profiles}/clean-dir ${build.data} ${project.root}/build/work
-broker.ready=BRK-1004
-broker.stopped=Exception
-broker.config=${project.root}/build/etc/config-systests-derby.xml
-messagestore.class.name=org.apache.qpid.server.store.DerbyMessageStore
-profile.excludes=JavaPersistentExcludes Java010Excludes
-broker.clean.between.tests=true
-broker.persistent=true
+
+# Parse arguments taking all - prefixed args as JAVA_OPTS
+for arg in "$@"; do
+    if [[ $arg == -java:* ]]; then
+        JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2`  "
+    else
+        ARGS="${ARGS}$arg "
+    fi
+done
+
+WHEREAMI=`dirname $0`
+if [ -z "$QPID_HOME" ]; then
+   export QPID_HOME=`cd $WHEREAMI/../ && pwd`
+fi
+VERSION=0.13
+
+LIBS=$QPID_HOME/lib/je-4.0.103.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
+
+
+echo "Starting Hot Backup Script"
+java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp $LIBS org.apache.qpid.server.store.berkeleydb.BDBBackup ${ARGS}

Propchange: qpid/trunk/qpid/java/bdbstore/bin/backup.sh
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh (from r1174842, qpid/trunk/.gitignore)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh?p2=qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh&p1=qpid/trunk/.gitignore&r1=1174842&r2=1175235&rev=1175235&view=diff
==============================================================================
--- qpid/trunk/.gitignore (original)
+++ qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh Sat Sep 24 20:16:00 2011
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -17,63 +18,26 @@
 # under the License.
 #
 
-#Python
-*.pyc
-*.out
-#CPP
-*.o
-*.la
-*.lo
-*.vglog
-.dirstamp
-Makefile.in
-config\.*
-configure
-.deps
-.libs
-autom4te.cache
-aclocal.m4
-developer.doxygen
-user.doxygen
-qpid/cpp/libtool
-qpidc.spec
-qpid/cpp/src/gen/
-*gen.mk
-*.timestamp
-*.pcl
-qpid/cpp/managementgen/management-types.xml
-
-#Java
-*.class
-velocity.log*
-qpid/java/build
-release
-.classpath
-.project
-.settings
-generated/
-target
-qpid/java/lib/cobertura
-qpid/java/lib/findbugs
-qpid/java/lib/ivy
-# Intellij Project files
-*.iml
-*.ipr
-*.iws
-# Emacs
-*~
-# Microsoft Visual Studio artifacts
-*.vcproj.*.*.user
-*.ncb
-*.suo
-*.ilk
-*.pdb
-# Windows build results
-*.exe
-*.lib
-*.dll
-# MacOS File
-.DS_Store
+# Parse arguements taking all - prefixed args as JAVA_OPTS
+for arg in "$@"; do
+    if [[ $arg == -java:* ]]; then
+        JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2`  "
+    else
+        ARGS="${ARGS}$arg "
+    fi
+done
 
-#Eclipse workspace
-workspace/
+if [ -z "$QPID_HOME" ]; then
+    export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
+    export PATH=${PATH}:${QPID_HOME}/bin
+fi
+
+if [ -z "$BDB_HOME" ]; then
+    export BDB_HOME=$(dirname $(dirname $(readlink -f $0)))
+fi
+
+VERSION=0.13
+
+LIBS=$BDB_HOME/lib/je-4.0.103.jar:$BDB_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
+
+java -Xms256m -Dlog4j.configuration=BDBStoreUpgrade.log4j.xml -Xmx256m -Damqj.logging.level=warn ${JAVA_OPTS} -cp $LIBS org.apache.qpid.server.store.berkeleydb.BDBStoreUpgrade  ${ARGS} 

Propchange: qpid/trunk/qpid/java/bdbstore/bin/storeUpgrade.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/java/bdbstore/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/build.xml?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/build.xml (added)
+++ qpid/trunk/qpid/java/bdbstore/build.xml Sat Sep 24 20:16:00 2011
@@ -0,0 +1,84 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements.  See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership.  The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied.  See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -->
+<project name="bdbstore" default="build">
+    <property name="module.depends" value="common client management/common broker perftests systests" />
+    <property name="module.test.depends" value="test common/test broker/test management/common perftests systests" />
+
+    <import file="../module.xml" />
+
+    <property name="bdb.lib.dir" value="${project.root}/lib/bdbstore" />
+    <property name="bdb.version" value="4.0.103" />
+    <property name="bdb.download.url" value="http://download.oracle.com/maven/com/sleepycat/je/${bdb.version}/je-${bdb.version}.jar" />
+    <property name="bdb.jar.file" value="${bdb.lib.dir}/je-${bdb.version}.jar" />
+
+    <!--check whether the BDB jar is present, possibly after download-->
+    <target name="check-bdb-jar">
+        <available file="${bdb.jar.file}" type="file" property="bdb.jar.available"/>
+    </target>
+
+    <!--echo that BDB is required if it isnt present, with associated licencing note-->
+    <target name="bdb-jar-required" depends="bdb-licence-note-optional" unless="bdb.jar.available">
+       <echo>The BDB JE library is required to use this optional module.
+
+The jar file may be downloaded by either:
+
+   Seperately running the following command from the qpid/java/bdbstore dir: ant download-bdb
+
+   OR
+
+   Adding -Ddownload-bdb=true to your regular build command.</echo>
+        <fail>The BDB JE library was not found</fail>
+    </target>
+
+    <!--issue BDB licencing note if BDB isnt already present-->
+    <target name="bdb-licence-note-optional" depends="check-bdb-jar" unless="bdb.jar.available">
+        <antcall target="bdb-licence-note"/>
+    </target>
+
+    <!--issue BDB licencing note-->
+    <target name="bdb-licence-note">
+       <echo>*NOTE* The BDB JE library required by this optional module is licensed under the Sleepycat Licence, which is not compatible with the Apache Licence v2.0.
+
+For a copy of the Sleepycat Licence, please see:
+http://www.oracle.com/technetwork/database/berkeleydb/downloads/jeoslicense-086837.html</echo>
+    </target>
+
+    <!--check if an inline BDB download was requested with the build-->
+    <target name="check-request-props" if="download-bdb">
+        <antcall target="download-bdb"/>
+    </target>
+
+    <!--download BDB, with licencing note-->
+    <target name="download-bdb" depends="bdb-licence-note">
+        <mkdir dir="${bdb.lib.dir}"/>
+        <echo>Downloading BDB JE</echo>
+        <get src="${bdb.download.url}" dest="${bdb.jar.file}" usetimestamp="true" />
+    </target>
+
+    <target name="build" depends="check-request-props, bdb-jar-required, module.build" />
+
+    <target name="postbuild" depends="copy-store-to-upgrade" />
+
+    <target name="copy-store-to-upgrade" description="copy the upgrade tool resource folder contents into the build tree">
+      <copy todir="${qpid.home}" failonerror="true">
+        <fileset dir="src/test/resources/upgrade"/>
+      </copy>
+    </target>
+
+</project>

Added: qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh (added)
+++ qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh Sat Sep 24 20:16:00 2011
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+if [ -z "$QPID_HOME" ]; then
+    export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
+    export PATH=${PATH}:${QPID_HOME}/bin
+fi
+
+# Parse arguements taking all - prefixed args as JAVA_OPTS
+for arg in "$@"; do
+    if [[ $arg == -java:* ]]; then
+        JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2`  "
+    else
+        ARGS="${ARGS}$arg "
+    fi
+done
+
+VERSION=0.5
+
+# Set classpath to include Qpid jar with all required jars in manifest
+QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/qpid-junit-toolkit-$VERSION.jar:$QPID_HOME/lib/junit-3.8.1.jar:$QPID_HOME/lib/log4j-1.2.12.jar:$QPID_HOME/lib/qpid-systests-$VERSION.jar:$QPID_HOME/lib/qpid-perftests-$VERSION.jar:$QPID_HOME/lib/slf4j-log4j12-1.4.0.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar
+
+# Set other variables used by the qpid-run script before calling
+export JAVA=java        JAVA_MEM=-Xmx256m        QPID_CLASSPATH=$QPID_LIBS
+
+. qpid-run -Dlog4j.configuration=perftests.log4j -Dbadger.level=warn -Damqj.test.logging.level=warn -Damqj.logging.level=warn ${JAVA_OPTS} org.apache.qpid.server.store.berkeleydb.testclient.BackupTestClient -o $QPID_WORK/results numMessagesToAction=55 ${ARGS}
+

Propchange: qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbbackuptest.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh (added)
+++ qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh Sat Sep 24 20:16:00 2011
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+if [ -z "$QPID_HOME" ]; then
+    export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
+    export PATH=${PATH}:${QPID_HOME}/bin
+fi
+
+# Parse arguements taking all - prefixed args as JAVA_OPTS
+for arg in "$@"; do
+    if [[ $arg == -java:* ]]; then
+        JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2`  "
+    else
+        ARGS="${ARGS}$arg "
+    fi
+done
+
+VERSION=0.5
+
+# Set classpath to include Qpid jar with all required jars in manifest
+QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/qpid-junit-toolkit-$VERSION.jar:$QPID_HOME/lib/junit-3.8.1.jar:$QPID_HOME/lib/log4j-1.2.12.jar:$QPID_HOME/lib/qpid-systests-$VERSION.jar:$QPID_HOME/lib/qpid-perftests-$VERSION.jar:$QPID_HOME/lib/slf4j-log4j12-1.4.0.jar
+
+# Set other variables used by the qpid-run script before calling
+export JAVA=java        JAVA_MEM=-Xmx256m        QPID_CLASSPATH=$QPID_LIBS
+
+. qpid-run -Dlog4j.configuration=perftests.log4j -Dbadger.level=warn -Damqj.test.logging.level=warn -Damqj.logging.level=warn ${JAVA_OPTS} org.apache.qpid.ping.PingDurableClient -o $QPID_WORK/results ${ARGS}

Propchange: qpid/trunk/qpid/java/bdbstore/etc/scripts/bdbtest.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/java/bdbstore/src/main/java/BDBStoreUpgrade.log4j.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/BDBStoreUpgrade.log4j.xml?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/BDBStoreUpgrade.log4j.xml (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/BDBStoreUpgrade.log4j.xml Sat Sep 24 20:16:00 2011
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements.  See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership.  The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied.  See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
+
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d %-5p - %m%n"/>
+        </layout>
+    </appender>
+
+    <category name="org.apache.qpid.server.store.berkeleydb.BDBStoreUpgrade">
+        <priority value="info"/>
+    </category>
+
+    <!-- Only show errors from the BDB Store -->
+    <category name="org.apache.qpid.server.store.berkeleydb.berkeleydb.BDBMessageStore">
+        <priority value="error"/>
+    </category>
+
+    <!-- Provide warnings to standard output -->
+    <category name="org.apache.qpid">
+        <priority value="error"/>
+    </category>
+
+    <!-- Log all info events to file -->
+    <root>
+        <priority value="info"/>
+        <appender-ref ref="STDOUT"/>
+    </root>
+
+</log4j:configuration>

Added: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncoding.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncoding.java?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncoding.java (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringEncoding.java Sat Sep 24 20:16:00 2011
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import org.apache.qpid.framing.AMQShortString;
+
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+
+public class AMQShortStringEncoding
+{
+    public static AMQShortString readShortString(TupleInput tupleInput)
+    {
+        int length = (int) tupleInput.readShort();
+        if (length < 0)
+        {
+            return null;
+        }
+        else
+        {
+            byte[] stringBytes = new byte[length];
+            tupleInput.readFast(stringBytes);
+            return new AMQShortString(stringBytes);
+        }
+
+    }
+
+    public  static void writeShortString(AMQShortString shortString, TupleOutput tupleOutput)
+    {
+
+        if (shortString == null)
+        {
+            tupleOutput.writeShort(-1);
+        }
+        else
+        {
+            tupleOutput.writeShort(shortString.length());
+            tupleOutput.writeFast(shortString.getBytes(), 0, shortString.length());
+        }
+    }
+}

Added: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java Sat Sep 24 20:16:00 2011
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import com.sleepycat.bind.tuple.TupleBinding;
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+import org.apache.log4j.Logger;
+import org.apache.qpid.framing.AMQShortString;
+
+public class AMQShortStringTB extends TupleBinding
+{
+    private static final Logger _log = Logger.getLogger(AMQShortStringTB.class);
+
+
+    public AMQShortStringTB()
+    {
+    }
+
+    public Object entryToObject(TupleInput tupleInput)
+    {
+        return AMQShortStringEncoding.readShortString(tupleInput);
+    }
+
+    public void objectToEntry(Object object, TupleOutput tupleOutput)
+    {
+        AMQShortStringEncoding.writeShortString((AMQShortString)object, tupleOutput);
+    }
+
+}

Added: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackup.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackup.java?rev=1175235&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackup.java (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackup.java Sat Sep 24 20:16:00 2011
@@ -0,0 +1,344 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import com.sleepycat.je.DatabaseException;
+import com.sleepycat.je.Environment;
+import com.sleepycat.je.EnvironmentConfig;
+import com.sleepycat.je.util.DbBackup;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.util.CommandLineParser;
+import org.apache.qpid.util.FileUtils;
+
+import java.io.*;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * BDBBackup is a utility for taking hot backups of the current state of a BDB transaction log database.
+ *
+ * <p/>This utility makes the following assumptions/performs the following actions:
+ *
+ * <p/><ul> <li>The from and to directory locations will already exist. This scripts does not create them. <li>If this
+ * script fails to complete in one minute it will terminate. <li>This script always exits with code 1 on error, code 0
+ * on success (standard unix convention). <li>This script will log out at info level, when it starts and ends and a list
+ * of all files backed up. <li>This script logs all errors at error level. <li>This script does not perform regular
+ * backups, wrap its calling script in a cron job or similar to do this. </ul>
+ *
+ * <p/>This utility is build around the BDB provided backup helper utility class, DbBackup. This utility class provides
+ * an ability to force BDB to stop writing to the current log file set, whilst the backup is taken, to ensure that a
+ * consistent snapshot is acquired. Preventing BDB from writing to the current log file set, does not stop BDB from
+ * continuing to run concurrently while the backup is running, it simply moves onto a new set of log files; this
+ * provides a 'hot' backup facility.
+ *
+ * <p/>DbBackup can also help with incremental backups, by providing the number of the last log file backed up.
+ * Subsequent backups can be taken, from later log files only. In a messaging application, messages are not expected to
+ * be long-lived in most cases, so the log files will usually have been completely turned over between backups. This
+ * utility does not support incremental backups for this reason.
+ *
+ * <p/>If the database is locked by BDB, as is required when using transactions, and therefore will always be the case
+ * in Qpid, this utility cannot make use of the DbBackup utility in a seperate process. DbBackup, needs to ensure that
+ * the BDB envinronment used to take the backup has exclusive write access to the log files. This utility can take a
+ * backup as a standalone utility against log files, when a broker is not running, using the {@link #takeBackup(String,
+ *String,com.sleepycat.je.Environment)} method.
+ *
+ * <p/>A seperate backup machanism is provided by the {@link #takeBackupNoLock(String,String)} method which can take a
+ * hot backup against a running broker. This works by finding out the set of files to copy, and then opening them all to
+ * read, and repeating this process until a consistent set of open files is obtained. This is done to avoid the
+ * situation where the BDB cleanup thread deletes a file, between the directory listing and opening of the file to copy.
+ * All consistently opened files are copied. This is the default mechanism the the {@link #main} method of this utility
+ * uses.
+ *
+ * <p/><table id="crc><caption>CRC Card</caption> <tr><th> Responsibilities <th> Collaborations <tr><td> Hot copy all
+ * BDB log files from one directory to another. </table>
+ */
+public class BDBBackup
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(BDBBackup.class);
+
+    /** Used for communicating with the user. */
+    private static final Logger console = Logger.getLogger("Console");
+
+    /** Defines the suffix used to identify BDB log files. */
+    private static final String LOG_FILE_SUFFIX = ".jdb";
+
+    /** Defines the command line format for this utility. */
+    public static final String[][] COMMAND_LINE_SPEC =
+        new String[][]
+        {
+            { "fromdir", "The path to the directory to back the bdb log file from.", "dir", "true" },
+            { "todir", "The path to the directory to save the backed up bdb log files to.", "dir", "true" }
+        };
+
+    /** Defines the timeout to terminate the backup operation on if it fails to complete. One minte. */
+    public static final long TIMEOUT = 60000;
+
+    /**
+     * Runs a backup of the BDB log files in a specified directory, copying the backed up files to another specified
+     * directory.
+     *
+     * <p/>The following arguments must be specified:
+     *
+     * <p/><table><caption>Command Line</caption> <tr><th> Option <th> Comment <tr><td> -fromdir <td> The path to the
+     * directory to back the bdb log file from. <tr><td> -todir   <td> The path to the directory to save the backed up
+     * bdb log files to. </table>
+     *
+     * @param args The command line arguments.
+     */
+    public static void main(String[] args)
+    {
+        // Process the command line using standard handling (errors and usage followed by System.exit when it is wrong).
+        Properties options =
+            CommandLineParser.processCommandLine(args, new CommandLineParser(COMMAND_LINE_SPEC), System.getProperties());
+
+        // Extract the from and to directory locations and perform a backup between them.
+        try
+        {
+            String fromDir = options.getProperty("fromdir");
+            String toDir = options.getProperty("todir");
+
+            log.info("BDBBackup Utility: Starting Hot Backup.");
+
+            BDBBackup bdbBackup = new BDBBackup();
+            String[] backedUpFiles = bdbBackup.takeBackupNoLock(fromDir, toDir);
+
+            if (log.isInfoEnabled())
+            {
+                log.info("BDBBackup Utility: Hot Backup Completed. Files backed up: " + backedUpFiles);
+            }
+        }
+        catch (Exception e)
+        {
+            console.info("Backup script encountered an error and has failed: " + e.getMessage());
+            log.error("Backup script got exception: " + e.getMessage(), e);
+            System.exit(1);
+        }
+    }
+
+    /**
+     * Creates a backup of the BDB log files in the source directory, copying them to the destination directory.
+     *
+     * @param fromdir     The source directory path.
+     * @param todir       The destination directory path.
+     * @param environment An open BDB environment to perform the back up.
+     *
+     * @throws DatabaseException Any underlying execeptions from BDB are allowed to fall through.
+     */
+    public void takeBackup(String fromdir, String todir, Environment environment) throws DatabaseException
+    {
+        DbBackup backupHelper = null;
+
+        try
+        {
+            backupHelper = new DbBackup(environment);
+
+            // Prevent BDB from writing to its log files while the backup it taken.
+            backupHelper.startBackup();
+
+            // Back up the BDB log files to the destination directory.
+            String[] filesForBackup = backupHelper.getLogFilesInBackupSet();
+
+            for (int i = 0; i < filesForBackup.length; i++)
+            {
+                File sourceFile = new File(fromdir + File.separator + filesForBackup[i]);
+                File destFile = new File(todir + File.separator + filesForBackup[i]);
+                FileUtils.copy(sourceFile, destFile);
+            }
+        }
+        finally
+        {
+            // Remember to exit backup mode, or all log files won't be cleaned and disk usage will bloat.
+            if (backupHelper != null)
+            {
+                backupHelper.endBackup();
+            }
+        }
+    }
+
+    /**
+     * Takes a hot backup when another process has locked the BDB database.
+     *
+     * @param fromdir The source directory path.
+     * @param todir   The destination directory path.
+     *
+     * @return A list of all of the names of the files succesfully backed up.
+     */
+    public String[] takeBackupNoLock(String fromdir, String todir)
+    {
+        if (log.isDebugEnabled())
+        {
+            log.debug("public void takeBackupNoLock(String fromdir = " + fromdir + ", String todir = " + todir
+                + "): called");
+        }
+
+        File fromDirFile = new File(fromdir);
+
+        if (!fromDirFile.isDirectory())
+        {
+            throw new IllegalArgumentException("The specified fromdir(" + fromdir
+                + ") must be the directory containing your bdbstore.");
+        }
+
+        File toDirFile = new File(todir);
+
+        if (!toDirFile.exists())
+        {
+            // Create directory if it doesn't exist
+            toDirFile.mkdirs();
+
+            if (log.isDebugEnabled())
+            {
+                log.debug("Created backup directory:" + toDirFile);
+            }
+        }
+
+        if (!toDirFile.isDirectory())
+        {
+            throw new IllegalArgumentException("The specified todir(" + todir + ") must be a directory.");
+        }
+
+        // Repeat until manage to open consistent set of files for reading.
+        boolean consistentSet = false;
+        FileInputStream[] fileInputStreams = new FileInputStream[0];
+        File[] fileSet = new File[0];
+        long start = System.currentTimeMillis();
+
+        while (!consistentSet)
+        {
+            // List all .jdb files in the directory.
+            fileSet = fromDirFile.listFiles(new FilenameFilter()
+                    {
+                        public boolean accept(File dir, String name)
+                        {
+                            return name.endsWith(LOG_FILE_SUFFIX);
+                        }
+                    });
+
+            // Open them all for reading.
+            fileInputStreams = new FileInputStream[fileSet.length];
+
+            if (fileSet.length == 0)
+            {
+                throw new RuntimeException("There are no BDB log files to backup in the " + fromdir + " directory.");
+            }
+
+            for (int i = 0; i < fileSet.length; i++)
+            {
+                try
+                {
+                    fileInputStreams[i] = new FileInputStream(fileSet[i]);
+                }
+                catch (FileNotFoundException e)
+                {
+                    // Close any files opened for reading so far.
+                    for (int j = 0; j < i; j++)
+                    {
+                        if (fileInputStreams[j] != null)
+                        {
+                            try
+                            {
+                                fileInputStreams[j].close();
+                            }
+                            catch (IOException ioEx)
+                            {
+                                // Rethrow this as a runtime exception, as something strange has happened.
+                                throw new RuntimeException(ioEx);
+                            }
+                        }
+                    }
+
+                    // Could not open a consistent file set so try again.
+                    break;
+                }
+
+                // A consistent set has been opened if all files were sucesfully opened for reading.
+                if (i == (fileSet.length - 1))
+                {
+                    consistentSet = true;
+                }
+            }
+
+            // Check that the script has not timed out, and raise an error if it has.
+            long now = System.currentTimeMillis();
+            if ((now - start) > TIMEOUT)
+            {
+                throw new RuntimeException("Hot backup script failed to complete in " + (TIMEOUT / 1000) + " seconds.");
+            }
+        }
+
+        // Copy the consistent set of open files.
+        List<String> backedUpFileNames = new LinkedList<String>();
+
+        for (int j = 0; j < fileSet.length; j++)
+        {
+            File destFile = new File(todir + File.separator + fileSet[j].getName());
+            try
+            {
+                FileUtils.copy(fileSet[j], destFile);
+            }
+            catch (RuntimeException re)
+            {
+                Throwable cause = re.getCause();
+                if ((cause != null) && (cause instanceof IOException))
+                {
+                    throw new RuntimeException(re.getMessage() + " fromDir:" + fromdir + " toDir:" + toDirFile, cause);
+                }
+                else
+                {
+                    throw re;
+                }
+            }
+
+            backedUpFileNames.add(destFile.getName());
+
+            // Close all of the files.
+            try
+            {
+                fileInputStreams[j].close();
+            }
+            catch (IOException e)
+            {
+                // Rethrow this as a runtime exception, as something strange has happened.
+                throw new RuntimeException(e);
+            }
+        }
+
+        return backedUpFileNames.toArray(new String[backedUpFileNames.size()]);
+    }
+
+    /*
+     * Creates an environment for the bdb log files in the specified directory. This envrinonment can only be used
+     * to backup these files, if they are not locked by another database instance.
+     *
+     * @param fromdir The path to the directory to create the environment for.
+     *
+     * @throws DatabaseException Any underlying exceptions from BDB are allowed to fall through.
+     */
+    private Environment createSourceDirEnvironment(String fromdir) throws DatabaseException
+    {
+        // Initialize the BDB backup utility on the source directory.
+        return new Environment(new File(fromdir), new EnvironmentConfig());
+    }
+}



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org