Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from pferraro/master

Source code cleanup
  • Loading branch information...
commit 36b8983498c303e50fc0a1cc75a87551e64cee87 2 parents 81b1599 + be998b5
@jfclere jfclere authored
Showing with 79 additions and 504 deletions.
  1. +0 −6 .classpath
  2. +5 −0 .gitignore
  3. +0 −29 .project
  4. +0 −9 container-spi/.classpath
  5. +0 −23 container-spi/.project
  6. +0 −17 container/.project
  7. +0 −7 container/catalina-standalone/.classpath
  8. +0 −23 container/catalina-standalone/.project
  9. +0 −8 container/catalina/.classpath
  10. +0 −23 container/catalina/.project
  11. +0 −9 container/jbossweb/.classpath
  12. +0 −23 container/jbossweb/.project
  13. +0 −1  ...er/jbossweb/src/test/java/org/jboss/modcluster/container/jbossweb/ServiceLoaderCatalinaFactoryTestCase.java
  14. +0 −9 container/tomcat6/.classpath
  15. +0 −23 container/tomcat6/.project
  16. +0 −9 container/tomcat7/.classpath
  17. +0 −23 container/tomcat7/.project
  18. +2 −0  container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEngine.java
  19. +0 −9 core/.classpath
  20. +0 −23 core/.project
  21. +0 −6 demo/.classpath
  22. +0 −23 demo/.project
  23. +0 −7 demo/client/.classpath
  24. +0 −23 demo/client/.project
  25. +0 −4 demo/client/pom.xml
  26. +0 −25 demo/client/src/main/java/org/jboss/modcluster/demo/client/RequestDriver.java
  27. +0 −7 demo/server/.classpath
  28. +0 −23 demo/server/.project
  29. +55 −62 demo/server/src/main/java/org/jboss/modcluster/demo/servlet/LoadServlet.java
  30. +0 −8 ha/.classpath
  31. +0 −23 ha/.project
  32. +16 −17 pom.xml
  33. +1 −2  sar/pom.xml
