rhmessaging commits: r2089 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-29 17:14:19 -0400 (Thu, 29 May 2008)
New Revision: 2089
Modified:
store/trunk/cpp/rhm.spec.in
Log:
BZ448931: remove rhmd initscript
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-05-29 20:36:25 UTC (rev 2088)
+++ store/trunk/cpp/rhm.spec.in 2008-05-29 21:14:19 UTC (rev 2089)
@@ -48,8 +48,8 @@
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
-install -d -m0755 %{buildroot}%{_localstatedir}/lib/qpidd
-install -Dp -m0755 %_libdir/libbdbstore.so.0* %{buildroot}%{_localstatedir}/lib/qpidd
+install -d -m0755 %{buildroot}/usr/lib/qpidd
+install -Dp -m0755 %_libdir/libbdbstore.so.0* %{buildroot}/usr/lib/qpidd
rm -f %{buildroot}%_libdir/*.a
rm -f %{buildroot}%_libdir/*.la
rm -f %{buildroot}%_libdir/*.so*
@@ -63,8 +63,8 @@
%files
%defattr(-,root,root,-)
%doc README COPYING
-%{_localstatedir}/lib/qpidd/libbdbstore.so.0
-%{_localstatedir}/lib/qpidd/libbdbstore.so.0.1.0
+/usr/lib/qpidd/libbdbstore.so.0
+/usr/lib/qpidd/libbdbstore.so.0.1.0
%config(noreplace) %_sysconfdir/rhmd.conf
16 years, 7 months
rhmessaging commits: r2088 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-29 16:36:25 -0400 (Thu, 29 May 2008)
New Revision: 2088
Modified:
store/trunk/cpp/rhm.spec.in
Log:
BZ448931: remove rhmd initscript
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-05-29 19:46:53 UTC (rev 2087)
+++ store/trunk/cpp/rhm.spec.in 2008-05-29 20:36:25 UTC (rev 2088)
@@ -48,11 +48,11 @@
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
+install -d -m0755 %{buildroot}%{_localstatedir}/lib/qpidd
+install -Dp -m0755 %_libdir/libbdbstore.so.0* %{buildroot}%{_localstatedir}/lib/qpidd
rm -f %{buildroot}%_libdir/*.a
rm -f %{buildroot}%_libdir/*.la
-rm -f %{buildroot}%_libdir/*.so
-install -d -m0755 %{buildroot}%{_localstatedir}/lib/qpidd
-install -Dp -m0755 %_libdir/libbdbstore.so.0* %{buildroot}%{_localstatedir}/lib/qpidd
+rm -f %{buildroot}%_libdir/*.so*
%clean
rm -rf %{buildroot}
16 years, 7 months
rhmessaging commits: r2087 - in store/trunk/cpp: etc and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-29 15:46:53 -0400 (Thu, 29 May 2008)
New Revision: 2087
Removed:
store/trunk/cpp/etc/rhmd
store/trunk/cpp/etc/rhmd.sh
Modified:
store/trunk/cpp/Makefile.am
store/trunk/cpp/rhm.spec.in
Log:
BZ448931: remove rhmd initscript
Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am 2008-05-29 16:22:36 UTC (rev 2086)
+++ store/trunk/cpp/Makefile.am 2008-05-29 19:46:53 UTC (rev 2087)
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = 1.9.6 foreign
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = README etc/rhmd etc/rhmd.conf etc/rhmd.sh
+EXTRA_DIST = README etc/rhmd.conf
sysconf_DATA = etc/rhmd.conf
Deleted: store/trunk/cpp/etc/rhmd
===================================================================
--- store/trunk/cpp/etc/rhmd 2008-05-29 16:22:36 UTC (rev 2086)
+++ store/trunk/cpp/etc/rhmd 2008-05-29 19:46:53 UTC (rev 2087)
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# rhmd Startup script for the RHM messaging daemon (Qpid messaging daemon with bdbstore enabled)
-#
-
-### BEGIN INIT INFO
-# Provides: qpidd
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: start or stop qpidd with persistent store
-# Description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protocol.
-### END INIT INFO
-
-# chkconfig: - 85 15
-# description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protocol.
-# processname: qpidd
-
-prog=qpidd
-lockfile=/var/lock/subsys/rhmd
-pidfile=/var/run/rhmd.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-if [ -f /etc/sysconfig/rhmd ] ; then
- . /etc/sysconfig/rhmd
-fi
-
-RETVAL=0
-
-start() {
- echo -n $"Starting RHM daemon: "
- runuser -s /bin/sh qpidd -c "qpidd --daemon --config=/etc/rhmd.conf"
- RETVAL=$?
- if [ $RETVAL = 0 ] ; then success ; else failure ; fi
- echo
- [ $RETVAL = 0 ] && touch $lockfile
- if [ $RETVAL = 0 ]; then
- touch $pidfile
- chown qpidd.qpidd $pidfile
- runuser -s /bin/sh qpidd -c "qpidd -c > $pidfile"
- fi
- return $RETVAL
-}
-
-stop() {
- echo -n $"Stopping RHM daemon: "
- killproc -p ${pidfile} $prog
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
-}
-
-reload() {
- echo 1>&2 $"$0: reload not supported"
- exit 3
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- status)
- status $prog | sed 's/qpidd/rhmd/'
- RETVAL=$?
- ;;
- force-reload)
- restart
- ;;
- try-restart)
- [ -e $lockfile ] && restart || :
- ;;
- *)
- echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
- exit 1
-esac
-
-exit $RETVAL
Deleted: store/trunk/cpp/etc/rhmd.sh
===================================================================
--- store/trunk/cpp/etc/rhmd.sh 2008-05-29 16:22:36 UTC (rev 2086)
+++ store/trunk/cpp/etc/rhmd.sh 2008-05-29 19:46:53 UTC (rev 2087)
@@ -1,4 +0,0 @@
-#!/bin/bash
-echo $* | grep -e --config >/dev/null || CONFIG=--config=/etc/rhmd.conf
-/usr/sbin/qpidd $CONFIG $*
-
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-05-29 16:22:36 UTC (rev 2086)
+++ store/trunk/cpp/rhm.spec.in 2008-05-29 19:46:53 UTC (rev 2087)
@@ -1,9 +1,13 @@
#
# Spec file for Red Hat Messaging package rhm.
#
+
+%define svnrev xxx
+# built against qpidc svn rev xxx
+
Name: rhm
Version: @VERSION@
-Release: 20%{?dist}
+Release: 21%{?dist}
Summary: Red Hat extensions to the Qpid messaging system
Group: System Environment/Libraries
License: LGPL
@@ -21,6 +25,7 @@
BuildRequires: e2fsprogs-devel
BuildRequires: libaio-devel
BuildRequires: python
+BuildRequires: libtool
Requires: qpidd
Requires: db4
@@ -43,12 +48,11 @@
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
-install -Dp -m0755 etc/rhmd %{buildroot}%{_initrddir}/rhmd
-install -Dp -m0755 etc/rhmd.sh %{buildroot}%{_sbindir}/rhmd
-install -d -m0775 %{buildroot}%{_localstatedir}/rhm
rm -f %{buildroot}%_libdir/*.a
rm -f %{buildroot}%_libdir/*.la
rm -f %{buildroot}%_libdir/*.so
+install -d -m0755 %{buildroot}%{_localstatedir}/lib/qpidd
+install -Dp -m0755 %_libdir/libbdbstore.so.0* %{buildroot}%{_localstatedir}/lib/qpidd
%clean
rm -rf %{buildroot}
@@ -59,33 +63,15 @@
%files
%defattr(-,root,root,-)
%doc README COPYING
-%_libdir/libbdbstore.so.0
-%_libdir/libbdbstore.so.0.1.0
-%_initrddir/rhmd
-%_sbindir/rhmd
-%attr(0775,qpidd,qpidd) %dir %_localstatedir/rhm
+%{_localstatedir}/lib/qpidd/libbdbstore.so.0
+%{_localstatedir}/lib/qpidd/libbdbstore.so.0.1.0
%config(noreplace) %_sysconfdir/rhmd.conf
-%post
-# This adds the proper /etc/rc*.d links for the script
-/sbin/chkconfig --add qpidd
-/sbin/ldconfig
-%preun
-# Check that this is actual deinstallation, not just removing for upgrade.
-if [ $1 = 0 ]; then
- /sbin/service rhmd stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del rhmd
-fi
-
-%postun
-if [ "$1" -ge "1" ]; then
- /sbin/service rhmd condrestart >/dev/null 2>&1 || :
-fi
-/sbin/ldconfig
-
-
%changelog
+* Thu May 29 2008 Nuno Santos <nsantos(a)nsantos.bos.redhat.com> - 0.2-21
+- BZ448931: remove initscript for rhmd, and shell startup script
+
* Mon Apr 14 2008 Kim van der Riet <kim.vdriet(a)redhat.com> - 0.2-20
- removed cppunit as build dependency - all tests now boost test
16 years, 7 months
rhmessaging commits: r2086 - store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: godfrer
Date: 2008-05-29 12:22:36 -0400 (Thu, 29 May 2008)
New Revision: 2086
Added:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueTB.java
Removed:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQExchangeTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueBindingTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DeliveryDetailsKey.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTupleBinding.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueBindingKey.java
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
Log:
refactoring
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQExchangeTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQExchangeTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQExchangeTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,57 +0,0 @@
-package org.apache.qpid.server.store.berkeleydb;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.AMQException;
-
-import com.sleepycat.bind.tuple.TupleBinding;
-import com.sleepycat.bind.tuple.TupleInput;
-import com.sleepycat.bind.tuple.TupleOutput;
-import org.apache.log4j.Logger;
-
-public class AMQExchangeTupleBinding extends TupleBinding
-{
- private static final Logger _log = Logger.getLogger(AMQExchangeTupleBinding.class);
-
-
-
- private final VirtualHost _virtualHost;
-
- public AMQExchangeTupleBinding(VirtualHost virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- public Object entryToObject(TupleInput tupleInput)
- {
-
- AMQShortString name = AMQShortStringEncoding.readShortString(tupleInput);
- AMQShortString typeName = AMQShortStringEncoding.readShortString(tupleInput);
-
-
- boolean autoDelete = tupleInput.readBoolean();
-
- try
- {
- return _virtualHost.getExchangeFactory().createExchange(name, typeName, true, autoDelete, 0);
- }
- catch (AMQException e)
- {
- _log.error("Unable to create exchange: " + e, e);
- return null;
- }
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- Exchange exchange = (Exchange) object;
-
-
- AMQShortStringEncoding.writeShortString(exchange.getName(),tupleOutput);
- AMQShortStringEncoding.writeShortString(exchange.getType(),tupleOutput);
-
- tupleOutput.writeBoolean(exchange.isAutoDelete());
-
- }
-}
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueBindingTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueBindingTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueBindingTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,59 +0,0 @@
-package org.apache.qpid.server.store.berkeleydb;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-import com.sleepycat.bind.tuple.TupleBinding;
-import com.sleepycat.bind.tuple.TupleInput;
-import com.sleepycat.bind.tuple.TupleOutput;
-import com.sleepycat.je.DatabaseException;
-import org.apache.log4j.Logger;
-
-public class AMQQueueBindingTupleBinding extends TupleBinding
-{
- private static final Logger _log = Logger.getLogger(AMQQueueBindingTupleBinding.class);
-
-
-
- private final VirtualHost _virtualHost;
-
- public AMQQueueBindingTupleBinding(VirtualHost virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- public Object entryToObject(TupleInput tupleInput)
- {
- try
- {
- AMQShortString exchangeName = AMQShortStringEncoding.readShortString(tupleInput);
- AMQShortString queueName = AMQShortStringEncoding.readShortString(tupleInput);
- AMQShortString routingKey = AMQShortStringEncoding.readShortString(tupleInput);
- FieldTable arguments = FieldTableEncoding.readFieldTable(tupleInput);
-
-
-
- return new QueueBindingKey(exchangeName,queueName,routingKey,arguments);
- }
- catch (DatabaseException e)
- {
- _log.error("Unable to create binding: " + e, e);
- return null;
- }
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- QueueBindingKey binding = (QueueBindingKey) object;
-
-
- AMQShortStringEncoding.writeShortString(binding.getExchangeName(),tupleOutput);
- AMQShortStringEncoding.writeShortString(binding.getQueueName(),tupleOutput);
- AMQShortStringEncoding.writeShortString(binding.getRoutingKey(),tupleOutput);
- FieldTableEncoding.writeFieldTable(binding.getArguments(),tupleOutput);
-
- }
-}
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * Licensed 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.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.log4j.Logger;
-
-public class AMQQueueTupleBinding extends TupleBinding
-{
- private static final Logger _log = Logger.getLogger(AMQQueueTupleBinding.class);
-
-
-
- private final VirtualHost _virtualHost;
-
- public AMQQueueTupleBinding(VirtualHost virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- public Object entryToObject(TupleInput tupleInput)
- {
- AMQShortString name = AMQShortStringEncoding.readShortString(tupleInput);
- AMQShortString owner = AMQShortStringEncoding.readShortString(tupleInput);
-
-
- try
- {
- return new AMQQueue(name, true, owner, false, _virtualHost);
- }
- catch (AMQException e)
- {
- _log.error("Unable to create queue: " + e, e);
- return null;
- }
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- AMQQueue queue = (AMQQueue) object;
-
-
- AMQShortStringEncoding.writeShortString(queue.getName(),tupleOutput);
- AMQShortStringEncoding.writeShortString(queue.getOwner(),tupleOutput);
-
- }
-}
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,28 @@
+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);
+ }
+
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQShortStringTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,28 +0,0 @@
-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 AMQShortStringTupleBinding extends TupleBinding
-{
- private static final Logger _log = Logger.getLogger(AMQShortStringTupleBinding.class);
-
-
- public AMQShortStringTupleBinding()
- {
- }
-
- public Object entryToObject(TupleInput tupleInput)
- {
- return AMQShortStringEncoding.readShortString(tupleInput);
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- AMQShortStringEncoding.writeShortString((AMQShortString)object, tupleOutput);
- }
-
-}
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -56,6 +56,7 @@
import java.util.Queue;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
@@ -90,27 +91,43 @@
private static final String QUEUEDB_NAME = "queueDb";
+ private static final String NEW_QUEUE_DB_NAME = "QUEUE";
+
/** Maps from name (which uniquely identifies a queue) to an AMQQueue */
private Database _queueDb;
private static final String DELIVERYDB_NAME = "deliveryDb";
+ private static final String QUEUE_ENTRY_DB_NAME = "QUEUE_ENTRY";
+
/** Maps from a queue name to a message id. This is what stores the pending deliveries for a given queue */
private Database _deliveryDb;
private static final String EXCHANGEDB_NAME = "exchangeDb";
private Database _exchangeDb;
+ private static final String NEW_EXCHANGE_DB_NAME = "EXCHANGE";
+
+
private static final String QUEUEBINDINGSDB_NAME = "queueBindingsDb";
private Database _queueBindingsDb;
private VirtualHost _virtualHost;
private final AtomicLong _messageId = new AtomicLong(1);
+
+ private final AtomicLong _queueId = new AtomicLong(1);
+
private static final AMQShortString EMPTY_SHORT_STRING = new AMQShortString("");
+
+
+
+
private final CommitThread _commitThread = new CommitThread("Commit-Thread");
+ private Map<AMQShortString, Long> _queueNameToIdMap = new ConcurrentHashMap<AMQShortString, Long>();
+
private enum State
{
INITIAL,
@@ -159,6 +176,9 @@
_commitThread.start();
+
+ upgradeIfNecessary();
+
// this recovers durable queues and persistent messages
recover();
@@ -166,6 +186,11 @@
stateTransition(State.RECOVERING, State.STARTED);
}
+ private void upgradeIfNecessary()
+ {
+
+ }
+
private synchronized void stateTransition(State requiredState, State newState) throws AMQException
{
if (_state != requiredState)
@@ -389,10 +414,10 @@
if (_state != State.RECOVERING)
{
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQShortStringTupleBinding();
+ EntryBinding keyBinding = new AMQShortStringTB();
keyBinding.objectToEntry(exchange.getName(), key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding exchangeBinding = new AMQExchangeTupleBinding(_virtualHost);
+ TupleBinding exchangeBinding = new ExchangeTB(_virtualHost);
exchangeBinding.objectToEntry(exchange, value);
try
{
@@ -415,7 +440,7 @@
public void removeExchange(Exchange exchange) throws AMQException
{
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQShortStringTupleBinding();
+ EntryBinding keyBinding = new AMQShortStringTB();
keyBinding.objectToEntry(exchange.getName(), key);
try
{
@@ -445,7 +470,7 @@
QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
- for (QueueBindingKey binding : loadQueueBindings(exchange))
+ for (BindingKey binding : loadQueueBindings(exchange))
{
AMQQueue queue = queueRegistry.getQueue(binding.getQueueName());
if (queue == null)
@@ -464,29 +489,29 @@
}
}
- private List<QueueBindingKey> loadQueueBindings(Exchange exchange) throws DatabaseException
+ private List<BindingKey> loadQueueBindings(Exchange exchange) throws DatabaseException
{
Cursor cursor = null;
- List<QueueBindingKey> queueBindings = new ArrayList<QueueBindingKey>();
+ List<BindingKey> queueBindings = new ArrayList<BindingKey>();
try
{
cursor = _queueBindingsDb.openCursor(null, null);
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
- AMQQueueBindingTupleBinding binding = new AMQQueueBindingTupleBinding(_virtualHost);
+ BindingTB binding = new BindingTB(_virtualHost);
- QueueBindingKey queueBinding =
- new QueueBindingKey(exchange.getName(), new AMQShortString(""), new AMQShortString(""), null);
+ BindingKey queueBinding =
+ new BindingKey(exchange.getName(), new AMQShortString(""), new AMQShortString(""), null);
- EntryBinding keyBinding = new AMQQueueBindingTupleBinding(_virtualHost);
+ EntryBinding keyBinding = new BindingTB(_virtualHost);
keyBinding.objectToEntry(queueBinding, key);
OperationStatus opStatus = cursor.getSearchKeyRange(key, value, LockMode.RMW);
while ((opStatus == OperationStatus.SUCCESS)
- && ((queueBinding = (QueueBindingKey) binding.entryToObject(key)).getExchangeName().equals(
+ && ((queueBinding = (BindingKey) binding.entryToObject(key)).getExchangeName().equals(
exchange.getName())))
{
queueBindings.add(queueBinding);
@@ -514,7 +539,7 @@
cursor = _exchangeDb.openCursor(null, null);
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
- AMQExchangeTupleBinding binding = new AMQExchangeTupleBinding(_virtualHost);
+ ExchangeTB binding = new ExchangeTB(_virtualHost);
while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
{
Exchange exchange = (Exchange) binding.entryToObject(value);
@@ -555,8 +580,8 @@
if (_state != State.RECOVERING)
{
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQQueueBindingTupleBinding(_virtualHost);
- keyBinding.objectToEntry(new QueueBindingKey(exchange.getName(), queue.getName(), routingKey, args), key);
+ EntryBinding keyBinding = new BindingTB(_virtualHost);
+ keyBinding.objectToEntry(new BindingKey(exchange.getName(), queue.getName(), routingKey, args), key);
DatabaseEntry value = new DatabaseEntry();
ByteBinding.byteToEntry((byte) 0, value);
@@ -586,8 +611,8 @@
throws AMQException
{
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQQueueBindingTupleBinding(_virtualHost);
- keyBinding.objectToEntry(new QueueBindingKey(exchange.getName(), queue.getName(), routingKey, args), key);
+ EntryBinding keyBinding = new BindingTB(_virtualHost);
+ keyBinding.objectToEntry(new BindingKey(exchange.getName(), queue.getName(), routingKey, args), key);
try
{
@@ -618,11 +643,14 @@
if (_state != State.RECOVERING)
{
+ long queueId = _queueId.getAndIncrement();
+ _queueNameToIdMap.put(queue.getName(),queueId);
+
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQShortStringTupleBinding();
+ EntryBinding keyBinding = new AMQShortStringTB();
keyBinding.objectToEntry(queue.getName(), key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding queueBinding = new AMQQueueTupleBinding(_virtualHost);
+ TupleBinding queueBinding = new QueueTB(_virtualHost);
queueBinding.objectToEntry(queue, value);
try
{
@@ -647,9 +675,10 @@
_log.debug("public void removeQueue(AMQShortString name = " + name + "): called");
+ Long queueId = _queueNameToIdMap.remove(name);
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQShortStringTupleBinding();
+ EntryBinding keyBinding = new AMQShortStringTB();
keyBinding.objectToEntry(name, key);
try
{
@@ -677,13 +706,13 @@
AMQQueue getQueue(AMQShortString name) throws AMQException
{
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new AMQShortStringTupleBinding();
+ EntryBinding keyBinding = new AMQShortStringTB();
keyBinding.objectToEntry(name, key);
DatabaseEntry value = new DatabaseEntry();
try
{
_queueDb.get(null, key, value, LockMode.RMW);
- AMQQueueTupleBinding binding = new AMQQueueTupleBinding(_virtualHost);
+ QueueTB binding = new QueueTB(_virtualHost);
return (AMQQueue) binding.entryToObject(value);
}
@@ -710,8 +739,8 @@
AMQShortString name = queue.getName();
Transaction tx = (Transaction) context.getPayload();
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new DeliveryDetailsKey.TupleBinding();
- DeliveryDetailsKey dd = new DeliveryDetailsKey(name, messageId);
+ EntryBinding keyBinding = new QueueEntryKey.TupleBinding();
+ QueueEntryKey dd = new QueueEntryKey(name, messageId);
keyBinding.objectToEntry(dd, key);
DatabaseEntry value = new DatabaseEntry();
ByteBinding.byteToEntry((byte) 0, value);
@@ -769,8 +798,8 @@
Transaction tx = (Transaction) context.getPayload();
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new DeliveryDetailsKey.TupleBinding();
- DeliveryDetailsKey dd = new DeliveryDetailsKey(name, messageId);
+ EntryBinding keyBinding = new QueueEntryKey.TupleBinding();
+ QueueEntryKey dd = new QueueEntryKey(name, messageId);
keyBinding.objectToEntry(dd, key);
@@ -955,9 +984,9 @@
DatabaseEntry key = new DatabaseEntry();
- DeliveryDetailsKey dd = new DeliveryDetailsKey(queueName, 0);
+ QueueEntryKey dd = new QueueEntryKey(queueName, 0);
- EntryBinding keyBinding = new DeliveryDetailsKey.TupleBinding();
+ EntryBinding keyBinding = new QueueEntryKey.TupleBinding();
keyBinding.objectToEntry(dd, key);
DatabaseEntry value = new DatabaseEntry();
@@ -965,7 +994,7 @@
LinkedList<Long> messageIds = new LinkedList<Long>();
OperationStatus status = cursor.getSearchKeyRange(key, value, LockMode.DEFAULT);
- dd = (DeliveryDetailsKey) keyBinding.entryToObject(key);
+ dd = (QueueEntryKey) keyBinding.entryToObject(key);
while ((status == OperationStatus.SUCCESS) && dd.queueName.equals(queueName))
{
@@ -974,7 +1003,7 @@
status = cursor.getNext(key, value, LockMode.DEFAULT);
if (status == OperationStatus.SUCCESS)
{
- dd = (DeliveryDetailsKey) keyBinding.entryToObject(key);
+ dd = (QueueEntryKey) keyBinding.entryToObject(key);
}
}
@@ -1055,7 +1084,7 @@
TupleBinding keyBinding = new MessageContentKey.TupleBinding();
keyBinding.objectToEntry(new MessageContentKey(messageId, index), key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding messageBinding = new MessageContentTupleBinding();
+ TupleBinding messageBinding = new ContentTB();
messageBinding.objectToEntry(contentBody, value);
try
{
@@ -1100,7 +1129,7 @@
EntryBinding keyBinding = TupleBinding.getPrimitiveBinding(Long.class);
keyBinding.objectToEntry(messageId, key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding messageBinding = new MessageMetaDataTupleBinding();
+ TupleBinding messageBinding = new MessageMetaDataTB();
messageBinding.objectToEntry(messageMetaData, value);
try
{
@@ -1138,7 +1167,7 @@
EntryBinding keyBinding = TupleBinding.getPrimitiveBinding(Long.class);
keyBinding.objectToEntry(messageId, key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding messageBinding = new MessageMetaDataTupleBinding();
+ TupleBinding messageBinding = new MessageMetaDataTB();
try
{
@@ -1177,7 +1206,7 @@
TupleBinding keyBinding = new MessageContentKey.TupleBinding();
keyBinding.objectToEntry(new MessageContentKey(messageId, index), key);
DatabaseEntry value = new DatabaseEntry();
- TupleBinding messageBinding = new MessageContentTupleBinding();
+ TupleBinding messageBinding = new ContentTB();
if (_log.isDebugEnabled())
{
_log.debug("Message Id: " + messageId + " Getting content body chunk: " + index);
@@ -1212,7 +1241,7 @@
cursor = _queueDb.openCursor(null, null);
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
- AMQQueueTupleBinding binding = new AMQQueueTupleBinding(_virtualHost);
+ QueueTB binding = new QueueTB(_virtualHost);
while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
{
AMQQueue queue = (AMQQueue) binding.entryToObject(value);
@@ -1267,7 +1296,7 @@
Transaction tx = (Transaction) context.getPayload();
cursor = _deliveryDb.openCursor(tx, null);
DatabaseEntry key = new DatabaseEntry();
- EntryBinding keyBinding = new DeliveryDetailsKey.TupleBinding();
+ EntryBinding keyBinding = new QueueEntryKey.TupleBinding();
DatabaseEntry value = new DatabaseEntry();
EntryBinding valueBinding = TupleBinding.getPrimitiveBinding(Long.class);
@@ -1279,7 +1308,7 @@
while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
{
- DeliveryDetailsKey dd = (DeliveryDetailsKey) keyBinding.entryToObject(key);
+ QueueEntryKey dd = (QueueEntryKey) keyBinding.entryToObject(key);
AMQShortString queueName = dd.queueName;
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueBindingKey.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,49 @@
+package org.apache.qpid.server.store.berkeleydb;
+
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: U146758
+ * Date: 19-Feb-2007
+ * Time: 14:11:01
+ * To change this template use File | Settings | File Templates.
+ */
+public class BindingKey extends Object
+{
+ private final AMQShortString _exchangeName;
+ private final AMQShortString _queueName;
+ private final AMQShortString _routingKey;
+ private final FieldTable _arguments;
+
+ public BindingKey(AMQShortString exchangeName, AMQShortString queueName, AMQShortString routingKey, FieldTable arguments)
+ {
+ _exchangeName = exchangeName;
+ _queueName = queueName;
+ _routingKey = routingKey;
+ _arguments = arguments;
+ }
+
+
+ public AMQShortString getExchangeName()
+ {
+ return _exchangeName;
+ }
+
+ public AMQShortString getQueueName()
+ {
+ return _queueName;
+ }
+
+ public AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ public FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingKey.java
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueBindingTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,57 @@
+package org.apache.qpid.server.store.berkeleydb;
+
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+
+import com.sleepycat.bind.tuple.TupleBinding;
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+import com.sleepycat.je.DatabaseException;
+import org.apache.log4j.Logger;
+
+public class BindingTB extends TupleBinding
+{
+ private static final Logger _log = Logger.getLogger(BindingTB.class);
+
+
+
+ private final VirtualHost _virtualHost;
+
+ public BindingTB(VirtualHost virtualHost)
+ {
+ _virtualHost = virtualHost;
+ }
+
+ public Object entryToObject(TupleInput tupleInput)
+ {
+ try
+ {
+ AMQShortString exchangeName = AMQShortStringEncoding.readShortString(tupleInput);
+ AMQShortString queueName = AMQShortStringEncoding.readShortString(tupleInput);
+ AMQShortString routingKey = AMQShortStringEncoding.readShortString(tupleInput);
+ FieldTable arguments = FieldTableEncoding.readFieldTable(tupleInput);
+
+
+
+ return new BindingKey(exchangeName,queueName,routingKey,arguments);
+ }
+ catch (DatabaseException e)
+ {
+ _log.error("Unable to create binding: " + e, e);
+ return null;
+ }
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ BindingKey binding = (BindingKey) object;
+
+
+ AMQShortStringEncoding.writeShortString(binding.getExchangeName(),tupleOutput);
+ AMQShortStringEncoding.writeShortString(binding.getQueueName(),tupleOutput);
+ AMQShortStringEncoding.writeShortString(binding.getRoutingKey(),tupleOutput);
+ FieldTableEncoding.writeFieldTable(binding.getArguments(),tupleOutput);
+
+ }
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BindingTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,77 @@
+/*
+ *
+ * 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.qpid.framing.ContentBody;
+import org.apache.qpid.framing.abstraction.ContentChunk;
+
+import org.apache.mina.common.ByteBuffer;
+
+/**
+ * @author Robert Greig (robert.j.greig(a)jpmorgan.com)
+ */
+public class ContentTB extends TupleBinding
+{
+ public Object entryToObject(TupleInput tupleInput)
+ {
+
+ final int size = tupleInput.readInt();
+ byte[] underlying = new byte[size];
+ tupleInput.readFast(underlying);
+ final ByteBuffer data = ByteBuffer.wrap(underlying);
+ ContentChunk cb = new ContentChunk()
+ {
+
+ public int getSize()
+ {
+ return size;
+ }
+
+ public ByteBuffer getData()
+ {
+ return data;
+ }
+
+ public void reduceToFit()
+ {
+
+ }
+ };
+ return cb;
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ ContentChunk cb = (ContentChunk) object;
+ final int size = cb.getSize();
+ byte[] underlying = new byte[size];
+
+ ByteBuffer buf = cb.getData();
+
+ buf.duplicate().rewind().get(underlying);
+
+ tupleOutput.writeInt(size);
+ tupleOutput.writeFast(underlying);
+ }
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DeliveryDetailsKey.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DeliveryDetailsKey.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DeliveryDetailsKey.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,64 +0,0 @@
-package org.apache.qpid.server.store.berkeleydb;
-
-import com.sleepycat.bind.tuple.TupleInput;
-import com.sleepycat.bind.tuple.TupleOutput;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * @author Apache Software Foundation
- */
-public class DeliveryDetailsKey
-{
- public AMQShortString queueName;
- public long messageId;
-
-
- public DeliveryDetailsKey()
- {
- }
-
-
- public DeliveryDetailsKey(byte[] payload)
- {
- final TupleInput ti = new TupleInput(payload);
-
- queueName = AMQShortStringEncoding.readShortString(ti);
-
- messageId = ti.readLong();
-
- }
-
- public static class TupleBinding extends com.sleepycat.bind.tuple.TupleBinding
- {
- public Object entryToObject(TupleInput tupleInput)
- {
- final DeliveryDetailsKey mk = new DeliveryDetailsKey();
-
-
- mk.queueName = AMQShortStringEncoding.readShortString(tupleInput);
- mk.messageId = tupleInput.readLong();
-
- return mk;
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- final DeliveryDetailsKey mk = (DeliveryDetailsKey) object;
-
- AMQShortStringEncoding.writeShortString(mk.queueName,tupleOutput);
- tupleOutput.writeLong(mk.messageId);
-
- }
-
-
- }
-
- public DeliveryDetailsKey(AMQShortString queueName, long messageId)
- {
- this.queueName = queueName;
- this.messageId = messageId;
- }
-
-
-}
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQExchangeTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,57 @@
+package org.apache.qpid.server.store.berkeleydb;
+
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.AMQException;
+
+import com.sleepycat.bind.tuple.TupleBinding;
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+import org.apache.log4j.Logger;
+
+public class ExchangeTB extends TupleBinding
+{
+ private static final Logger _log = Logger.getLogger(ExchangeTB.class);
+
+
+
+ private final VirtualHost _virtualHost;
+
+ public ExchangeTB(VirtualHost virtualHost)
+ {
+ _virtualHost = virtualHost;
+ }
+
+ public Object entryToObject(TupleInput tupleInput)
+ {
+
+ AMQShortString name = AMQShortStringEncoding.readShortString(tupleInput);
+ AMQShortString typeName = AMQShortStringEncoding.readShortString(tupleInput);
+
+
+ boolean autoDelete = tupleInput.readBoolean();
+
+ try
+ {
+ return _virtualHost.getExchangeFactory().createExchange(name, typeName, true, autoDelete, 0);
+ }
+ catch (AMQException e)
+ {
+ _log.error("Unable to create exchange: " + e, e);
+ return null;
+ }
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ Exchange exchange = (Exchange) object;
+
+
+ AMQShortStringEncoding.writeShortString(exchange.getName(),tupleOutput);
+ AMQShortStringEncoding.writeShortString(exchange.getType(),tupleOutput);
+
+ tupleOutput.writeBoolean(exchange.isAutoDelete());
+
+ }
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ExchangeTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageContentTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,77 +0,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.
- *
- */
-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.qpid.framing.ContentBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * @author Robert Greig (robert.j.greig(a)jpmorgan.com)
- */
-public class MessageContentTupleBinding extends TupleBinding
-{
- public Object entryToObject(TupleInput tupleInput)
- {
-
- final int size = tupleInput.readInt();
- byte[] underlying = new byte[size];
- tupleInput.readFast(underlying);
- final ByteBuffer data = ByteBuffer.wrap(underlying);
- ContentChunk cb = new ContentChunk()
- {
-
- public int getSize()
- {
- return size;
- }
-
- public ByteBuffer getData()
- {
- return data;
- }
-
- public void reduceToFit()
- {
-
- }
- };
- return cb;
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- ContentChunk cb = (ContentChunk) object;
- final int size = cb.getSize();
- byte[] underlying = new byte[size];
-
- ByteBuffer buf = cb.getData();
-
- buf.duplicate().rewind().get(underlying);
-
- tupleOutput.writeInt(size);
- tupleOutput.writeFast(underlying);
- }
-}
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,142 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed 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.mina.common.ByteBuffer;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+import org.apache.qpid.framing.abstraction.MessagePublishInfo;
+import org.apache.qpid.server.queue.MessageMetaData;
+
+/**
+ * Handles the mapping to and from message meta data
+ */
+public class MessageMetaDataTB extends TupleBinding
+{
+ private static final Logger _log = Logger.getLogger(MessageMetaDataTB.class);
+
+ public Object entryToObject(TupleInput tupleInput)
+ {
+ try
+ {
+ final MessagePublishInfo publishBody = readMessagePublishInfo(tupleInput);
+ final ContentHeaderBody contentHeaderBody = readContentHeaderBody(tupleInput);
+ final int contentChunkCount = tupleInput.readInt();
+ return new MessageMetaData(publishBody, contentHeaderBody, contentChunkCount);
+ }
+ catch (Exception e)
+ {
+ _log.error("Error converting entry to object: " + e, e);
+ // annoyingly just have to return null since we cannot throw
+ return null;
+ }
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ MessageMetaData message = (MessageMetaData) object;
+ try
+ {
+ writeMessagePublishInfo(message.getMessagePublishInfo(), tupleOutput);
+ }
+ catch (AMQException e)
+ {
+ // can't do anything else since the BDB interface precludes throwing any exceptions
+ // in practice we should never get an exception
+ throw new RuntimeException("Error converting object to entry: " + e, e);
+ }
+ writeContentHeader(message.getContentHeaderBody(), tupleOutput);
+ tupleOutput.writeInt(message.getContentChunkCount());
+ }
+
+ private MessagePublishInfo readMessagePublishInfo(TupleInput tupleInput)
+ {
+
+ final AMQShortString exchange = AMQShortStringEncoding.readShortString(tupleInput);
+ final AMQShortString routingKey = AMQShortStringEncoding.readShortString(tupleInput);
+ final boolean mandatory = tupleInput.readBoolean();
+ final boolean immediate = tupleInput.readBoolean();
+
+ return new MessagePublishInfo()
+ {
+
+ public AMQShortString getExchange()
+ {
+ return exchange;
+ }
+
+ public void setExchange(AMQShortString exchange)
+ {
+
+ }
+
+ public boolean isImmediate()
+ {
+ return immediate;
+ }
+
+ public boolean isMandatory()
+ {
+ return mandatory;
+ }
+
+ public AMQShortString getRoutingKey()
+ {
+ return routingKey;
+ }
+ } ;
+
+ }
+
+
+ private ContentHeaderBody readContentHeaderBody(TupleInput tupleInput) throws AMQFrameDecodingException, AMQProtocolVersionException
+ {
+ int bodySize = tupleInput.readInt();
+ byte[] underlying = new byte[bodySize];
+ tupleInput.readFast(underlying);
+ ByteBuffer buf = ByteBuffer.wrap(underlying);
+
+ return ContentHeaderBody.createFromBuffer(buf, bodySize);
+ }
+
+ private void writeMessagePublishInfo(MessagePublishInfo publishBody, TupleOutput tupleOutput) throws AMQException
+ {
+
+
+ AMQShortStringEncoding.writeShortString(publishBody.getExchange(), tupleOutput);
+ AMQShortStringEncoding.writeShortString(publishBody.getRoutingKey(), tupleOutput);
+ tupleOutput.writeBoolean(publishBody.isMandatory());
+ tupleOutput.writeBoolean(publishBody.isImmediate());
+
+ }
+
+ private void writeContentHeader(ContentHeaderBody headerBody, TupleOutput tupleOutput)
+ {
+ // write out the content header body
+ final int bodySize = headerBody.getSize();
+ byte[] underlying = new byte[bodySize];
+ ByteBuffer buf = ByteBuffer.wrap(underlying);
+ headerBody.writePayload(buf);
+ tupleOutput.writeInt(bodySize);
+ tupleOutput.writeFast(underlying);
+ }
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTupleBinding.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTupleBinding.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTupleBinding.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,142 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * Licensed 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.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.queue.MessageMetaData;
-
-/**
- * Handles the mapping to and from message meta data
- */
-public class MessageMetaDataTupleBinding extends TupleBinding
-{
- private static final Logger _log = Logger.getLogger(MessageMetaDataTupleBinding.class);
-
- public Object entryToObject(TupleInput tupleInput)
- {
- try
- {
- final MessagePublishInfo publishBody = readMessagePublishInfo(tupleInput);
- final ContentHeaderBody contentHeaderBody = readContentHeaderBody(tupleInput);
- final int contentChunkCount = tupleInput.readInt();
- return new MessageMetaData(publishBody, contentHeaderBody, contentChunkCount);
- }
- catch (Exception e)
- {
- _log.error("Error converting entry to object: " + e, e);
- // annoyingly just have to return null since we cannot throw
- return null;
- }
- }
-
- public void objectToEntry(Object object, TupleOutput tupleOutput)
- {
- MessageMetaData message = (MessageMetaData) object;
- try
- {
- writeMessagePublishInfo(message.getMessagePublishInfo(), tupleOutput);
- }
- catch (AMQException e)
- {
- // can't do anything else since the BDB interface precludes throwing any exceptions
- // in practice we should never get an exception
- throw new RuntimeException("Error converting object to entry: " + e, e);
- }
- writeContentHeader(message.getContentHeaderBody(), tupleOutput);
- tupleOutput.writeInt(message.getContentChunkCount());
- }
-
- private MessagePublishInfo readMessagePublishInfo(TupleInput tupleInput)
- {
-
- final AMQShortString exchange = AMQShortStringEncoding.readShortString(tupleInput);
- final AMQShortString routingKey = AMQShortStringEncoding.readShortString(tupleInput);
- final boolean mandatory = tupleInput.readBoolean();
- final boolean immediate = tupleInput.readBoolean();
-
- return new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return exchange;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return routingKey;
- }
- } ;
-
- }
-
-
- private ContentHeaderBody readContentHeaderBody(TupleInput tupleInput) throws AMQFrameDecodingException, AMQProtocolVersionException
- {
- int bodySize = tupleInput.readInt();
- byte[] underlying = new byte[bodySize];
- tupleInput.readFast(underlying);
- ByteBuffer buf = ByteBuffer.wrap(underlying);
-
- return ContentHeaderBody.createFromBuffer(buf, bodySize);
- }
-
- private void writeMessagePublishInfo(MessagePublishInfo publishBody, TupleOutput tupleOutput) throws AMQException
- {
-
-
- AMQShortStringEncoding.writeShortString(publishBody.getExchange(), tupleOutput);
- AMQShortStringEncoding.writeShortString(publishBody.getRoutingKey(), tupleOutput);
- tupleOutput.writeBoolean(publishBody.isMandatory());
- tupleOutput.writeBoolean(publishBody.isImmediate());
-
- }
-
- private void writeContentHeader(ContentHeaderBody headerBody, TupleOutput tupleOutput)
- {
- // write out the content header body
- final int bodySize = headerBody.getSize();
- byte[] underlying = new byte[bodySize];
- ByteBuffer buf = ByteBuffer.wrap(underlying);
- headerBody.writePayload(buf);
- tupleOutput.writeInt(bodySize);
- tupleOutput.writeFast(underlying);
- }
-}
Deleted: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueBindingKey.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueBindingKey.java 2008-05-29 16:05:10 UTC (rev 2085)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueBindingKey.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -1,49 +0,0 @@
-package org.apache.qpid.server.store.berkeleydb;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-/**
- * Created by IntelliJ IDEA.
- * User: U146758
- * Date: 19-Feb-2007
- * Time: 14:11:01
- * To change this template use File | Settings | File Templates.
- */
-public class QueueBindingKey extends Object
-{
- private final AMQShortString _exchangeName;
- private final AMQShortString _queueName;
- private final AMQShortString _routingKey;
- private final FieldTable _arguments;
-
- public QueueBindingKey(AMQShortString exchangeName, AMQShortString queueName, AMQShortString routingKey, FieldTable arguments)
- {
- _exchangeName = exchangeName;
- _queueName = queueName;
- _routingKey = routingKey;
- _arguments = arguments;
- }
-
-
- public AMQShortString getExchangeName()
- {
- return _exchangeName;
- }
-
- public AMQShortString getQueueName()
- {
- return _queueName;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
-
- public FieldTable getArguments()
- {
- return _arguments;
- }
-
-}
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/DeliveryDetailsKey.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,64 @@
+package org.apache.qpid.server.store.berkeleydb;
+
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+
+import org.apache.qpid.framing.AMQShortString;
+
+/**
+ * @author Apache Software Foundation
+ */
+public class QueueEntryKey
+{
+ public AMQShortString queueName;
+ public long messageId;
+
+
+ public QueueEntryKey()
+ {
+ }
+
+
+ public QueueEntryKey(byte[] payload)
+ {
+ final TupleInput ti = new TupleInput(payload);
+
+ queueName = AMQShortStringEncoding.readShortString(ti);
+
+ messageId = ti.readLong();
+
+ }
+
+ public static class TupleBinding extends com.sleepycat.bind.tuple.TupleBinding
+ {
+ public Object entryToObject(TupleInput tupleInput)
+ {
+ final QueueEntryKey mk = new QueueEntryKey();
+
+
+ mk.queueName = AMQShortStringEncoding.readShortString(tupleInput);
+ mk.messageId = tupleInput.readLong();
+
+ return mk;
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ final QueueEntryKey mk = (QueueEntryKey) object;
+
+ AMQShortStringEncoding.writeShortString(mk.queueName,tupleOutput);
+ tupleOutput.writeLong(mk.messageId);
+
+ }
+
+
+ }
+
+ public QueueEntryKey(AMQShortString queueName, long messageId)
+ {
+ this.queueName = queueName;
+ this.messageId = messageId;
+ }
+
+
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueEntryKey.java
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueTB.java (from rev 2039, store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AMQQueueTupleBinding.java)
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueTB.java (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueTB.java 2008-05-29 16:22:36 UTC (rev 2086)
@@ -0,0 +1,69 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed 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.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.log4j.Logger;
+
+public class QueueTB extends TupleBinding
+{
+ private static final Logger _log = Logger.getLogger(QueueTB.class);
+
+
+
+ private final VirtualHost _virtualHost;
+
+ public QueueTB(VirtualHost virtualHost)
+ {
+ _virtualHost = virtualHost;
+ }
+
+ public Object entryToObject(TupleInput tupleInput)
+ {
+ AMQShortString name = AMQShortStringEncoding.readShortString(tupleInput);
+ AMQShortString owner = AMQShortStringEncoding.readShortString(tupleInput);
+
+
+ try
+ {
+ return AMQQueueFactory.createAMQQueueImpl(name, true, owner, false, _virtualHost, null);
+ }
+ catch (AMQException e)
+ {
+ _log.error("Unable to create queue: " + e, e);
+ return null;
+ }
+ }
+
+ public void objectToEntry(Object object, TupleOutput tupleOutput)
+ {
+ AMQQueue queue = (AMQQueue) object;
+
+
+ AMQShortStringEncoding.writeShortString(queue.getName(),tupleOutput);
+ AMQShortStringEncoding.writeShortString(queue.getOwner(),tupleOutput);
+
+ }
+}
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/QueueTB.java
___________________________________________________________________
Name: svn:eol-style
+ native
16 years, 7 months
rhmessaging commits: r2085 - store/branches/java/M2.1-release/java/bdbstore.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-05-29 12:05:10 -0400 (Thu, 29 May 2008)
New Revision: 2085
Modified:
store/branches/java/M2.1-release/java/bdbstore/pom.xml
Log:
Updated POM to reflect the M2.1 release status rather than SNAPSHOT
Modified: store/branches/java/M2.1-release/java/bdbstore/pom.xml
===================================================================
--- store/branches/java/M2.1-release/java/bdbstore/pom.xml 2008-05-28 21:50:19 UTC (rev 2084)
+++ store/branches/java/M2.1-release/java/bdbstore/pom.xml 2008-05-29 16:05:10 UTC (rev 2085)
@@ -22,14 +22,14 @@
<groupId>org.etp.qpid</groupId>
<artifactId>qpid-bdbstore</artifactId>
<packaging>jar</packaging>
- <version>1.0-incubating-M2.1-SNAPSHOT</version>
+ <version>1.0-incubating-M2.1</version>
<name>Qpid BDB Store</name>
<url>http://cwiki.apache.org/confluence/display/qpid</url>
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid</artifactId>
- <version>1.0-incubating-M2.1-SNAPSHOT</version>
+ <version>1.0-incubating-M2.1</version>
</parent>
<!-- Local repository for the BerkelyDB-je so we don't have to use the installer script -->
16 years, 7 months
rhmessaging commits: r2084 - store/trunk/cpp/etc.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-05-28 17:50:19 -0400 (Wed, 28 May 2008)
New Revision: 2084
Modified:
store/trunk/cpp/etc/rhmd
Log:
Fix service startup for RHEL4 compatibility
Modified: store/trunk/cpp/etc/rhmd
===================================================================
--- store/trunk/cpp/etc/rhmd 2008-05-28 19:10:41 UTC (rev 2083)
+++ store/trunk/cpp/etc/rhmd 2008-05-28 21:50:19 UTC (rev 2084)
@@ -32,7 +32,7 @@
start() {
echo -n $"Starting RHM daemon: "
- daemon --pidfile $pidfile --check $prog --user qpidd /usr/sbin/$prog --daemon --config=/etc/rhmd.conf
+ runuser -s /bin/sh qpidd -c "qpidd --daemon --config=/etc/rhmd.conf"
RETVAL=$?
if [ $RETVAL = 0 ] ; then success ; else failure ; fi
echo
16 years, 7 months
rhmessaging commits: r2083 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 15:10:41 -0400 (Wed, 28 May 2008)
New Revision: 2083
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/wooly/__init__.py
mgmt/cumin/python/wooly/forms.py
Log:
Rename Error to FormError to avoid potential collisions
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-05-28 14:57:36 UTC (rev 2082)
+++ mgmt/cumin/python/cumin/exchange.py 2008-05-28 19:10:41 UTC (rev 2083)
@@ -274,7 +274,7 @@
error = EmptyInputError(exchange_name)
self.exchange_name.add_error(session, error)
elif " " in name:
- error = Error("""
+ error = FormError("""
The exchange name is invalid; allowed characters are
letters, digits, ".", and "_"
""")
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-05-28 14:57:36 UTC (rev 2082)
+++ mgmt/cumin/python/cumin/widgets.py 2008-05-28 19:10:41 UTC (rev 2083)
@@ -538,7 +538,7 @@
if self.legal_chars_desc:
msg = msg + "; " + self.legal_chars_desc
- errors.append(Error(msg))
+ errors.append(FormError(msg))
break
@@ -570,7 +570,7 @@
if results.count() > 0:
errors.append(DuplicateValueError())
-class DuplicateValueError(Error):
+class DuplicateValueError(FormError):
def __init__(self, fld="name"):
super(DuplicateValueError, self).__init__()
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2008-05-28 14:57:36 UTC (rev 2082)
+++ mgmt/cumin/python/wooly/__init__.py 2008-05-28 19:10:41 UTC (rev 2083)
@@ -604,13 +604,6 @@
return "%s(trunk=%s,app=%s)" % \
(self.__class__.__name__, self.trunk, self.app)
-class Error(object):
- def __init__(self, message=None):
- self.message = message
-
- def get_message(self, session):
- return self.message
-
class StringIOWriter(object):
def __init__(self):
self.writer = StringIO()
Modified: mgmt/cumin/python/wooly/forms.py
===================================================================
--- mgmt/cumin/python/wooly/forms.py 2008-05-28 14:57:36 UTC (rev 2082)
+++ mgmt/cumin/python/wooly/forms.py 2008-05-28 19:10:41 UTC (rev 2083)
@@ -91,11 +91,18 @@
def render_disabled_attr(self, session, *args):
return self.disabled and "disabled=\"disabled\"" or None
-class MissingValueError(Error):
+class FormError(object):
+ def __init__(self, message=None):
+ self.message = message
+
def get_message(self, session):
+ return self.message
+
+class MissingValueError(FormError):
+ def get_message(self, session):
return "This value is required"
-class EmptyInputError(Error):
+class EmptyInputError(FormError):
def __init__(self):
message = "This value is required"
16 years, 7 months
rhmessaging commits: r2082 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 10:57:36 -0400 (Wed, 28 May 2008)
New Revision: 2082
Modified:
mgmt/cumin/python/cumin/test.py
Log:
Reorder the top-level tests to avoid name collisions
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-05-28 14:32:49 UTC (rev 2081)
+++ mgmt/cumin/python/cumin/test.py 2008-05-28 14:57:36 UTC (rev 2082)
@@ -22,6 +22,7 @@
self.vhost = None
self.queue = None
self.exchange = None
+ self.broker_group = None
def init(self):
self.broker_conn.open()
@@ -203,8 +204,8 @@
def __init__(self, env):
super(MainTest, self).__init__(env, None)
- BrokerRegistrationTest(env, self)
BrokerGroupTest(env, self)
+ BrokerRegistrationTest(env, self)
class BrokerRegistrationTest(Test):
def __init__(self, env, parent):
@@ -240,11 +241,6 @@
class AddToGroup(Test):
def do_run(self, session):
- group = BrokerGroup(name=session.id)
- group.sync()
-
- p, s = self.env.page_and_session()
-
raise Exception("Not implemented")
class Remove(Test):
16 years, 7 months
rhmessaging commits: r2081 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 10:32:49 -0400 (Wed, 28 May 2008)
New Revision: 2081
Modified:
mgmt/cumin/python/cumin/broker.py
Log:
bz446977 - Use an initiator-set url to return from BrokerSetRemove form completion
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-05-28 14:07:46 UTC (rev 2080)
+++ mgmt/cumin/python/cumin/broker.py 2008-05-28 14:32:49 UTC (rev 2081)
@@ -52,8 +52,9 @@
self.parent.ids.clear(session)
branch = session.branch()
- frame = self.frame.show_brokers_remove(branch)
+ frame = self.page.show_main(branch).show_brokers_remove(branch)
frame.ids.set(branch, ids)
+ frame.return_url.set(branch, session.marshal())
self.page.set_redirect_url(session, branch.marshal())
class BrokerSetGroupInput(BrokerGroupInput):
@@ -744,11 +745,14 @@
return "No, Cancel"
class BrokerSetRemove(CuminBulkActionForm, Frame):
+ def __init__(self, app, name):
+ super(BrokerSetRemove, self).__init__(app, name)
+
+ self.return_url = Parameter(app, "return_url")
+ self.add_parameter(self.return_url)
+
def process_return(self, session):
- branch = session.branch()
- self.frame.show_view(branch)
- self.page.set_current_frame(branch, self.frame)
- self.page.set_redirect_url(session, branch.marshal())
+ self.page.set_redirect_url(session, self.return_url.get(session))
def process_item(self, session, id):
action = self.app.model.broker_registration.remove
16 years, 7 months
rhmessaging commits: r2080 - mgmt/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 10:07:46 -0400 (Wed, 28 May 2008)
New Revision: 2080
Modified:
mgmt/cumin/python/wooly/server.py
Log:
Return a string on error in non-debug modes
Modified: mgmt/cumin/python/wooly/server.py
===================================================================
--- mgmt/cumin/python/wooly/server.py 2008-05-28 14:06:46 UTC (rev 2079)
+++ mgmt/cumin/python/wooly/server.py 2008-05-28 14:07:46 UTC (rev 2080)
@@ -126,3 +126,5 @@
writer.write("\n----- render trace -----\n")
session.debug.print_render_calls(writer)
return writer.to_string()
+ else:
+ return "APPLICATION ERROR\n"
16 years, 7 months