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

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     DestinationJNDIMapper.java
                        DestinationManager.java SecurityManager.java
                        ServerPeer.java
  Log:
  Mainly http://jira.jboss.com/jira/browse/JBMESSAGING-434 plus a few other bits and pieces
  
  Revision  Changes    Path
  1.11      +12 -32    jboss-jms/src/main/org/jboss/jms/server/DestinationJNDIMapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DestinationJNDIMapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/DestinationJNDIMapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- DestinationJNDIMapper.java	28 Mar 2006 14:26:16 -0000	1.10
  +++ DestinationJNDIMapper.java	27 Jul 2006 19:01:54 -0000	1.11
  @@ -29,15 +29,14 @@
   
   import javax.jms.Destination;
   import javax.jms.InvalidDestinationException;
  -import javax.jms.JMSException;
   import javax.naming.Context;
   import javax.naming.InitialContext;
   import javax.naming.NameNotFoundException;
   
   import org.jboss.jms.destination.JBossQueue;
   import org.jboss.jms.destination.JBossTopic;
  -import org.jboss.jms.util.MessagingJMSException;
   import org.jboss.jms.util.JNDIUtil;
  +import org.jboss.jms.util.MessagingJMSException;
   import org.jboss.logging.Logger;
   import org.w3c.dom.Element;
   
  @@ -47,9 +46,9 @@
    * Manages JNDI mapping for JMS destinations
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version <tt>$Revision: 1.10 $</tt>
  + * @version <tt>$Revision: 1.11 $</tt>
    *
  - * $Id: DestinationJNDIMapper.java,v 1.10 2006/03/28 14:26:16 timfox Exp $
  + * $Id: DestinationJNDIMapper.java,v 1.11 2006/07/27 19:01:54 timfox Exp $
    */
   class DestinationJNDIMapper implements DestinationManager
   {
  @@ -80,7 +79,7 @@
      // DestinationManager implementation -----------------------------
      
      public String registerDestination(boolean isQueue, String name, String jndiName,
  -                                     Element securityConfiguration) throws JMSException
  +                                     Element securityConfiguration) throws Exception
      {            
         String parentContext;
         String jndiNameInContext;
  @@ -117,17 +116,10 @@
         {
            // OK
         }
  -      catch(Exception e)
  -      {
  -         e.printStackTrace();
  -         throw new MessagingJMSException("JNDI failure", e);
  -      }
   
         Destination jmsDestination =
            isQueue ? (Destination) new JBossQueue(name) : (Destination) new JBossTopic(name);
   
  -      try
  -      {
            Context c = JNDIUtil.createContext(initialContext, parentContext);
            c.rebind(jndiNameInContext, jmsDestination);
            if (isQueue)
  @@ -138,11 +130,6 @@
            {
               topicNameToJNDI.put(name, jndiName);
            }
  -      }
  -      catch(Exception e)
  -      {
  -         throw new MessagingJMSException("JNDI failure", e);
  -      }
   
         // if the destination has no security configuration, then the security manager will always
         // use its current default security configuration when requested to authorize requests for
  @@ -158,7 +145,7 @@
         return jndiName;
      }
   
  -   public void unregisterDestination(boolean isQueue, String name) throws JMSException
  +   public void unregisterDestination(boolean isQueue, String name) throws Exception
      {
         String jndiName = null;
         if (isQueue)
  @@ -174,14 +161,7 @@
            return;
         }
   
  -      try
  -      {
            initialContext.unbind(jndiName);
  -      }
  -      catch(Exception e)
  -      {
  -         throw new MessagingJMSException("JNDI failure", e);
  -      }
   
         serverPeer.getSecurityManager().clearSecurityConfig(isQueue, name);
   
  
  
  
  1.20      +4 -6      jboss-jms/src/main/org/jboss/jms/server/DestinationManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DestinationManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/DestinationManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- DestinationManager.java	28 Feb 2006 16:48:12 -0000	1.19
  +++ DestinationManager.java	27 Jul 2006 19:01:54 -0000	1.20
  @@ -21,15 +21,13 @@
     */
   package org.jboss.jms.server;
   
  -import javax.jms.JMSException;
  -
   import org.w3c.dom.Element;
   
   /**
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version <tt>$Revision: 1.19 $</tt>
  + * @version <tt>$Revision: 1.20 $</tt>
    *
  - * $Id: DestinationManager.java,v 1.19 2006/02/28 16:48:12 timfox Exp $
  + * $Id: DestinationManager.java,v 1.20 2006/07/27 19:01:54 timfox Exp $
    */
   public interface DestinationManager
   {
  @@ -41,12 +39,12 @@
       * @return the name under which the destination was bound in JNDI.
       */
      String registerDestination(boolean isQueue, String name, String jndiName, Element securityConfig)
  -      throws JMSException;
  +      throws Exception;
   
      /**
       * Method called by a destination service to unregister itself from the server peer. The server
       * peer is supposed to clean up the state maintained on behalf of the unregistered destination.
       */
  -   void unregisterDestination(boolean isQueue, String name) throws JMSException;
  +   void unregisterDestination(boolean isQueue, String name) throws Exception;
   
   }
  
  
  
  1.2       +9 -9      jboss-jms/src/main/org/jboss/jms/server/SecurityManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SecurityManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/SecurityManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SecurityManager.java	25 Jan 2006 16:57:06 -0000	1.1
  +++ SecurityManager.java	27 Jul 2006 19:01:54 -0000	1.2
  @@ -21,19 +21,19 @@
     */
   package org.jboss.jms.server;
   
  -import org.jboss.jms.server.security.SecurityMetadata;
  -import org.w3c.dom.Element;
  +import java.util.Set;
   
  -import javax.security.auth.Subject;
   import javax.jms.JMSSecurityException;
  -import javax.jms.JMSException;
  -import java.util.Set;
  +import javax.security.auth.Subject;
  +
  +import org.jboss.jms.server.security.SecurityMetadata;
  +import org.w3c.dom.Element;
   
   /**
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version <tt>$Revision: 1.1 $</tt>
  + * @version <tt>$Revision: 1.2 $</tt>
    *
  - * $Id: SecurityManager.java,v 1.1 2006/01/25 16:57:06 ovidiu Exp $
  + * $Id: SecurityManager.java,v 1.2 2006/07/27 19:01:54 timfox Exp $
    */
   public interface SecurityManager
   {
  @@ -42,8 +42,8 @@
       */
      SecurityMetadata getSecurityMetadata(boolean isQueue, String destName);
   
  -   void setSecurityConfig(boolean isQueue, String destName, Element conf) throws JMSException;
  -   void clearSecurityConfig(boolean isQueue, String name) throws JMSException;
  +   void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception;
  +   void clearSecurityConfig(boolean isQueue, String name) throws Exception;
   
      /**
       * Authenticate the specified user with the given password. Implementations are most likely to
  
  
  
  1.109     +156 -92   jboss-jms/src/main/org/jboss/jms/server/ServerPeer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerPeer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/ServerPeer.java,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -b -r1.108 -r1.109
  --- ServerPeer.java	17 Jul 2006 17:14:45 -0000	1.108
  +++ ServerPeer.java	27 Jul 2006 19:01:54 -0000	1.109
  @@ -43,6 +43,7 @@
   import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
   import org.jboss.jms.server.remoting.JMSWireFormat;
   import org.jboss.jms.server.security.SecurityMetadataStore;
  +import org.jboss.jms.util.ExceptionUtil;
   import org.jboss.logging.Logger;
   import org.jboss.messaging.core.memory.MemoryManager;
   import org.jboss.messaging.core.memory.SimpleMemoryManager;
  @@ -66,9 +67,9 @@
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  - * @version <tt>$Revision: 1.108 $</tt>
  + * @version <tt>$Revision: 1.109 $</tt>
    *
  - * $Id: ServerPeer.java,v 1.108 2006/07/17 17:14:45 timfox Exp $
  + * $Id: ServerPeer.java,v 1.109 2006/07/27 19:01:54 timfox Exp $
    */
   public class ServerPeer extends ServiceMBeanSupport
   {
  @@ -160,6 +161,8 @@
   
      public synchronized void startService() throws Exception
      {
  +      try
  +      {
         if (started)
         {
            return;
  @@ -222,9 +225,16 @@
         log.info("JBoss Messaging " + getVersion().getProviderVersion() + " server [" +
            getServerPeerID()+ "] started");
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
  +      } 
  +   }
   
      public synchronized void stopService() throws Exception
      {
  +      try
  +      {
         if (!started)
         {
            return;
  @@ -253,6 +263,11 @@
   
         log.info("JMS " + this + " stopped");
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " stopService");
  +      } 
  +   }
   
      // JMX Attributes ------------------------------------------------
   
  @@ -385,38 +400,87 @@
   
      public String createQueue(String name, String jndiName) throws Exception
      {
  +      try
  +      {
         return createDestinationDefault(true, name, jndiName);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " createQueue");
  +      } 
  +   }
   
      public String createQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
      {
  +      try
  +      {
         return createDestination(true, name, jndiName, fullSize, pageSize, downCacheSize);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " createQueue(2)");
  +      } 
  +   }
   
      public boolean destroyQueue(String name) throws Exception
      {
  +      try
  +      {
         return destroyDestination(true, name);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " destroyQueue");
  +      } 
  +   }
   
      public String createTopic(String name, String jndiName) throws Exception
      {
  +      try
  +      {
         return createDestinationDefault(false, name, jndiName);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " createTopic");
  +      } 
  +   }
   
      public String createTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
      {
  +      try
  +      {
         return createDestination(false, name, jndiName, fullSize, pageSize, downCacheSize);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " createTopic(2)");
  +      } 
  +   }
   
      public boolean destroyTopic(String name) throws Exception
      {
  +      try
  +      {
         return destroyDestination(false, name);
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " destroyTopic");
  +      } 
  +   }
   
      public Set getDestinations() throws Exception
      {
  +      try
  +      {
         return destinationJNDIMapper.getDestinations();
      }
  +      catch (Throwable t)
  +      {
  +         throw ExceptionUtil.handleJMXInvocation(t, this + " getDestinations");
  +      } 
  +   }
   
      // Public --------------------------------------------------------
   
  
  
  



More information about the jboss-cvs-commits mailing list