You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by mo...@apache.org on 2009/05/18 17:50:29 UTC
svn commit: r776020 - in
/incubator/kato/trunk/org.apache.kato.example.tomcat: ./ .settings/
WebContent/ WebContent/META-INF/ WebContent/WEB-INF/
WebContent/WEB-INF/lib/ build/ src/
Author: monteith
Date: Mon May 18 17:50:28 2009
New Revision: 776020
URL: http://svn.apache.org/viewvc?rev=776020&view=rev
Log:
Share examples with Tomcat for JavaOne BOF.
Added:
incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/.project (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/
incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.component
incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/lib/
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp (with props)
incubator/kato/trunk/org.apache.kato.example.tomcat/build/
incubator/kato/trunk/org.apache.kato.example.tomcat/src/
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath Mon May 18 17:50:28 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/IBMJava50"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/.classpath
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.project
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.project?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.project (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.project Mon May 18 17:50:28 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.kato.example.tomcat</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/.project
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs Mon May 18 17:50:28 2009
@@ -0,0 +1,7 @@
+#Fri May 15 16:48:32 BST 2009
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs Mon May 18 17:50:28 2009
@@ -0,0 +1,4 @@
+#Fri May 15 16:48:33 BST 2009
+eclipse.preferences.version=1
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.tomcat.runtimeTarget\:\:Apache\ Tomcat\ v5.5/owners=jst.web\:2.4
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:IBMJava50/owners=jst.java\:5.0
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.jst.common.project.facet.core.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.component
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.component?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.component (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.component Mon May 18 17:50:28 2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="org.apache.kato.example.tomcat">
+ <wb-resource deploy-path="/" source-path="/WebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+ <property name="java-output-path" value="build/classes"/>
+ <property name="context-root" value="org.apache.kato.example.tomcat"/>
+ </wb-module>
+</project-modules>
\ No newline at end of file
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml Mon May 18 17:50:28 2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="Apache Tomcat v5.5"/>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.java"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/.settings/org.eclipse.wst.common.project.facet.core.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF Mon May 18 17:50:28 2009
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml Mon May 18 17:50:28 2009
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>org.apache.kato.example.tomcat</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp Mon May 18 17:50:28 2009
@@ -0,0 +1,98 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+ 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.
+ -->
+<!--
+ This JSP should be run twice. In the first grabs lock A before
+ waiting to be notified, then it tries to grab lock B.
+ In the second run it grabs lock B then notifies the first run before
+ trying to get lock A.
+
+ If run properly, causes a deadlock to occur.
+ This is a toxic JSP to have on anything except a J2EE server that is
+ purely for demonstration purposes.
+-->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Deadlock</title>
+</head>
+<body>
+Press reload to create deadlock.
+Getting lock...
+<%! static Object handShake = new Object();
+ static Object lockA = new Object(), lockB = new Object();
+ static volatile int state = 0;
+%>
+<pre>
+<%
+out.flush();
+int localState = 0;
+synchronized(handShake) {
+ localState = state++;
+}
+
+if (localState == 0) {
+ out.write("Getting lock A\n");
+ out.flush();
+ synchronized(lockA) {
+ synchronized(handShake) {
+ out.write("Got lock A, waiting for handshake\n");
+ out.flush();
+ handShake.wait();
+ }
+ out.write("Getting lock B\n");
+ out.flush();
+
+ synchronized(lockB) {
+ out.write("Got lock B\n");
+ out.flush();
+ }
+ out.write("Released lock B\n");
+ out.flush();
+ }
+ out.write("Released lock A\n");
+ out.flush();
+} else {
+ out.write("Getting lock b\n");
+ out.flush();
+ synchronized(lockB) {
+ synchronized(handShake) {
+ out.write("Got lock B, notifying handshake\n");
+ out.flush();
+ handShake.notify();
+ }
+ out.write("Getting lock A\n");
+ out.flush();
+
+ synchronized(lockA) {
+ out.write("Got lock A\n");
+ out.flush();
+ }
+ out.write("Released lock A\n");
+ out.flush();
+ }
+ out.write("Released lock B\n");
+ out.flush();
+}
+%>
+</pre>
+</body>
+</html>
\ No newline at end of file
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/deadlock.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp?rev=776020&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp Mon May 18 17:50:28 2009
@@ -0,0 +1,78 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+ 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.
+ -->
+<!--
+ This works only on IBM JVM's. Presents three buttons for generating
+ the different types of dump.
+
+ WARNING! Don't allow this on anything except a demonstration system as
+ this allows anyone to cause your JVM to dump - using lots of CPU and diskspace.
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>IBM JVM Dumps</title>
+</head>
+<body>
+<h1>IBM JVM Dumper</h1>
+This application causes dumps to occur on Tomcat's JVM.
+Press the appropriate button below to generate a dump.
+
+<form name="dumptype" method="post" action="">
+<table>
+<tr>
+<td>
+<input type="submit" value="JavaDump" name="javadump"/>
+</td>
+</tr>
+<tr>
+<td>
+<input type="submit" value="SystemDump" name="javadump"/>
+</td>
+</tr>
+<tr>
+<td>
+<input type="submit" value="HeapDump" name="javadump"/>
+</td>
+</tr>
+</table>
+</form>
+
+<pre>
+<%
+ String dumpType = request.getParameter("javadump");
+
+ if( "JavaDump".equals(dumpType)) {
+ com.ibm.jvm.Dump.JavaDump();
+ out.write("Wrote javadump. "+System.getProperty("user.dir"));
+ }else if( "SystemDump".equals(dumpType)) {
+ com.ibm.jvm.Dump.SystemDump();
+ out.write("Wrote systemdump. "+System.getProperty("user.dir"));
+ }else if( "HeapDump".equals(dumpType)) {
+ com.ibm.jvm.Dump.HeapDump();
+ out.write("Wrote heapdump. "+System.getProperty("user.dir"));
+ }
+
+%>
+</pre>
+</body>
+</html>
\ No newline at end of file
Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/dump.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain