activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4182 - remove remaining use of finalize()
Date Thu, 24 Apr 2014 14:13:44 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk f70dc7431 -> ec35588e5


https://issues.apache.org/jira/browse/AMQ-4182 - remove remaining use of finalize()


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/ec35588e
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/ec35588e
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/ec35588e

Branch: refs/heads/trunk
Commit: ec35588e566e2ea2e50980ff89618740ae8d5157
Parents: f70dc74
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Thu Apr 24 16:05:42 2014 +0200
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Thu Apr 24 16:06:01 2014 +0200

----------------------------------------------------------------------
 .../org/apache/activemq/transport/TransportLogger.java | 13 ++++---------
 .../java/org/apache/activemq/ActiveMQConnection.java   |  8 --------
 2 files changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/ec35588e/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLogger.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLogger.java
b/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLogger.java
index 60b38a4..6a4848b 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLogger.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLogger.java
@@ -145,16 +145,11 @@ public class TransportLogger extends TransportFilter {
         return next.toString();
     }
 
-
-    /**
-     * We need to override this method
-     * so that we can unregister the associated
-     * MBean to avoid a memory leak.
-     */
-    public void finalize() throws Throwable {
+    @Override
+    public void stop() throws Exception {
+        super.stop();
         if (view != null) {
-            view.unregister();    
+            view.unregister();
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/ec35588e/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
index 3f17c1b..e3ce9ae 100755
--- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -1627,14 +1627,6 @@ public class ActiveMQConnection implements Connection, TopicConnection,
QueueCon
         started.set(false);
     }
 
-    @Override
-    public void finalize() throws Throwable{
-        Scheduler s = this.scheduler;
-        if (s != null){
-            s.stop();
-        }
-    }
-
     /**
      * Changes the associated username/password that is associated with this
      * connection. If the connection has been used, you must called cleanup()


Mime
View raw message