Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Update to Tomcat7 (replacing Tomcat6)"

This reverts commit 332dff5.

Change-Id: Ibc63c81879902655f745b4fcacc6e1331b062481
  • Loading branch information...
commit 9afd85ae05b60e49a85e201b18c8790213b2220f 1 parent 332dff5
Jennifer Hickey authored
26 plugins/pom.xml
View
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.cloudfoundry</groupId>
+ <artifactId>vcap-java-plugins</artifactId>
+ <packaging>pom</packaging>
+ <name>vcap-java-plugins</name>
+ <version>1.0.0-BUILD-SNAPSHOT</version>
+
+ <modules>
+ <module>tomcat_startup_listener</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
34 plugins/tomcat_startup_listener/pom.xml
View
@@ -0,0 +1,34 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.vmware.appcloud</groupId>
+ <artifactId>TomcatStartupListener</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>6.0.26</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>coyote</artifactId>
+ <version>6.0.26</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
56 plugins/tomcat_startup_listener/src/main/java/com/vmware/appcloud/tomcat/AppCloudLifecycleListener.java
View
@@ -0,0 +1,56 @@
+package com.vmware.appcloud.tomcat;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import java.io.*;
+
+public class AppCloudLifecycleListener implements LifecycleListener, NotificationListener {
+
+ private String stateFile;
+
+ private static final String APPCLOUD_STATE_FILE = "tomcat.state";
+ private static final String J2EE_RUNNING_STATE = "j2ee.state.running";
+
+ public void lifecycleEvent(LifecycleEvent event) {
+ Lifecycle lifecycle = event.getLifecycle();
+
+ if (lifecycle instanceof StandardContext) {
+ StandardContext context = (StandardContext) lifecycle;
+ if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
+ Container grandParent = context.getParent().getParent();
+ if (grandParent instanceof StandardEngine) {
+ StandardEngine engine = (StandardEngine) grandParent;
+ String relativePath = new StringBuilder()
+ .append("..")
+ .append(File.separator)
+ .append(APPCLOUD_STATE_FILE)
+ .toString();
+ stateFile = new File(engine.getBaseDir(), relativePath).getAbsolutePath();
+ context.addNotificationListener(this, null, null);
+ }
+ } else if (event.getType().equals(Lifecycle.AFTER_STOP_EVENT)) {
+ System.err.println("Stopping Tomcat because the context stopped.");
+ System.exit(1);
+ }
+ }
+ }
+
+ public void handleNotification(Notification notification, Object handback) {
+ if (J2EE_RUNNING_STATE.equals(notification.getType())) {
+ try {
+ PrintWriter writer = new PrintWriter(stateFile);
+ writer.println("{\"state\": \"RUNNING\"}");
+ writer.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
11 plugins/tomcat_startup_listener/src/main/java/com/vmware/appcloud/tomcat/TomcatStartupListener.java
View
@@ -0,0 +1,11 @@
+package com.vmware.appcloud.tomcat;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: vspivak
+ * Date: Mar 30, 2010
+ * Time: 2:43:57 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class TomcatStartupListener {
+}
2  pom.xml
View
@@ -17,6 +17,7 @@
<modules>
<module>cloudfoundry-runtime</module>
<module>auto-reconfiguration</module>
+ <module>plugins</module>
</modules>
</profile>
<profile>
@@ -25,6 +26,7 @@
<module>cloudfoundry-runtime</module>
<module>cloudfoundry-runtime-tests</module>
<module>auto-reconfiguration</module>
+ <module>plugins</module>
</modules>
</profile>
</profiles>
2  tomcat-setup/cf-tomcat.zip.sha1
View
@@ -1 +1 @@
-fc3e24aeb72954e838f7aae9628db484ce8a29c7 *tomcat.zip
+293386e6ae37d9c01b9941cf5f8fa775a6969b91 *tomcat.zip
25 tomcat-setup/resources/conf/context.xml
View
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- The contents of this file will be loaded for each web application -->
+<Context>
+ <WatchedResource>WEB-INF/web.xml</WatchedResource>
+<!--
+ <Manager pathname="" />
+-->
+ <Listener className="com.vmware.appcloud.tomcat.AppCloudLifecycleListener" />
+</Context>
43 tomcat-setup/resources/conf/server.xml
View
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Note: A "Server" is not itself a "Container", so you may not
+ define subcomponents such as "Valves" at this level.
+ Documentation at /docs/config/server.html
+ -->
+<Server port="-1">
+
+ <Listener className="org.apache.catalina.core.JasperListener" />
+ <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
+ <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
+ <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+
+ <Service name="Catalina">
+
+ <Connector port="9022" protocol="HTTP/1.1"
+ connectionTimeout="20000" />
+
+ <Engine name="Catalina" defaultHost="localhost">
+
+ <Host name="localhost" appBase="webapps"
+ unpackWARs="true" autoDeploy="true"
+ xmlValidation="false" xmlNamespaceAware="false">
+ </Host>
+
+ </Engine>
+ </Service>
+</Server>
BIN  tomcat-setup/resources/lib/TomcatStartupListener-1.0.jar
View
Binary file not shown
8 tomcat-setup/tomcat_manifest.yml
View
@@ -1,11 +1,11 @@
---
-version: 7.0.26
-download_uri: http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.26/bin/apache-tomcat-7.0.26.tar.gz
+version: 6.0.35
+download_uri: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
-replace_files: []
+replace_files: [conf/server.xml, conf/context.xml]
clear_dirs: [logs, temp, webapps, work]
remove_files: [NOTICE, RELEASE-NOTES, RUNNING.txt, LICENSE]
-add_jars: []
+add_jars: [lib/TomcatStartupListener-1.0.jar]
# Assumes that the environment variable 'VCAP' has been set to point to
# the root of 'vcap' source hierarchy.

1 comment on commit 9afd85a

zhouyanming

why revert to tomcat6?

Please sign in to comment.
Something went wrong with that request. Please try again.