[jboss-cvs] JBoss Messaging SVN: r1931 - in trunk/src/main/org/jboss/jms: server/destination and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 9 14:40:17 EST 2007
Author: timfox
Date: 2007-01-09 14:40:14 -0500 (Tue, 09 Jan 2007)
New Revision: 1931
Modified:
trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
trunk/src/main/org/jboss/jms/server/destination/ManagedDestination.java
trunk/src/main/org/jboss/jms/server/destination/ManagedTopic.java
Log:
A couple of fixes
Modified: trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java 2007-01-09 18:16:04 UTC (rev 1930)
+++ trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java 2007-01-09 19:40:14 UTC (rev 1931)
@@ -80,11 +80,15 @@
// maintain a reference to the FailoverCommandCenter instance.
fcc = connectionState.getFailoverCommandCenter();
- valve = fcc.getValve();
+
+ if (fcc != null)
+ {
+ valve = fcc.getValve();
+ }
}
// non clustered.. noop
- if (fcc==null)
+ if (fcc == null)
{
return invocation.invokeNext();
}
Modified: trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2007-01-09 18:16:04 UTC (rev 1930)
+++ trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2007-01-09 19:40:14 UTC (rev 1931)
@@ -17,14 +17,12 @@
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.util.ExceptionUtil;
-import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.MessagingComponent;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
import org.jboss.messaging.core.plugin.contract.ServerPlugin;
-import org.jboss.messaging.core.plugin.postoffice.Binding;
import org.jboss.messaging.core.tx.TransactionRepository;
import org.jboss.system.ServiceMBeanSupport;
import org.w3c.dom.Element;
@@ -219,24 +217,12 @@
{
//Ok
}
-
- Queue dlq = null;
-
- if (dest != null)
- {
- Binding binding = postOffice.getBindingForQueueName(dest.getName());
-
- if (binding != null && binding.getQueue().isActive())
- {
- dlq = binding.getQueue();
- }
- }
-
- destination.setDLQ(dlq);
+
+ destination.setDLQ(dest);
}
catch (Throwable t)
{
- throw ExceptionUtil.handleJMXInvocation(t, this + " setDLQ");
+ throw ExceptionUtil.handleJMXInvocation(t, " setDLQ");
}
}
@@ -249,21 +235,21 @@
{
expiryQueueObjectName = on;
- Queue expiryQueue = null;
+ ManagedQueue dest = null;
try
- {
-
+ {
try
- {
- expiryQueue = (Queue)server.getAttribute(expiryQueueObjectName, "Instance");
+ {
+ dest = (ManagedQueue)getServer().
+ getAttribute(expiryQueueObjectName, "Instance");
}
- catch (Exception e)
+ catch (InstanceNotFoundException e)
{
//Ok
}
- destination.setExpiryQueue(expiryQueue);
+ destination.setExpiryQueue(dest);
}
catch (Throwable t)
{
Modified: trunk/src/main/org/jboss/jms/server/destination/ManagedDestination.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/destination/ManagedDestination.java 2007-01-09 18:16:04 UTC (rev 1930)
+++ trunk/src/main/org/jboss/jms/server/destination/ManagedDestination.java 2007-01-09 19:40:14 UTC (rev 1931)
@@ -79,9 +79,9 @@
protected ServerPeer serverPeer;
- protected Queue dlq;
+ protected ManagedQueue dlq;
- protected Queue expiryQueue;
+ protected ManagedQueue expiryQueue;
protected long redeliveryDelay;
@@ -194,22 +194,48 @@
this.temporary = temporary;
}
- public Queue getDLQ()
+ //Need to get lazily because of crappy dependencies
+ public Queue getDLQ() throws Exception
{
- return dlq;
+ Queue theQueue = null;
+
+ if (dlq != null)
+ {
+ Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(dlq.getName());
+
+ if (binding != null && binding.getQueue().isActive())
+ {
+ theQueue = binding.getQueue();
+ }
+ }
+
+ return theQueue;
}
- public void setDLQ(Queue dlq)
+ public void setDLQ(ManagedQueue dlq)
{
this.dlq = dlq;
}
- public Queue getExpiryQueue()
+ //Need to get lazily because of crappy dependencies
+ public Queue getExpiryQueue() throws Exception
{
- return expiryQueue;
+ Queue theQueue = null;
+
+ if (expiryQueue != null)
+ {
+ Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(expiryQueue.getName());
+
+ if (binding != null && binding.getQueue().isActive())
+ {
+ theQueue = binding.getQueue();
+ }
+ }
+
+ return theQueue;
}
- public void setExpiryQueue(Queue expiryQueue)
+ public void setExpiryQueue(ManagedQueue expiryQueue)
{
this.expiryQueue = expiryQueue;
}
Modified: trunk/src/main/org/jboss/jms/server/destination/ManagedTopic.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2007-01-09 18:16:04 UTC (rev 1930)
+++ trunk/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2007-01-09 19:40:14 UTC (rev 1931)
@@ -213,6 +213,11 @@
{
List msgs = new ArrayList();
+ if (subId == null || "".equals(subId.trim()))
+ {
+ return msgs;
+ }
+
Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(subId);
if (binding == null)
More information about the jboss-cvs-commits
mailing list