View
6 .classpath
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
5 .gitignore
@@ -0,0 +1,5 @@
+.settings
+.classpath
+.project
+bin
+target
View
29 .project
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
9 container-spi/.classpath
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container-spi/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-spi</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
17 container/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-container</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
7 container/catalina-standalone/.classpath
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container/catalina-standalone/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-container-catalina-standalone</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
8 container/catalina/.classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container/catalina/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-container-catalina</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
9 container/jbossweb/.classpath
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container/jbossweb/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-jbossweb</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
1  ...st/java/org/jboss/modcluster/container/jbossweb/ServiceLoaderCatalinaFactoryTestCase.java
@@ -2,7 +2,6 @@
import static org.junit.Assert.assertSame;
-import org.jboss.modcluster.container.catalina.CatalinaEngineFactory;
import org.jboss.modcluster.container.catalina.CatalinaFactoryRegistry;
import org.jboss.modcluster.container.catalina.CatalinaHostFactory;
import org.jboss.modcluster.container.catalina.CatalinaServerFactory;
View
9 container/tomcat6/.classpath
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container/tomcat6/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-tomcat</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
9 container/tomcat7/.classpath
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 container/tomcat7/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-tomcat7</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
2  container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEngine.java
@@ -38,11 +38,13 @@ public TomcatEngine(CatalinaFactoryRegistry registry, Engine engine, Server serv
super(registry, engine, server);
}
+ @SuppressWarnings("deprecation")
@Override
public String getSessionCookieName() {
return ApplicationSessionCookieConfig.getSessionCookieName(null);
}
+ @SuppressWarnings("deprecation")
@Override
public String getSessionParameterName() {
return ApplicationSessionCookieConfig.getSessionUriParamName(null);
View
9 core/.classpath
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 core/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
6 demo/.classpath
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 demo/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-demo</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
7 demo/client/.classpath
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 demo/client/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-demo-client</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
4 demo/client/pom.xml
@@ -11,10 +11,6 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
</dependency>
View
25 demo/client/src/main/java/org/jboss/modcluster/demo/client/RequestDriver.java
@@ -116,14 +116,10 @@ public ClientStatus getClientStatus() {
private static class Client extends Thread {
private final URL request_url, destroy_url;
- private int successful_reads = 0, failed_reads = 0;
-
private final long sessionLife;
private final long sleepTime;
- private long start = 0, stop = 0;
-
private boolean successful = true;
private final byte[] buffer = new byte[1024];
@@ -152,13 +148,11 @@ private Client(URL request_url, URL destroy_url, long sessionLife, int sleepTime
public void run() {
try {
- start = System.currentTimeMillis();
loop();
} catch (Exception e) {
error("failure", e);
successful = false;
} finally {
- stop = System.currentTimeMillis();
try {
// Make an attempt to terminate any ongoing session
// Only bother if our destroy
@@ -174,18 +168,6 @@ public void run() {
}
}
- public int getFailedReads() {
- return failed_reads;
- }
-
- public int getSuccessfulReads() {
- return successful_reads;
- }
-
- public long getTime() {
- return stop - start;
- }
-
public boolean isSuccessful() {
return successful;
}
@@ -218,10 +200,8 @@ private void loop() throws IOException {
rc = executeRequest(request_url);
if (rc == 200) {
- successful_reads++;
elapsed = System.currentTimeMillis() - sessionStart;
} else {
- failed_reads++;
failed = true;
break;
}
@@ -284,11 +264,6 @@ private int executeRequest(URL url) throws IOException {
}
}
- private void invalidateSession() {
- if (!request_url.equals(destroy_url)) {
- }
- }
-
private void handleSessionTermination() {
cookie = null;
String last = lastHandler;
View
7 demo/server/.classpath
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 demo/server/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-demo-server</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
117 demo/server/src/main/java/org/jboss/modcluster/demo/servlet/LoadServlet.java
@@ -41,7 +41,6 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Engine;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Service;
import org.apache.catalina.connector.Connector;
@@ -64,24 +63,20 @@
private static final String SERVICE_NAME = "service-name";
private static final String DEFAULT_SERVER_OBJECT_NAME = "jboss.web:type=Server";
private static final String DEFAULT_SERVICE_NAME = "jboss.web";
- private static final String SERIVCE_OBJECT_NAME = "service-object-name";
- private static final String DEFAULT_SERVICE_OBJECT_NAME = "jboss.web:type=Service,serviceName=jboss.web";
+ private static final String SERVICE_OBJECT_NAME = "service-object-name";
+ private static final String DEFAULT_SERVICE_OBJECT_NAME = "jboss.web:type=Service,serviceName=jboss.web";
- private static final String ENGINE_OBJECT_NAME = "engine-object-name";
+ private static final String ENGINE_OBJECT_NAME = "engine-object-name";
- private static final String DEFAULT_ENGINE_OBJECT_NAME = "jboss.web:type=Engine";
+ private static final String DEFAULT_ENGINE_OBJECT_NAME = "jboss.web:type=Engine";
- private static final String TOMCAT_SERVER_OBJECT_NAME = "Catalina:type=Server";
+ private static final String TOMCAT_ENGINE_OBJECT_NAME = "Catalina:type=Engine";
- private static final String TOMCAT_SERVICE_NAME = "Catalina";
+ private static final String CONNECTOR_OBJECT_NAME = "connector-object-name";
- private static final String TOMCAT_ENGINE_OBJECT_NAME = "Catalina:type=Engine";
+ private static final String TOMCAT_CONNECTOR_OBJECT_NAME = "Catalina:type=Connector,port=*";
- private static final String CONNECTOR_OBJECT_NAME = "connector-object-name";
-
- private static final String TOMCAT_CONNECTOR_OBJECT_NAME = "Catalina:type=Connector,port=*";
-
- private String jvmRoute;
+ private String jvmRoute;
/**
* @{inheritDoc
@@ -92,26 +87,25 @@ public void init(ServletConfig config) throws ServletException {
super.init(config);
try {
- MBeanServer server = ManagementFactory.getPlatformMBeanServer();
- ObjectName name = ObjectName.getInstance(this.getInitParameter(SERVER_OBJECT_NAME, DEFAULT_SERVER_OBJECT_NAME));
- if (server.isRegistered(name)) {
- /* jbossweb 5.0 and 6.0 */
- String serviceName = this.getInitParameter(SERVICE_NAME, DEFAULT_SERVICE_NAME);
- Service service = (Service) server.invoke(name, "findService", new Object[] { serviceName },
- new String[] { String.class.getName() });
-
- for (Connector connector : service.findConnectors()) {
- if (connector.getProtocol().startsWith("HTTP")) {
- ServletContext context = config.getServletContext();
- context.setAttribute(PORT, Integer.valueOf(connector.getPort()));
- }
- }
- this.jvmRoute = ((Engine) service.getContainer()).getJvmRoute();
- return;
- } else {
- name = ObjectName.getInstance(this.getInitParameter(SERIVCE_OBJECT_NAME, DEFAULT_SERVICE_OBJECT_NAME));
- if (server.isRegistered(name)) {
- /* AS7 Void.class.getName() */
+ MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+ ObjectName name = ObjectName.getInstance(this.getInitParameter(SERVER_OBJECT_NAME, DEFAULT_SERVER_OBJECT_NAME));
+ if (server.isRegistered(name)) {
+ /* jbossweb 5.0 and 6.0 */
+ String serviceName = this.getInitParameter(SERVICE_NAME, DEFAULT_SERVICE_NAME);
+ Service service = (Service) server.invoke(name, "findService", new Object[] { serviceName }, new String[] { String.class.getName() });
+
+ for (Connector connector : service.findConnectors()) {
+ if (connector.getProtocol().startsWith("HTTP")) {
+ ServletContext context = config.getServletContext();
+ context.setAttribute(PORT, Integer.valueOf(connector.getPort()));
+ }
+ }
+ this.jvmRoute = ((Engine) service.getContainer()).getJvmRoute();
+ return;
+ } else {
+ name = ObjectName.getInstance(this.getInitParameter(SERVICE_OBJECT_NAME, DEFAULT_SERVICE_OBJECT_NAME));
+ if (server.isRegistered(name)) {
+ /* AS7 Void.class.getName() */
for (Connector connector : (Connector []) server.invoke(name, "findConnectors", new Object[] { },
new String[] { })) {
if (connector.getProtocol().startsWith("HTTP")) {
@@ -122,36 +116,35 @@ public void init(ServletConfig config) throws ServletException {
name = ObjectName.getInstance(this.getInitParameter(ENGINE_OBJECT_NAME, DEFAULT_ENGINE_OBJECT_NAME));
this.jvmRoute = (String) server.getAttribute(name, "jvmRoute");
return;
-
- } else {
- /* must be Tomcat6 */
- name = ObjectName.getInstance(this.getInitParameter(CONNECTOR_OBJECT_NAME, TOMCAT_CONNECTOR_OBJECT_NAME));
- for (ObjectName connectorname: server.queryNames(name, null)) {
- if (((String) server.getAttribute(connectorname, "protocol")).startsWith("HTTP")) {
- ServletContext context = config.getServletContext();
- context.setAttribute(PORT, Integer.valueOf(server.getAttribute(connectorname, "port").toString()));
- }
- }
- name = ObjectName.getInstance(this.getInitParameter(ENGINE_OBJECT_NAME, TOMCAT_ENGINE_OBJECT_NAME));
+
+ } else {
+ /* must be Tomcat6 */
+ name = ObjectName.getInstance(this.getInitParameter(CONNECTOR_OBJECT_NAME, TOMCAT_CONNECTOR_OBJECT_NAME));
+ for (ObjectName connectorname: server.queryNames(name, null)) {
+ if (((String) server.getAttribute(connectorname, "protocol")).startsWith("HTTP")) {
+ ServletContext context = config.getServletContext();
+ context.setAttribute(PORT, Integer.valueOf(server.getAttribute(connectorname, "port").toString()));
+ }
+ }
+ name = ObjectName.getInstance(this.getInitParameter(ENGINE_OBJECT_NAME, TOMCAT_ENGINE_OBJECT_NAME));
this.jvmRoute = (String) server.getAttribute(name, "jvmRoute");
- return;
- }
-
- }
-
- } catch (MalformedObjectNameException e) {
- throw new ServletException(e);
- } catch (NullPointerException e) {
- throw new ServletException(e);
- } catch (InstanceNotFoundException e) {
- throw new ServletException(e);
- } catch (ReflectionException e) {
- throw new ServletException(e);
- } catch (MBeanException e) {
- throw new ServletException(e);
- } catch (AttributeNotFoundException e) {
- throw new ServletException(e);
- }
+ return;
+ }
+ }
+
+ } catch (MalformedObjectNameException e) {
+ throw new ServletException(e);
+ } catch (NullPointerException e) {
+ throw new ServletException(e);
+ } catch (InstanceNotFoundException e) {
+ throw new ServletException(e);
+ } catch (ReflectionException e) {
+ throw new ServletException(e);
+ } catch (MBeanException e) {
+ throw new ServletException(e);
+ } catch (AttributeNotFoundException e) {
+ throw new ServletException(e);
+ }
}
protected String getJvmRoute() {
View
8 ha/.classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
23 ha/.project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>mod_cluster-ha</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
View
33 pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
- <version>5</version>
+ <version>9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -31,20 +31,19 @@
</repositories>
<properties>
- <version.jboss-logging>3.0.1.GA</version.jboss-logging>
- <version.tomcat6>6.0.33</version.tomcat6>
- <version.tomcat7>7.0.8</version.tomcat7>
- <version.jbossweb>2.1.11.GA</version.jbossweb>
- <version.jbossweb7>7.0.7.Final</version.jbossweb7>
- <version.commons-codec>1.3</version.commons-codec>
+ <version.jboss-logging>3.1.2.GA</version.jboss-logging>
+ <version.tomcat6>6.0.35</version.tomcat6>
+ <version.tomcat7>7.0.30</version.tomcat7>
+ <version.jbossweb>2.1.12.GA</version.jbossweb>
+ <version.jbossweb7>7.0.17.Final</version.jbossweb7>
<version.commons-http-client>3.1</version.commons-http-client>
- <version.jfreechart>1.0.12</version.jfreechart>
+ <version.jfreechart>1.0.13</version.jfreechart>
<version.jcip-annotations>1.0</version.jcip-annotations>
- <version.junit>4.9</version.junit>
- <version.mockito>1.8.5</version.mockito>
- <version.javax.servlet-3.0>1.0.0.Final</version.javax.servlet-3.0>
+ <version.junit>4.10</version.junit>
+ <version.mockito>1.9.0</version.mockito>
+ <version.javax.servlet-3.0>1.0.2.Final</version.javax.servlet-3.0>
<version.jboss-ha-server-api>2.0.0.Final</version.jboss-ha-server-api>
- <version.jboss-kernel>2.0.6.GA</version.jboss-kernel>
+ <version.jboss-kernel>2.0.10.GA</version.jboss-kernel>
</properties>
<dependencyManagement>
<dependencies>
@@ -115,11 +114,6 @@
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${version.commons-codec}</version>
- </dependency>
- <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>${version.commons-http-client}</version>
@@ -180,6 +174,11 @@
<tagBase>https://svn.jboss.org/repos/mod_cluster/tags</tagBase>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>versions-maven-plugin</artifactId>
+ <version>1.3.1</version>
+ </plugin>
</plugins>
</build>
View
3  sar/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-parent</artifactId>
- <version>1.2.2.Beta1-SNAPSHOT</version>
+ <version>1.2.3.Beta1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@@ -27,7 +27,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2.2</version>
<executions>
<execution>
<id>sar</id>
Please sign in to comment.
Something went wrong with that request. Please try again.