summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-09-04 13:18:32 +0000
committerKeith Wall <kwall@apache.org>2012-09-04 13:18:32 +0000
commit14047243f883ddd4fdb566b7be9e5d2dbafeaf72 (patch)
treed1f77fbcbed13fe06fc9544a6badfaca027777c9 /qpid/java/broker-plugins
parent1a4ee6eef5a9114238d836dcb93610edee3ad6ba (diff)
downloadqpid-python-14047243f883ddd4fdb566b7be9e5d2dbafeaf72.tar.gz
QPID-4271: improve behaviour when embedding the broker inside a container
Avoid potential ThreadLocal leaks on Container owned threads for CurrentActor, AMQShortString and SecurityManager. Have LogRecorder unregistered itself from Log4J. Allow SIGHUP handling to be turned off (inappropiate to install signal handling when deployed inside Container. Allow use of custom RMI socket factory to be disabled. (The registration of a custom RMI socket with the JRE cannot be reversed (deficiency in JRE API) and this causes a large perm-gen leak). Work of Robbie Gemmell <robbie@apache.org> and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1380625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java10
-rw-r--r--qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java4
2 files changed, 12 insertions, 2 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
index 843ba9816a..521ad69abe 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.logging.LogActor;
import org.apache.qpid.server.logging.RootMessageLogger;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -218,7 +219,14 @@ public abstract class AbstractServlet extends HttpServlet
}
finally
{
- org.apache.qpid.server.security.SecurityManager.setThreadSubject(null);
+ try
+ {
+ org.apache.qpid.server.security.SecurityManager.setThreadSubject(null);
+ }
+ finally
+ {
+ AMQShortString.clearLocalCache();
+ }
}
}
diff --git a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
index 44fe4787bb..cb2e9f5e54 100644
--- a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
+++ b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
@@ -211,10 +211,12 @@ public class JMXManagedObjectRegistry implements ManagedObjectRegistry
System.setProperty("java.rmi.server.randomIDs", "true");
if(_useCustomSocketFactory)
{
+ _log.debug("Using custom RMIServerSocketFactory");
_rmiRegistry = LocateRegistry.createRegistry(_jmxPortRegistryServer, null, new CustomRMIServerSocketFactory());
}
else
{
+ _log.debug("Using default RMIServerSocketFactory");
_rmiRegistry = LocateRegistry.createRegistry(_jmxPortRegistryServer, null, null);
}
@@ -235,7 +237,7 @@ public class JMXManagedObjectRegistry implements ManagedObjectRegistry
/**
* Override makeClient so we can cache the username of the client in a Map keyed by connectionId.
- * ConnectionId is guaranteed to be unique per client connection, according to the JMS spec.
+ * ConnectionId is guaranteed to be unique per client connection, according to the JMX spec.
* An instance of NotificationListener (mapCleanupListener) will be responsible for removing these Map
* entries.
*