[jboss-cvs] jboss-jms/src/main/org/jboss/jms/server/destination ...

Timothy Fox tim.fox at jboss.com
Thu Jul 27 15:01:54 EDT 2006


  User: timfox  
  Date: 06/07/27 15:01:54

  Modified:    src/main/org/jboss/jms/server/destination   
                        DestinationServiceSupport.java Queue.java
                        Topic.java
  Log:
  Mainly http://jira.jboss.com/jira/browse/JBMESSAGING-434 plus a few other bits and pieces
  
  Revision  Changes    Path
  1.21      +19 -13    jboss-jms/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DestinationServiceSupport.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- DestinationServiceSupport.java	27 Jun 2006 19:44:38 -0000	1.20
  +++ DestinationServiceSupport.java	27 Jul 2006 19:01:54 -0000	1.21
  @@ -12,6 +12,7 @@
   import org.jboss.jms.server.SecurityManager;
   import org.jboss.jms.server.ServerPeer;
   import org.jboss.jms.server.plugin.contract.ChannelMapper;
  +import org.jboss.jms.util.ExceptionUtil;
   import org.jboss.jms.util.XMLUtil;
   import org.jboss.system.ServiceMBeanSupport;
   import org.w3c.dom.Element;
  @@ -24,9 +25,9 @@
    * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
    * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
    * 
  - * @version <tt>$Revision: 1.20 $</tt>
  + * @version <tt>$Revision: 1.21 $</tt>
    *
  - * $Id: DestinationServiceSupport.java,v 1.20 2006/06/27 19:44:38 timfox Exp $
  + * $Id: DestinationServiceSupport.java,v 1.21 2006/07/27 19:01:54 timfox Exp $
    */
   public abstract class DestinationServiceSupport extends ServiceMBeanSupport
   {
  @@ -133,10 +134,9 @@
   
            log.info(this + " started, fullSize=" + fullSize + ", pageSize=" + pageSize + ", downCacheSize=" + downCacheSize);
         }
  -      catch (Exception e)
  +      catch (Throwable t)
         {
  -         log.error("Failed to start service", e);
  -         throw e;
  +         ExceptionUtil.handleJMXInvocation(t, this + " startService");
         }
      }
   
  @@ -149,10 +149,9 @@
            started = false;
            log.info(this + " stopped");
         }
  -      catch (Exception e)
  +      catch (Throwable t)
         {
  -         log.error("Failed to stop service", e);
  -         throw e;
  +         ExceptionUtil.handleJMXInvocation(t, this + " stopService");
         }
      }
   
  @@ -193,6 +192,8 @@
   
      public void setSecurityConfig(Element securityConfig) throws Exception
      {
  +      try
  +      {
         // push security update to the server
         if (sm != null)
         {
  @@ -201,6 +202,11 @@
   
         this.securityConfig = securityConfig;
      }
  +      catch (Throwable t)
  +      {
  +         ExceptionUtil.handleJMXInvocation(t, this + " setSecurityConfig");
  +      }
  +   }
   
      public Element getSecurityConfig()
      {
  
  
  
  1.14      +68 -46    jboss-jms/src/main/org/jboss/jms/server/destination/Queue.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Queue.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/destination/Queue.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- Queue.java	13 Apr 2006 08:57:46 -0000	1.13
  +++ Queue.java	27 Jul 2006 19:01:54 -0000	1.14
  @@ -14,6 +14,7 @@
   
   import org.jboss.jms.destination.JBossQueue;
   import org.jboss.jms.selector.Selector;
  +import org.jboss.jms.util.ExceptionUtil;
   
   /**
    * A deployable JBoss Messaging queue.
  @@ -21,9 +22,9 @@
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
    * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
  - * @version <tt>$Revision: 1.13 $</tt>
  + * @version <tt>$Revision: 1.14 $</tt>
    *
  - * $Id: Queue.java,v 1.13 2006/04/13 08:57:46 timfox Exp $
  + * $Id: Queue.java,v 1.14 2006/07/27 19:01:54 timfox Exp $
    */
   public class Queue extends DestinationServiceSupport
   {
  @@ -47,7 +48,9 @@
   
      // JMX managed attributes ----------------------------------------
      
  -   public int getMessageCount() throws JMSException
  +   public int getMessageCount() throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -59,10 +62,17 @@
         org.jboss.messaging.core.local.Queue q = (org.jboss.messaging.core.local.Queue)cm.getCoreDestination(jbq);
   	   return q.getMessageCount();
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " getMessageCount");
  +      }
  +   }
   
      // JMX managed operations ----------------------------------------
      
  -   public void removeAllMessages() throws JMSException
  +   public void removeAllMessages() throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -74,8 +84,15 @@
         org.jboss.messaging.core.local.Queue q = (org.jboss.messaging.core.local.Queue)cm.getCoreDestination(jbq);
         q.removeAllMessages();
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " removeAllMessages");
  +      } 
  +   }
      
  -   public List listMessages(String selector) throws JMSException
  +   public List listMessages(String selector) throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -114,6 +131,11 @@
            throw (JMSException)th;
         }
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " listMessages");
  +      } 
  +   }
       
      // Public --------------------------------------------------------
   
  
  
  
  1.14      +129 -79   jboss-jms/src/main/org/jboss/jms/server/destination/Topic.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Topic.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/destination/Topic.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- Topic.java	13 Apr 2006 19:43:05 -0000	1.13
  +++ Topic.java	27 Jul 2006 19:01:54 -0000	1.14
  @@ -17,6 +17,7 @@
   import org.jboss.jms.selector.Selector;
   import org.jboss.jms.server.subscription.DurableSubscription;
   import org.jboss.jms.server.subscription.Subscription;
  +import org.jboss.jms.util.ExceptionUtil;
   
   
   /**
  @@ -25,9 +26,9 @@
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
    * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
  - * @version <tt>$Revision: 1.13 $</tt>
  + * @version <tt>$Revision: 1.14 $</tt>
    *
  - * $Id: Topic.java,v 1.13 2006/04/13 19:43:05 timfox Exp $
  + * $Id: Topic.java,v 1.14 2006/07/27 19:01:54 timfox Exp $
    */
   public class Topic extends DestinationServiceSupport
   {
  @@ -56,7 +57,9 @@
      /**
       * Remove all messages from subscription's storage.
       */
  -   public void removeAllMessages() throws JMSException
  +   public void removeAllMessages() throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -74,13 +77,20 @@
            ((Subscription)sub).removeAllMessages();
         }
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " removeAllMessages");
  +      } 
  +   }
      
      /**
       * All subscription count
       * @return all subscription count
       * @throws JMSException
       */
  -   public int subscriptionCount() throws JMSException
  +   public int subscriptionCount() throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -100,6 +110,11 @@
         }
         return count;
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " subscriptionCount");
  +      } 
  +   }
   
      /**
       * Durable/nondurable subscription count
  @@ -108,7 +123,9 @@
       * @return either durable or nondurable subscription count depending on param.
       * @throws JMSException
       */
  -   public int subscriptionCount(boolean durable) throws JMSException
  +   public int subscriptionCount(boolean durable) throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -131,6 +148,11 @@
         }
         return count;
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " subscriptionCount");
  +      } 
  +   }
   
      /**
       * XXX Placeholder
  @@ -152,7 +174,9 @@
       * Returns a human readable list containing the names of current subscriptions.
       * @return String of subscription list. Never null.
       */
  -   public String listSubscriptionsAsText() throws JMSException
  +   public String listSubscriptionsAsText() throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -164,6 +188,11 @@
         org.jboss.messaging.core.local.Topic t = (org.jboss.messaging.core.local.Topic)cm.getCoreDestination(jbt);
         return getSubscriptionsAsText(t, true) + getSubscriptionsAsText(t, false);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " listSubscriptionsAsText");
  +      } 
  +   }
      
      
   
  @@ -173,7 +202,9 @@
       *                If false, return non-durable subscription list.
       * @return String of subscription list. Never null.
       */
  -   public String listSubscriptionsAsText(boolean durable) throws JMSException
  +   public String listSubscriptionsAsText(boolean durable) throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -185,6 +216,11 @@
         org.jboss.messaging.core.local.Topic t = (org.jboss.messaging.core.local.Topic)cm.getCoreDestination(jbt);
         return getSubscriptionsAsText(t, durable);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " listSubscriptionsAsText");
  +      } 
  +   }
   
      /**
       * XXX Placeholder
  @@ -235,7 +271,9 @@
       * @see ManageableTopic#getMessagesFromDurableSub(String, String, String)
       */
      public List listMessagesDurableSub(String name, String clientID, String selector)
  -      throws JMSException
  +      throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -247,6 +285,11 @@
         org.jboss.messaging.core.local.Topic t = (org.jboss.messaging.core.local.Topic)cm.getCoreDestination(jbt);
         return getMessagesFromDurableSub(t, name, clientID, trimSelector(selector));
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " listMessagesDurableSub");
  +      } 
  +   }
      
      /**
       * Get messages from a non-durable subscription.
  @@ -257,7 +300,9 @@
       * @see ManageableTopic#getMessagesFromNonDurableSub(Long, String)
       */
      public List listMessagesNonDurableSub(long channelID, String selector)
  -      throws JMSException
  +      throws Exception
  +   {
  +      try
      {
         if (!started)
         {
  @@ -269,6 +314,11 @@
         org.jboss.messaging.core.local.Topic t = (org.jboss.messaging.core.local.Topic)cm.getCoreDestination(jbt);
         return getMessagesFromNonDurableSub(t, channelID, trimSelector(selector));
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " listMessagesNonDurableSub");
  +      } 
  +   }
   
      
      // TODO implement these:
  
  
  



More information about the jboss-cvs-commits mailing list