You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/06/04 17:21:41 UTC

svn commit: r179998 - /incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs

Author: ekoneil
Date: Sat Jun  4 08:21:40 2005
New Revision: 179998

URL: http://svn.apache.org/viewcvs?rev=179998&view=rev
Log:
Fix for JIRA 792 -- ensure that the _destinationType value is reset after the control is serialized.

We need more serialization tests for all of the controls...any takers?

:)

BB: self
DRT: Beehive pass / build.dist pass


Modified:
    incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs

Modified: incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs?rev=179998&r1=179997&r2=179998&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs (original)
+++ incubator/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs Sat Jun  4 08:21:40 2005
@@ -84,7 +84,6 @@
 	            		createQueueSession();
 	            		break;
 	            }
-
             }
             catch(JMSException e)
             {
@@ -788,28 +787,25 @@
     }
 
     /**
-     * Get the topic/queue state.
-     * Determine what connection and session from the destination
-     * itself if sendType is Auto otherwise use the Destination
-     * annotation element.
-     * @return true if the destination is a topic.
+     * Get the destination type as specified via the
+     * {@link org.apache.beehive.controls.system.jms.JMSControl.Destination#sendType()}
+     * annotation.
      */
     protected DestinationType getDestinationType() throws ControlException
     {
-    	if(_destinationType != DestinationType.Auto)
-    	{
-    		return _destinationType;
-    	}
-    	Destination d = getDestinationProperties();
-    	if(d.sendType() != DestinationType.Auto)
-    	{
-    		_destinationType = d.sendType();
-    	}
-    	return d.sendType();
-   }
-
-
+        /*
+           when previously unset, obtain from the value of the annotation.
+           this value tends to be overridden later based on the configuration
+           of the control instance.
+         */
+        if(_destinationType == null) {
+            Destination d = getDestinationProperties();
+            assert d != null : "Found a null Destination annotation";
+            _destinationType = d.sendType();
+        }
 
+        return _destinationType;
+   }
 
     /**
      * Set the properties of the given message.
@@ -1068,34 +1064,33 @@
     }
     @Context
     private ResourceContext _resourceContext;
-    
+
     @Context
     private ControlBeanContext _context;
-    
+
     @Control
     private JndiControlBean _jndiControl;
-    
+
     /** The destination */
     private transient javax.jms.Destination _destination;
-    
-    private transient DestinationType _destinationType = DestinationType.Auto;
-    
+
+    private transient DestinationType _destinationType = null;
+
     /** The connection. */
     private transient javax.jms.Connection _connection;
-    
+
     /** The session */
     private transient Session _session;
-    
+
     /** The message producer. */
     private transient MessageProducer _producer;
-    
+
     /** The JNDI control has been initialized */
     private boolean _jndiInitialized = false;
-    
+
     /** The headers to set in the next message to be sent. */
     private Map<HeaderType,Object> _headers;
-    
+
     /** The properties to set in the next message to be sent. */
     private Map<String,Object> _properties;
-
 }