Author: ningjiang Date: Fri Feb 12 07:02:02 2010 New Revision: 909270 URL: http://svn.apache.org/viewvc?rev=909270&view=rev Log: CAMEL-2456 Fixed the WARNING issue of JmsTemporaryTopicEndpoint , JmsTemporaryQueueEndpoint which has no JMS annotation in a better way
Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java?rev=909270&r1=909269&r2=909270&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java (original) +++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java Fri Feb 12 07:02:02 2010 @@ -21,8 +21,6 @@ import javax.jms.Session; import javax.jms.TemporaryQueue; -import org.springframework.jmx.export.annotation.ManagedResource; - /** * A <a href="http://activemq.apache.org/jms.html">JMS Endpoint</a> * for working with a {...@link TemporaryQueue} @@ -30,7 +28,6 @@ * @version $Revision$ */ // TODO need to be really careful to always use the same Connection otherwise the destination goes stale -...@managedresource(description = "Managed JMS Temporary Queue Endpoint") public class JmsTemporaryQueueEndpoint extends JmsQueueEndpoint implements DestinationEndpoint { private Destination jmsDestination; @@ -62,6 +59,13 @@ public boolean isSingleton() { return true; } + + @Override + // We don't want to manage this temporary object + public Object getManagedObject(JmsEndpoint object) { + return null; + } + public synchronized Destination getJmsDestination(Session session) throws JMSException { if (jmsDestination == null) { Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java?rev=909270&r1=909269&r2=909270&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java (original) +++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java Fri Feb 12 07:02:02 2010 @@ -21,7 +21,6 @@ import javax.jms.Session; import javax.jms.TemporaryTopic; -import org.springframework.jmx.export.annotation.ManagedResource; /** * A <a href="http://activemq.apache.org/jms.html">JMS Endpoint</a> @@ -30,7 +29,6 @@ * @version $Revision$ */ // TODO need to be really careful to always use the same Connection otherwise the destination goes stale -...@managedresource(description = "Managed JMS Temporay Topic Endpoint") public class JmsTemporaryTopicEndpoint extends JmsEndpoint implements DestinationEndpoint { private Destination jmsDestination; @@ -57,6 +55,12 @@ public boolean isSingleton() { return true; } + + @Override + // We don't want to manage this temporary object + public Object getManagedObject(JmsEndpoint object) { + return null; + } public synchronized Destination getJmsDestination(Session session) throws JMSException { if (jmsDestination == null) {