You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/05/03 16:36:28 UTC
svn commit: r399315 - in /geronimo/devtools/eclipse-plugin/trunk/plugins:
org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/
org.apache.geronimo.st.jmxagent/ org.apache.geronimo.st.jmxagent/META-INF/
org.apache.geronimo.st.jmxagent/src/org/ap...
Author: sppatel
Date: Wed May 3 07:36:14 2006
New Revision: 399315
URL: http://svn.apache.org/viewcvs?rev=399315&view=rev
Log:
run agent in bg thread
Modified:
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/Activator.java
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/.classpath
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/META-INF/MANIFEST.MF
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/build.properties
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/JMXAgent.java
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/Activator.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/Activator.java?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/Activator.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/Activator.java Wed May 3 07:36:14 2006
@@ -37,8 +37,8 @@
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
- plugin = null;
super.stop(context);
+ plugin = null;
}
/**
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/.classpath
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/.classpath?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/.classpath (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/.classpath Wed May 3 07:36:14 2006
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/mx4j-remote-3.0.1.jar"/>
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/META-INF/MANIFEST.MF?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/META-INF/MANIFEST.MF Wed May 3 07:36:14 2006
@@ -21,4 +21,6 @@
lib/org.mortbay.jetty-5.1.10.jar,
lib/mx4j-tools-3.0.1.jar,
lib/hessian-3.0.8.jar,
- lib/geronimo-servlet_2.4_spec-1.0.jar
+ lib/geronimo-servlet_2.4_spec-1.0.jar,
+ lib/commons-logging-1.0.4.jar,
+ .
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/build.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/build.properties?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/build.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/build.properties Wed May 3 07:36:14 2006
@@ -1,4 +1,5 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
- .
+ .,\
+ lib/commons-logging-1.0.4.jar
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml Wed May 3 07:36:14 2006
@@ -77,6 +77,11 @@
<artifactId>config-store-service</artifactId>
<version>${configStoreServiceVersion}</version>
</artifactItem>
+ <artifactItem>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </artifactItem>
</artifactItems>
<outputDirectory>lib</outputDirectory>
</configuration>
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/JMXAgent.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/JMXAgent.java?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/JMXAgent.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/JMXAgent.java Wed May 3 07:36:14 2006
@@ -25,12 +25,12 @@
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
-
public class JMXAgent {
private static JMXAgent INSTANCE = null;
private static MBeanServer server = null;
+
private static JMXServiceURL url = null;
private JMXConnectorServer connectorServer = null;
@@ -38,7 +38,7 @@
private static int DEFAULT_PORT = 8090;
private JMXAgent() {
-
+
}
public static JMXAgent getInstance() {
@@ -61,9 +61,19 @@
init();
connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer());
}
-
- if (!connectorServer.isActive())
- connectorServer.start();
+
+ if (!connectorServer.isActive()) {
+ Thread thread = new Thread() {
+ public void run() {
+ try {
+ connectorServer.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ thread.start();
+ }
}
public void stop() throws IOException {
@@ -78,9 +88,9 @@
e.printStackTrace();
}
}
-
+
private MBeanServer getServer() {
- if(server == null)
+ if (server == null)
server = MBeanServerFactory.createMBeanServer();
return server;
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java?rev=399315&r1=399314&r2=399315&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java Wed May 3 07:36:14 2006
@@ -15,6 +15,7 @@
*/
package org.apache.geronimo.st.v11.core;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
@@ -36,6 +37,7 @@
import org.apache.geronimo.st.core.GenericGeronimoServerBehaviour;
import org.apache.geronimo.st.core.GeronimoConnectionFactory;
import org.apache.geronimo.st.jmxagent.Activator;
+import org.apache.geronimo.st.jmxagent.JMXAgent;
import org.apache.geronimo.st.v11.core.internal.Trace;
import org.apache.geronimo.system.jmx.KernelDelegate;
import org.eclipse.core.runtime.CoreException;
@@ -47,6 +49,14 @@
import org.eclipse.wst.server.core.util.SocketUtil;
public class GeronimoServerBehaviour extends GenericGeronimoServerBehaviour {
+
+ static {
+ try {
+ JMXAgent.getInstance().start();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
private Kernel kernel = null;