(tomcat-tck) branch pr/fix-readme-header created (now 30862b7)

2024-01-16 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a change to branch pr/fix-readme-header
in repository https://gitbox.apache.org/repos/asf/tomcat-tck.git


  at 30862b7  Update README.md

This branch includes the following new commits:

 new 30862b7  Update README.md

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat-tck) 01/01: Update README.md

2024-01-16 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch pr/fix-readme-header
in repository https://gitbox.apache.org/repos/asf/tomcat-tck.git

commit 30862b7848ff5c0e3aa2ced15434eab2dcbe0d1c
Author: Filip Hanik 
AuthorDate: Tue Jan 16 08:43:07 2024 -0800

Update README.md

Fix header typo
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index b705791..0850418 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ At the moment, you will need to build the TCK locally (see 
below).
 
 1. `mvn verify`
 
-### Running the EL TCK
+### Running the WebSocket TCK
 
 1. Review the component TCK and Tomcat versions in `$TCK_TOMCAT/pom.xml` and 
edit as required.
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Add compilation support for Graal 21.3

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 087eb420a04e3c8dd80a5eb577b522451909c061
Author: Filip Hanik 
AuthorDate: Mon Jan 3 09:27:34 2022 -0800

Add compilation support for Graal 21.3
---
 res/graal/build-tomcat-native-image.sh   | 2 +-
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index ec99d53..81370ee 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -49,7 +49,7 @@ native-image \
 -H:EnableURLProtocols=http \
 --report-unsupported-elements-at-runtime \
 --initialize-at-run-time=org.apache,jakarta.servlet \
--H:+TraceClassInitialization \
+-H:TraceClassInitialization=org.* \
 -H:+PrintClassInitialization \
 -H:+PrintAnalysisCallTree \
 -H:Name=tc-graal-image \
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 8b5c12c..b83f7e8 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -28,6 +28,7 @@ import jakarta.servlet.http.HttpServlet;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 
+import org.apache.tomcat.util.modeler.Registry;
 import org.junit.Ignore;
 
 import org.apache.catalina.Context;
@@ -55,6 +56,7 @@ public class EmbeddedTomcat {
 }
 
 public static void main(String... args) throws Exception {
+Registry.disableRegistry();
 Tomcat tomcat = new Tomcat();
 resetLogging();
 tomcat.setPort(8080);

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Move import so build can complete

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 49dd3b0bceec16942c945c4ccc6433f42f7fa328
Author: Mark Thomas 
AuthorDate: Mon Jan 10 17:50:07 2022 +

Move import so build can complete
---
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index b83f7e8..d19496f 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -28,12 +28,12 @@ import jakarta.servlet.http.HttpServlet;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 
-import org.apache.tomcat.util.modeler.Registry;
 import org.junit.Ignore;
 
 import org.apache.catalina.Context;
 import org.apache.catalina.connector.Connector;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.scan.StandardJarScanFilter;
 import org.apache.tomcat.util.scan.StandardJarScanner;
 

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated (5d64445 -> 49dd3b0)

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 5d64445  Explicitly release pooled ByteBuffer instances on endpoint 
stop
 new 087eb42  Add compilation support for Graal 21.3
 new 49dd3b0  Move import so build can complete

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 res/graal/build-tomcat-native-image.sh   | 2 +-
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Move import so build can complete

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 338d05d14c14fd8eb7ca44079e016544ac374d75
Author: Mark Thomas 
AuthorDate: Mon Jan 10 17:50:07 2022 +

Move import so build can complete
---
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 3c853df..f8c8649 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -28,13 +28,13 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.tomcat.util.modeler.Registry;
 import org.junit.Ignore;
 
 import org.apache.catalina.Context;
 import org.apache.catalina.connector.Connector;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.scan.StandardJarScanFilter;
 import org.apache.tomcat.util.scan.StandardJarScanner;
 

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Add compilation support for Graal 21.3

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit df26188cc429d3b9ab1a4215dc59b95467f1a051
Author: Filip Hanik 
AuthorDate: Mon Jan 3 09:27:34 2022 -0800

Add compilation support for Graal 21.3
---
 res/graal/build-tomcat-native-image.sh   | 2 +-
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index e557927..7093023 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -49,7 +49,7 @@ native-image \
 -H:EnableURLProtocols=http \
 --report-unsupported-elements-at-runtime \
 --initialize-at-run-time=org.apache,javax.servlet \
--H:+TraceClassInitialization \
+-H:TraceClassInitialization=org.* \
 -H:+PrintClassInitialization \
 -H:+PrintAnalysisCallTree \
 -H:Name=tc-graal-image \
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index bf5820b..3c853df 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.tomcat.util.modeler.Registry;
 import org.junit.Ignore;
 
 import org.apache.catalina.Context;
@@ -57,6 +58,7 @@ public class EmbeddedTomcat {
 }
 
 public static void main(String... args) throws Exception {
+Registry.disableRegistry();
 Tomcat tomcat = new Tomcat();
 resetLogging();
 tomcat.setPort(8080);

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated (25a1da7 -> 338d05d)

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 25a1da7  Expand on fix for BZ 65757 - check for specific request thread
 new df26188  Add compilation support for Graal 21.3
 new 338d05d  Move import so build can complete

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 res/graal/build-tomcat-native-image.sh   | 2 +-
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.0.x updated: Add compilation support for Graal 21.3

2022-01-10 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 916f72d  Add compilation support for Graal 21.3
916f72d is described below

commit 916f72d5cbf06f45260f669283852731d548d0d3
Author: Filip Hanik 
AuthorDate: Mon Jan 3 09:27:34 2022 -0800

Add compilation support for Graal 21.3
---
 res/graal/build-tomcat-native-image.sh   | 2 +-
 test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index ec99d53..81370ee 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -49,7 +49,7 @@ native-image \
 -H:EnableURLProtocols=http \
 --report-unsupported-elements-at-runtime \
 --initialize-at-run-time=org.apache,jakarta.servlet \
--H:+TraceClassInitialization \
+-H:TraceClassInitialization=org.* \
 -H:+PrintClassInitialization \
 -H:+PrintAnalysisCallTree \
 -H:Name=tc-graal-image \
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 8b5c12c..b83f7e8 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -28,6 +28,7 @@ import jakarta.servlet.http.HttpServlet;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 
+import org.apache.tomcat.util.modeler.Registry;
 import org.junit.Ignore;
 
 import org.apache.catalina.Context;
@@ -55,6 +56,7 @@ public class EmbeddedTomcat {
 }
 
 public static void main(String... args) throws Exception {
+Registry.disableRegistry();
 Tomcat tomcat = new Tomcat();
 resetLogging();
 tomcat.setPort(8080);

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Improvements to native (tomcat-embed-programmatic)

2020-10-05 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 6d04ef8  Improvements to native (tomcat-embed-programmatic)
6d04ef8 is described below

commit 6d04ef8952aad6ff07077c8497a7ecd89cf55759
Author: Filip Hanik 
AuthorDate: Fri Oct 2 15:17:35 2020 -0700

Improvements to native (tomcat-embed-programmatic)

1. script to run the embedded-programmatic in JVM or native mode
2. enable one line logging in native image sample
3. add logging to sample native servlet
---
 java/org/apache/catalina/startup/Tomcat.java   |  7 ++-
 res/graal/run-tomcat-native.sh | 63 ++
 .../native-image/tomcat-reflection.json|  7 +++
 .../apache/catalina/startup/EmbeddedTomcat.java| 10 +++-
 4 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index 88859e8..430a635 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -1162,8 +1162,11 @@ public class Tomcat {
 if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
 context.setConfigured(true);
 
-// Process annotations
-WebAnnotationSet.loadApplicationAnnotations(context);
+// Process annotations when not running in a Graal image
+// annotations require reflections and additional 
configuration
+if (!JreCompat.isGraalAvailable()) {
+WebAnnotationSet.loadApplicationAnnotations(context);
+}
 
 // LoginConfig is required to process @ServletSecurity
 // annotations
diff --git a/res/graal/run-tomcat-native.sh b/res/graal/run-tomcat-native.sh
new file mode 100755
index 000..e136a01
--- /dev/null
+++ b/res/graal/run-tomcat-native.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# 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.
+
+set -e
+
+CURDIR=`pwd`
+
+# resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ]; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+PRG="$link"
+  else
+PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+
+# directory of this script
+PRGDIR=`dirname "$PRG"`
+PRGDIR=`cd "$PRGDIR" >/dev/null; pwd`
+
+if [ "$1" == "build" ]; then
+  $PRGDIR/build-tomcat-native-image.sh
+  shift
+fi
+
+echo "Script Directory: $PRGDIR"
+if [ "$1" == "jvm" ]; then
+  cd $PRGDIR/../..
+  if [ ! -f output/graal/tomcat-embedded-sample.jar ]; then
+$PRGDIR/build-tomcat-native-image.sh
+  fi
+  cd $PRGDIR/../../output/graal
+  java -Dorg.graalvm.nativeimage.imagecode=true \
+-cp ../embed/tomcat-embed-programmatic.jar:tomcat-embedded-sample.jar \
+org.apache.catalina.startup.EmbeddedTomcat
+elif [ "$1" == "native" ]; then
+  if [ ! -f $PRGDIR/../../output/graal/tc-graal-image ]; then
+$PRGDIR/build-tomcat-native-image.sh
+  fi
+  $PRGDIR/../../output/graal/tc-graal-image
+else
+  echo "Usage: run-tomcat-native.sh [build] jvm|native"
+  exit 1
+fi
+
+cd $CURDIR
\ No newline at end of file
diff --git 
a/res/graal/tomcat-embed-programmatic/native-image/tomcat-reflection.json 
b/res/graal/tomcat-embed-programmatic/native-image/tomcat-reflection.json
index 0d4f101..7eafd10 100644
--- a/res/graal/tomcat-embed-programmatic/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-programmatic/native-image/tomcat-reflection.json
@@ -1,2 +1,9 @@
 [
+  {
+"name": "org.apache.juli.OneLineFormatter",
+"allPublicMethods": true,
+"allDeclaredFields":true,
+"allDeclaredMethods":true,
+"allDeclaredConstructors":true
+  }
 ]
diff 

[tomcat] branch 9.0.x updated: Move the reflection generation code into the main directory

2020-08-27 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 7094b11  Move the reflection generation code into the main directory
7094b11 is described below

commit 7094b11e7fe4513b1f83c1fba85374183edc7aa7
Author: Filip Hanik 
AuthorDate: Thu Aug 27 09:56:16 2020 -0700

Move the reflection generation code into the main directory
---
 build.xml | 15 ---
 .../xreflection/ObjectReflectionPropertyInspector.java|  0
 .../util/xreflection/ReflectionLessCodeGenerator.java |  0
 .../tomcat/util/xreflection/ReflectionProperty.java   |  0
 .../apache/tomcat/util/xreflection/SetPropertyClass.java  |  0
 5 files changed, 15 deletions(-)

diff --git a/build.xml b/build.xml
index 6da7bbf..f17fed1 100644
--- a/build.xml
+++ b/build.xml
@@ -1675,26 +1675,11 @@
 
 
   
-  
 
 
   
 
 
-
-
-  
-  
-
-
 
 
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
 
b/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
rename to 
java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
 b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
rename to 
java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java 
b/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
rename to java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java 
b/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java
rename to java/org/apache/tomcat/util/xreflection/SetPropertyClass.java


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Move the reflection generation code into the main directory

2020-08-27 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new f6f65c0  Move the reflection generation code into the main directory
f6f65c0 is described below

commit f6f65c0a0d3b34f24276249a579d933b2f20cfe3
Author: Filip Hanik 
AuthorDate: Thu Aug 27 09:56:16 2020 -0700

Move the reflection generation code into the main directory
---
 build.xml | 15 ---
 .../xreflection/ObjectReflectionPropertyInspector.java|  0
 .../util/xreflection/ReflectionLessCodeGenerator.java |  0
 .../tomcat/util/xreflection/ReflectionProperty.java   |  0
 .../apache/tomcat/util/xreflection/SetPropertyClass.java  |  0
 5 files changed, 15 deletions(-)

diff --git a/build.xml b/build.xml
index 1dfa845..2001a13 100644
--- a/build.xml
+++ b/build.xml
@@ -1685,26 +1685,11 @@
 
 
   
-  
 
 
   
 
 
-
-
-  
-  
-
-
 
 
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
 
b/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
rename to 
java/org/apache/tomcat/util/xreflection/ObjectReflectionPropertyInspector.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
 b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
rename to 
java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java 
b/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
rename to java/org/apache/tomcat/util/xreflection/ReflectionProperty.java
diff --git 
a/res/graal/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java 
b/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java
similarity index 100%
rename from 
res/graal/java/org/apache/tomcat/util/xreflection/SetPropertyClass.java
rename to java/org/apache/tomcat/util/xreflection/SetPropertyClass.java


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Add back support for static resources for now

2020-08-14 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 33185e3  Add back support for static resources for now
33185e3 is described below

commit 33185e3abaf440239fd2b4d777d9639c9fdfbce3
Author: Filip Hanik 
AuthorDate: Fri Aug 14 14:02:24 2020 -0700

Add back support for static resources for now

Found embedded applications that serve up resources from
META-INF/resources in nested Jar files
---
 build.xml | 14 --
 1 file changed, 14 deletions(-)

diff --git a/build.xml b/build.xml
index 0613b1f..1dfa845 100644
--- a/build.xml
+++ b/build.xml
@@ -589,20 +589,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Add back support for static resources for now

2020-08-14 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 5f9f36c  Add back support for static resources for now
5f9f36c is described below

commit 5f9f36c59279320c6bbabdf0420dcdf1a359ff9b
Author: Filip Hanik 
AuthorDate: Fri Aug 14 14:02:24 2020 -0700

Add back support for static resources for now

Found embedded applications that serve up resources from
META-INF/resources in nested Jar files
---
 build.xml | 14 --
 1 file changed, 14 deletions(-)

diff --git a/build.xml b/build.xml
index 343ae3b..6da7bbf 100644
--- a/build.xml
+++ b/build.xml
@@ -585,20 +585,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Add in an ability to configure a custom class loader

2020-08-12 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 44c8234  Add in an ability to configure a custom class loader
44c8234 is described below

commit 44c82344ecb1d436d4e88a81fc3788981d3bad6f
Author: Filip Hanik 
AuthorDate: Wed Aug 12 11:14:13 2020 -0700

Add in an ability to configure a custom class loader

without using reflection
beneficial for programmatic usage
and building native images using GraalVM
---
 java/org/apache/catalina/loader/WebappLoader.java  | 16 +
 .../catalina/loader/TestVirtualWebappLoader.java   | 27 ++
 2 files changed, 43 insertions(+)

diff --git a/java/org/apache/catalina/loader/WebappLoader.java 
b/java/org/apache/catalina/loader/WebappLoader.java
index 95d70c2..7076c20 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -243,6 +243,18 @@ public class WebappLoader extends LifecycleMBeanBase
 this.loaderClass = loaderClass;
 }
 
+/**
+ * Set the ClassLoader instance, without relying on reflection
+ * This method will also invoke {@link #setLoaderClass(String)} with
+ * {@code loaderInstance.getClass().getName()} as an argument
+ *
+ * @param loaderInstance The new ClassLoader instance to use
+ */
+public void setLoaderInstance(WebappClassLoaderBase loaderInstance) {
+this.classLoader = loaderInstance;
+setLoaderClass(loaderInstance.getClass().getName());
+}
+
 
 /**
  * Return the reloadable flag for this Loader.
@@ -507,6 +519,10 @@ public class WebappLoader extends LifecycleMBeanBase
 private WebappClassLoaderBase createClassLoader()
 throws Exception {
 
+if (classLoader != null) {
+return classLoader;
+}
+
 if (parentClassLoader == null) {
 parentClassLoader = context.getParentClassLoader();
 } else {
diff --git a/test/org/apache/catalina/loader/TestVirtualWebappLoader.java 
b/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
index afcd8a3..11d840e 100644
--- a/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
+++ b/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
@@ -37,6 +37,33 @@ public class TestVirtualWebappLoader extends TomcatBaseTest {
 }
 
 @Test
+public void testLoaderInstance() throws Exception {
+WebappLoader loader = new WebappLoader();
+Assert.assertNull(loader.getClassLoader());
+WebappClassLoader cl = new WebappClassLoader();
+loader.setLoaderInstance(cl);
+Assert.assertSame(cl, loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File("test/webapp");
+StandardContext ctx = (StandardContext) tomcat.addContext("",
+appDir.getAbsolutePath());
+
+loader.setContext(ctx);
+ctx.setLoader(loader);
+
+
+loader.start();
+Assert.assertSame(cl, loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+loader.stop();
+Assert.assertNull(loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+}
+
+@Test
 public void testStartInternal() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: It should probably do what JavaDoc says

2020-08-12 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 481e448  It should probably do what JavaDoc says
481e448 is described below

commit 481e4487bf4eefbf5f8c1c7e473fb728cdc63f3d
Author: Filip Hanik 
AuthorDate: Wed Aug 12 11:13:35 2020 -0700

It should probably do what JavaDoc says

Change variable modification to method invocation
---
 java/org/apache/catalina/loader/WebappLoader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/loader/WebappLoader.java 
b/java/org/apache/catalina/loader/WebappLoader.java
index 38292be..636c741 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -198,7 +198,7 @@ public class WebappLoader extends LifecycleMBeanBase 
implements Loader{
  */
 public void setLoaderInstance(WebappClassLoaderBase loaderInstance) {
 this.classLoader = loaderInstance;
-this.loaderClass = loaderInstance.getClass().getName();
+setLoaderClass(loaderInstance.getClass().getName());
 }
 
 // - Public Methods


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Add in an ability to configure a custom class loader

2020-08-12 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 7cd2aaa  Add in an ability to configure a custom class loader
7cd2aaa is described below

commit 7cd2aaacdbf20879b04e4ec57a4dbfa6adee2636
Author: Filip Hanik 
AuthorDate: Wed Aug 12 10:46:09 2020 -0700

Add in an ability to configure a custom class loader

without using reflection
beneficial for programmatic usage
and building native images using GraalVM
---
 java/org/apache/catalina/loader/WebappLoader.java  | 15 
 .../catalina/loader/TestVirtualWebappLoader.java   | 27 ++
 2 files changed, 42 insertions(+)

diff --git a/java/org/apache/catalina/loader/WebappLoader.java 
b/java/org/apache/catalina/loader/WebappLoader.java
index 3c3026b..38292be 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -189,6 +189,17 @@ public class WebappLoader extends LifecycleMBeanBase 
implements Loader{
 this.loaderClass = loaderClass;
 }
 
+/**
+ * Set the ClassLoader instance, without relying on reflection
+ * This method will also invoke {@link #setLoaderClass(String)} with
+ * {@code loaderInstance.getClass().getName()} as an argument
+ *
+ * @param loaderInstance The new ClassLoader instance to use
+ */
+public void setLoaderInstance(WebappClassLoaderBase loaderInstance) {
+this.classLoader = loaderInstance;
+this.loaderClass = loaderInstance.getClass().getName();
+}
 
 // - Public Methods
 
@@ -398,6 +409,10 @@ public class WebappLoader extends LifecycleMBeanBase 
implements Loader{
 private WebappClassLoaderBase createClassLoader()
 throws Exception {
 
+if (classLoader != null) {
+return classLoader;
+}
+
 if (ParallelWebappClassLoader.class.getName().equals(loaderClass)) {
 return new 
ParallelWebappClassLoader(context.getParentClassLoader());
 }
diff --git a/test/org/apache/catalina/loader/TestVirtualWebappLoader.java 
b/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
index afcd8a3..11d840e 100644
--- a/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
+++ b/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
@@ -37,6 +37,33 @@ public class TestVirtualWebappLoader extends TomcatBaseTest {
 }
 
 @Test
+public void testLoaderInstance() throws Exception {
+WebappLoader loader = new WebappLoader();
+Assert.assertNull(loader.getClassLoader());
+WebappClassLoader cl = new WebappClassLoader();
+loader.setLoaderInstance(cl);
+Assert.assertSame(cl, loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File("test/webapp");
+StandardContext ctx = (StandardContext) tomcat.addContext("",
+appDir.getAbsolutePath());
+
+loader.setContext(ctx);
+ctx.setLoader(loader);
+
+
+loader.start();
+Assert.assertSame(cl, loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+loader.stop();
+Assert.assertNull(loader.getClassLoader());
+Assert.assertEquals(WebappClassLoader.class.getName(), 
loader.getLoaderClass());
+}
+
+@Test
 public void testStartInternal() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: When installing Maven artifacts, install the source as well

2020-08-12 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 46ee8f0  When installing Maven artifacts, install the source as well
46ee8f0 is described below

commit 46ee8f0fa6d0b5d421229a44c5e5ae48150bbc09
Author: Filip Hanik 
AuthorDate: Wed Aug 12 08:08:14 2020 -0700

When installing Maven artifacts, install the source as well
---
 res/maven/mvn-pub.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/res/maven/mvn-pub.xml b/res/maven/mvn-pub.xml
index 887578b..4ab26f7 100644
--- a/res/maven/mvn-pub.xml
+++ b/res/maven/mvn-pub.xml
@@ -52,6 +52,7 @@
 
 
   
+  
   
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: When installing Maven artifacts, install the source as well

2020-08-12 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 81baa13  When installing Maven artifacts, install the source as well
81baa13 is described below

commit 81baa13b5aadfac5f1d709abc2c0dd39c09d5ae0
Author: Filip Hanik 
AuthorDate: Wed Aug 12 08:08:14 2020 -0700

When installing Maven artifacts, install the source as well
---
 res/maven/mvn-pub.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/res/maven/mvn-pub.xml b/res/maven/mvn-pub.xml
index e811bb2..76b786c 100644
--- a/res/maven/mvn-pub.xml
+++ b/res/maven/mvn-pub.xml
@@ -52,6 +52,7 @@
 
 
   
+  
   
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Add an experimental minimal distribution to be published

2020-07-27 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new d653016  Add an experimental minimal distribution to be published
d653016 is described below

commit d65301648aae1d1de4cb227d9305f26ea6e08da1
Author: Filip Hanik 
AuthorDate: Mon Jul 27 13:35:03 2020 -0700

Add an experimental minimal distribution to be published

- For usage with optimized for size Java and GraalVM native compilation 
images
- Maven groupId is set to org.apache.tomcat.experimental to classify it 
during evaluation of viability
- Does not ship as part of the standard Apache Tomcat library and sources
---
 build.xml  | 343 +++-
 .../org/apache/tomcat/util/IntrospectionUtils.java |   7 +
 .../tomcat/util/XReflectionIntrospectionUtils.java |  33 ++
 res/graal/build-tomcat-native-image.sh |   3 +-
 .../ObjectReflectionPropertyInspector.java | 282 +
 .../xreflection/ReflectionLessCodeGenerator.java   | 273 +
 .../util/xreflection/ReflectionProperty.java   | 119 ++
 .../tomcat/util/xreflection/SetPropertyClass.java  | 436 +
 .../native-image/native-image.properties   |  16 +
 .../native-image/tomcat-reflection.json|   2 +
 .../native-image/tomcat-resource.json  |  51 +++
 res/maven/mvn-pub.xml  |  10 +
 res/maven/tomcat-embed-programmatic.pom|  35 ++
 .../apache/catalina/startup/EmbeddedTomcat.java|   4 +-
 14 files changed, 1610 insertions(+), 4 deletions(-)

diff --git a/build.xml b/build.xml
index 8e02cb5..bd87179 100644
--- a/build.xml
+++ b/build.xml
@@ -153,11 +153,13 @@
 
   
   
+  
   
   
   
 
   
+  
   
   
   
@@ -427,6 +429,268 @@
 
   
 
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
 
   
@@ -1435,9 +1699,86 @@
 
   
 
+  
+
+
+
+Generating Reflection Less Introspection to: 
${xreflect.directory}
+
+
+  
+  
+
+
+  
+
+
+
+
+  
+  
+
+
+
+
+  
+
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
+  depends="embed-jars,embed-sources,embed-programmatic-jar" >
 
 
diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 1d830e1..e1cb4b3 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -60,6 +60,10 @@ public final class IntrospectionUtils {
 log.debug("IntrospectionUtils: setProperty(" +
 o.getClass() + " " + name + "=" + value + ")");
 
+if (actualMethod == null && XReflectionIntrospectionUtils.isEnabled()) 
{
+return XReflectionIntrospectionUtils.setPropertyInternal(o, name, 
value, invokeSetProperty);
+}
+
 String setter = "set" + capitalize(name);
 
 try {
@@ -222,6 +226,9 @@ public final class IntrospectionUtils {
 }
 
 public static Object getProperty(Object o, String name) {
+if (XReflectionIntrospectionUtils.isEnabled()) {
+return XReflectionIntrospectionUtils.getPropertyInternal(o, name);
+}
 String getter = "get" + capitalize(n

[tomcat] branch master updated: Add an experimental minimal distribution to be published

2020-07-27 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new a9eae94  Add an experimental minimal distribution to be published
a9eae94 is described below

commit a9eae944f0f906b9b5375ac25a796404a1f51095
Author: Filip Hanik 
AuthorDate: Mon Jul 27 13:35:03 2020 -0700

Add an experimental minimal distribution to be published

- For usage with optimized for size Java and GraalVM native compilation 
images
- Maven groupId is set to org.apache.tomcat.experimental to classify it 
during evaluation of viability
- Does not ship as part of the standard Apache Tomcat library and sources
---
 build.xml  | 343 +++-
 .../org/apache/tomcat/util/IntrospectionUtils.java |   7 +
 .../tomcat/util/XReflectionIntrospectionUtils.java |  33 ++
 res/graal/build-tomcat-native-image.sh |   3 +-
 .../ObjectReflectionPropertyInspector.java | 281 +
 .../xreflection/ReflectionLessCodeGenerator.java   | 273 +
 .../util/xreflection/ReflectionProperty.java   | 119 ++
 .../tomcat/util/xreflection/SetPropertyClass.java  | 436 +
 .../native-image/native-image.properties   |  16 +
 .../native-image/tomcat-reflection.json|   2 +
 .../native-image/tomcat-resource.json  |  51 +++
 res/maven/mvn-pub.xml  |  10 +
 res/maven/tomcat-embed-programmatic.pom|  35 ++
 .../apache/catalina/startup/EmbeddedTomcat.java|   4 +-
 14 files changed, 1609 insertions(+), 4 deletions(-)

diff --git a/build.xml b/build.xml
index cf79946..41441e4 100644
--- a/build.xml
+++ b/build.xml
@@ -157,11 +157,13 @@
 
   
   
+  
   
   
   
 
   
+  
   
   
   
@@ -431,6 +433,268 @@
 
   
 
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
 
   
@@ -1445,9 +1709,86 @@
 
   
 
+  
+
+
+
+Generating Reflection Less Introspection to: 
${xreflect.directory}
+
+
+  
+  
+
+
+  
+
+
+
+
+  
+  
+
+
+
+
+  
+
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
+  depends="embed-jars,embed-sources,embed-programmatic-jar" >
 
 
diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 78ab66f..a6bc510 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -60,6 +60,10 @@ public final class IntrospectionUtils {
 log.debug("IntrospectionUtils: setProperty(" +
 o.getClass() + " " + name + "=" + value + ")");
 
+if (actualMethod == null && XReflectionIntrospectionUtils.isEnabled()) 
{
+return XReflectionIntrospectionUtils.setPropertyInternal(o, name, 
value, invokeSetProperty);
+}
+
 String setter = "set" + capitalize(name);
 
 try {
@@ -222,6 +226,9 @@ public final class IntrospectionUtils {
 }
 
 public static Object getProperty(Object o, String name) {
+if (XReflectionIntrospectionUtils.isEnabled()) {
+return XReflectionIntrospectionUtils.getPropertyInternal(o, name);
+}
 String getter = "get" + capitalize(n

[tomcat] branch master updated: Allow detection of Graal via reflection or system property

2020-07-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new b1820ad  Allow detection of Graal via reflection or system property
b1820ad is described below

commit b1820ad16b41671c265c7194deb0d723d9c34ac9
Author: Filip Hanik 
AuthorDate: Thu Jul 23 15:41:16 2020 -0700

Allow detection of Graal via reflection or system property
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 2 +-
 java/org/apache/naming/NamingContext.java | 2 +-
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index cfb6e75..73b149f 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -69,7 +69,7 @@ public class JspRuntimeLibrary {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 /**
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 0471279..a064421 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -804,7 +804,7 @@ public class NamingContext implements Context {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 /**
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 9fb835a..6187eb6 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -32,7 +32,7 @@ class GraalCompat extends Jre9Compat {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 static boolean isSupported() {


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Allow detection of Graal via reflection or system property

2020-07-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 73288c6  Allow detection of Graal via reflection or system property
73288c6 is described below

commit 73288c6b3c979777054e4fc5baf0163c84bb2ac9
Author: Filip Hanik 
AuthorDate: Thu Jul 23 15:41:16 2020 -0700

Allow detection of Graal via reflection or system property
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 2 +-
 java/org/apache/naming/NamingContext.java | 2 +-
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index c0a7a63..3a0cc1b 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -69,7 +69,7 @@ public class JspRuntimeLibrary {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 /**
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 0471279..a064421 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -804,7 +804,7 @@ public class NamingContext implements Context {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 /**
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 9fb835a..6187eb6 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -32,7 +32,7 @@ class GraalCompat extends Jre9Compat {
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 }
-GRAAL = result;
+GRAAL = result || 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 }
 
 static boolean isSupported() {


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Minor EL bugs when running under Graal/SubstrateVM

2020-07-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new f03f60e  Minor EL bugs when running under Graal/SubstrateVM
f03f60e is described below

commit f03f60e04a97f283825da9000a913107922d24fb
Author: Filip Hanik 
AuthorDate: Thu Jul 23 12:17:33 2020 -0700

Minor EL bugs when running under Graal/SubstrateVM
---
 java/org/apache/jasper/el/JasperELResolver.java | 4 
 test/org/apache/jasper/el/TestJasperELResolver.java | 8 +---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index d28c61c..71ed2ff 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -199,6 +199,7 @@ public class JasperELResolver extends CompositeELResolver {
 if (method != null) {
 context.setPropertyResolved(base, property);
 try {
+method.setAccessible(true);
 value = method.invoke(base, (Object[]) null);
 } catch (Exception ex) {
 Throwable thr = 
ExceptionUtils.unwrapInvocationTargetException(ex);
@@ -211,6 +212,9 @@ public class JasperELResolver extends CompositeELResolver {
 @Override
 public void setValue(ELContext context, Object base, Object property,
 Object value) {
+if (base == null) {
+return;
+}
 Method method = getWriteMethod(base.getClass(), 
property.toString());
 if (method != null) {
 context.setPropertyResolved(base, property);
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 59c31d6..d58391e 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -28,6 +28,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.el.stream.StreamELResolverImpl;
+import org.apache.jasper.runtime.JspRuntimeLibrary;
 
 public class TestJasperELResolver {
 
@@ -53,15 +54,16 @@ public class TestJasperELResolver {
 list.add(new ImplicitObjectELResolver());
 }
 
+int adjustedForGraalCount = JspRuntimeLibrary.GRAAL ? count + 1 : 
count;
+
 JasperELResolver resolver =
 new JasperELResolver(list, new StreamELResolverImpl());
 
-
 Assert.assertEquals(Integer.valueOf(count),
 getField("appResolversSize", resolver));
-Assert.assertEquals(9 + count,
+Assert.assertEquals(9 + adjustedForGraalCount,
 ((ELResolver[])getField("resolvers", resolver)).length);
-Assert.assertEquals(Integer.valueOf(9 + count),
+Assert.assertEquals(Integer.valueOf(9 + adjustedForGraalCount),
 Integer.valueOf(((AtomicInteger) getField("resolversSize", 
resolver)).get()));
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Minor EL bugs when running under Graal/SubstrateVM

2020-07-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 814f52b  Minor EL bugs when running under Graal/SubstrateVM
814f52b is described below

commit 814f52b4e36b54bec957ccd12354b8b70bc28e69
Author: Filip Hanik 
AuthorDate: Thu Jul 23 12:17:33 2020 -0700

Minor EL bugs when running under Graal/SubstrateVM
---
 java/org/apache/jasper/el/JasperELResolver.java | 4 
 test/org/apache/jasper/el/TestJasperELResolver.java | 8 +---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 99189807..1d72630 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -199,6 +199,7 @@ public class JasperELResolver extends CompositeELResolver {
 if (method != null) {
 context.setPropertyResolved(base, property);
 try {
+method.setAccessible(true);
 value = method.invoke(base, (Object[]) null);
 } catch (Exception ex) {
 Throwable thr = 
ExceptionUtils.unwrapInvocationTargetException(ex);
@@ -211,6 +212,9 @@ public class JasperELResolver extends CompositeELResolver {
 @Override
 public void setValue(ELContext context, Object base, Object property,
 Object value) {
+if (base == null) {
+return;
+}
 Method method = getWriteMethod(base.getClass(), 
property.toString());
 if (method != null) {
 context.setPropertyResolved(base, property);
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 948465c..f2eef62 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -28,6 +28,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.el.stream.StreamELResolverImpl;
+import org.apache.jasper.runtime.JspRuntimeLibrary;
 
 public class TestJasperELResolver {
 
@@ -53,15 +54,16 @@ public class TestJasperELResolver {
 list.add(new ImplicitObjectELResolver());
 }
 
+int adjustedForGraalCount = JspRuntimeLibrary.GRAAL ? count + 1 : 
count;
+
 JasperELResolver resolver =
 new JasperELResolver(list, new StreamELResolverImpl());
 
-
 Assert.assertEquals(Integer.valueOf(count),
 getField("appResolversSize", resolver));
-Assert.assertEquals(9 + count,
+Assert.assertEquals(9 + adjustedForGraalCount,
 ((ELResolver[])getField("resolvers", resolver)).length);
-Assert.assertEquals(Integer.valueOf(9 + count),
+Assert.assertEquals(Integer.valueOf(9 + adjustedForGraalCount),
 Integer.valueOf(((AtomicInteger) getField("resolversSize", 
resolver)).get()));
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Revert "Simpler way to determine Graal runtime"

2020-07-22 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new cb5eaa3  Revert "Simpler way to determine Graal runtime"
cb5eaa3 is described below

commit cb5eaa3925bb4649a74a3872a9fda76fc9d102b1
Author: Filip Hanik 
AuthorDate: Wed Jul 22 11:43:43 2020 -0700

Revert "Simpler way to determine Graal runtime"

This reverts commit 098c4c81602ba1e8d5f33b0795d7caf55f70d573.

https://tomcat.markmail.org/search/?q=#query:%20list%3Aorg.apache.tomcat.dev+page:1+mid:7vo7ugmqjz2z7x5f+state:results
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 16 +++-
 java/org/apache/naming/NamingContext.java | 15 ++-
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 15 ++-
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index f27ce3b..cfb6e75 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -56,7 +56,21 @@ import org.apache.tomcat.InstanceManager;
  */
 public class JspRuntimeLibrary {
 
-public static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+public static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = nativeImageClazz.getMethod("inImageCode").invoke(null) != 
null;
+// Note: This will also be true for the Graal substrate VM
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Returns the value of the jakarta.servlet.error.exception request
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 40f4085..0471279 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -792,7 +792,20 @@ public class NamingContext implements Context {
 // -- Protected Methods
 
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Retrieves the named object.
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index e3cb09d..9fb835a 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -20,7 +20,20 @@ import java.io.IOException;
 
 class GraalCompat extends Jre9Compat {
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 static boolean isSupported() {
 // This property does not exist for a native image


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Revert "Simpler way to determine Graal runtime"

2020-07-22 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 87cbed1  Revert "Simpler way to determine Graal runtime"
87cbed1 is described below

commit 87cbed1244205fb112f421449482d02b56f6167b
Author: Filip Hanik 
AuthorDate: Wed Jul 22 11:40:14 2020 -0700

Revert "Simpler way to determine Graal runtime"

This reverts commit 6a73695fa6d024ed9fc4adeb32073cbd94309c51.

https://tomcat.markmail.org/search/?q=#query:%20list%3Aorg.apache.tomcat.dev+page:1+mid:7vo7ugmqjz2z7x5f+state:results
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 16 +++-
 java/org/apache/naming/NamingContext.java | 15 ++-
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 15 ++-
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index d710f84..c0a7a63 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -56,7 +56,21 @@ import org.apache.tomcat.InstanceManager;
  */
 public class JspRuntimeLibrary {
 
-public static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+public static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = nativeImageClazz.getMethod("inImageCode").invoke(null) != 
null;
+// Note: This will also be true for the Graal substrate VM
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Returns the value of the javax.servlet.error.exception request
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 40f4085..0471279 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -792,7 +792,20 @@ public class NamingContext implements Context {
 // -- Protected Methods
 
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Retrieves the named object.
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index e3cb09d..9fb835a 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -20,7 +20,20 @@ import java.io.IOException;
 
 class GraalCompat extends Jre9Compat {
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 static boolean isSupported() {
 // This property does not exist for a native image


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Parent classloader has to be resolved first.

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 77efc02  Parent classloader has to be resolved first.
77efc02 is described below

commit 77efc025aca11e63d40dd758538a436c18edf96f
Author: Filip Hanik 
AuthorDate: Tue Jul 21 16:18:09 2020 -0700

Parent classloader has to be resolved first.

missing commit.
---
 java/org/apache/catalina/loader/WebappLoader.java | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappLoader.java 
b/java/org/apache/catalina/loader/WebappLoader.java
index 0dc64ed..95d70c2 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -507,6 +507,12 @@ public class WebappLoader extends LifecycleMBeanBase
 private WebappClassLoaderBase createClassLoader()
 throws Exception {
 
+if (parentClassLoader == null) {
+parentClassLoader = context.getParentClassLoader();
+} else {
+context.setParentClassLoader(parentClassLoader);
+}
+
 if (ParallelWebappClassLoader.class.getName().equals(loaderClass)) {
 return new ParallelWebappClassLoader(parentClassLoader);
 }
@@ -514,11 +520,6 @@ public class WebappLoader extends LifecycleMBeanBase
 Class clazz = Class.forName(loaderClass);
 WebappClassLoaderBase classLoader = null;
 
-if (parentClassLoader == null) {
-parentClassLoader = context.getParentClassLoader();
-} else {
-context.setParentClassLoader(parentClassLoader);
-}
 Class[] argTypes = { ClassLoader.class };
 Object[] args = { parentClassLoader };
 Constructor constr = clazz.getConstructor(argTypes);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Avoid reflection for default instantiation

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit f4dac6846c548144799b1c3f33aba4eb320a3413
Author: Filip Hanik 
AuthorDate: Mon Jul 13 12:43:55 2020 -0700

Avoid reflection for default instantiation

(Most commonly used codepath)

Avoid having to load APR classes in the Connector

Ensure that IntrospectionUtils can call setProperty on
PersistentProviderRegistrations
---
 .../auth/message/config/AuthConfigFactory.java |  8 ++-
 .../jaspic/PersistentProviderRegistrations.java|  5 +-
 java/org/apache/catalina/connector/Connector.java  | 14 ++---
 .../apache/catalina/core/AprLifecycleListener.java | 43 ++
 java/org/apache/catalina/core/AprStatus.java   | 69 ++
 java/org/apache/catalina/core/StandardHost.java|  4 +-
 java/org/apache/catalina/loader/WebappLoader.java  |  4 ++
 java/org/apache/catalina/startup/Tomcat.java   |  8 ++-
 8 files changed, 119 insertions(+), 36 deletions(-)

diff --git a/java/javax/security/auth/message/config/AuthConfigFactory.java 
b/java/javax/security/auth/message/config/AuthConfigFactory.java
index d98b2f2..b27235b 100644
--- a/java/javax/security/auth/message/config/AuthConfigFactory.java
+++ b/java/javax/security/auth/message/config/AuthConfigFactory.java
@@ -72,8 +72,12 @@ public abstract class AuthConfigFactory {
 // this class. Note that the Thread context class 
loader
 // should not be used since that would trigger a 
memory leak
 // in container environments.
-Class clazz = Class.forName(className);
-return (AuthConfigFactory) 
clazz.getConstructor().newInstance();
+if 
(className.equals("org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl"))
 {
+return new 
org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl();
+} else {
+Class clazz = Class.forName(className);
+return (AuthConfigFactory) 
clazz.getConstructor().newInstance();
+}
 }
 });
 } catch (PrivilegedActionException e) {
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index a1ba60c..cd75799 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -41,7 +41,7 @@ import org.xml.sax.SAXException;
  * Utility class for the loading and saving of JASPIC persistent provider
  * registrations.
  */
-final class PersistentProviderRegistrations {
+public final class PersistentProviderRegistrations {
 
 private static final StringManager sm =
 StringManager.getManager(PersistentProviderRegistrations.class);
@@ -233,6 +233,9 @@ final class PersistentProviderRegistrations {
 public void addProperty(Property property) {
 properties.put(property.getName(), property.getValue());
 }
+public void setProperty(String name, String value) {
+addProperty(name, value);
+}
 void addProperty(String name, String value) {
 properties.put(name, value);
 }
diff --git a/java/org/apache/catalina/connector/Connector.java 
b/java/org/apache/catalina/connector/Connector.java
index b22ce95..1cc1580 100644
--- a/java/org/apache/catalina/connector/Connector.java
+++ b/java/org/apache/catalina/connector/Connector.java
@@ -29,7 +29,7 @@ import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Service;
-import org.apache.catalina.core.AprLifecycleListener;
+import org.apache.catalina.core.AprStatus;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.coyote.AbstractProtocol;
 import org.apache.coyote.Adapter;
@@ -80,8 +80,8 @@ public class Connector extends LifecycleMBeanBase  {
 
 
 public Connector(String protocol) {
-boolean apr = AprLifecycleListener.isAprAvailable() &&
-AprLifecycleListener.getUseAprConnector();
+boolean apr = AprStatus.isAprAvailable() &&
+AprStatus.getUseAprConnector();
 ProtocolHandler p = null;
 try {
 p = ProtocolHandler.create(protocol, apr);
@@ -625,7 +625,7 @@ public class Connector extends LifecycleMBeanBase  {
  * @return the Coyote protocol handler in use.
  */
 public String getProtocol() {
-boolean apr = AprLifecycleL

[tomcat] 01/02: Simpler way to determine Graal runtime

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6a73695fa6d024ed9fc4adeb32073cbd94309c51
Author: Filip Hanik 
AuthorDate: Tue Jul 21 14:04:57 2020 -0700

Simpler way to determine Graal runtime

Also, allows to mock the behavior

https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_CODE_KEY
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 16 +---
 java/org/apache/naming/NamingContext.java | 15 +--
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 15 +--
 3 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index c0a7a63..d710f84 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -56,21 +56,7 @@ import org.apache.tomcat.InstanceManager;
  */
 public class JspRuntimeLibrary {
 
-public static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = nativeImageClazz.getMethod("inImageCode").invoke(null) != 
null;
-// Note: This will also be true for the Graal substrate VM
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+public static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 /**
  * Returns the value of the javax.servlet.error.exception request
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 0471279..40f4085 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -792,20 +792,7 @@ public class NamingContext implements Context {
 // -- Protected Methods
 
 
-private static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 /**
  * Retrieves the named object.
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 9fb835a..e3cb09d 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -20,20 +20,7 @@ import java.io.IOException;
 
 class GraalCompat extends Jre9Compat {
 
-private static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 static boolean isSupported() {
 // This property does not exist for a native image


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated (5157388 -> f4dac68)

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 5157388  fix module names to reflect Java EE origin
 new 6a73695  Simpler way to determine Graal runtime
 new f4dac68  Avoid reflection for default instantiation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../auth/message/config/AuthConfigFactory.java |  8 ++-
 .../jaspic/PersistentProviderRegistrations.java|  5 +-
 java/org/apache/catalina/connector/Connector.java  | 14 ++---
 .../apache/catalina/core/AprLifecycleListener.java | 43 ++
 java/org/apache/catalina/core/AprStatus.java   | 69 ++
 java/org/apache/catalina/core/StandardHost.java|  4 +-
 java/org/apache/catalina/loader/WebappLoader.java  |  4 ++
 java/org/apache/catalina/startup/Tomcat.java   |  8 ++-
 .../apache/jasper/runtime/JspRuntimeLibrary.java   | 16 +
 java/org/apache/naming/NamingContext.java  | 15 +
 .../org/apache/tomcat/util/compat/GraalCompat.java | 15 +
 11 files changed, 122 insertions(+), 79 deletions(-)
 create mode 100644 java/org/apache/catalina/core/AprStatus.java


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Simpler way to determine Graal runtime

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 098c4c8  Simpler way to determine Graal runtime
098c4c8 is described below

commit 098c4c81602ba1e8d5f33b0795d7caf55f70d573
Author: Filip Hanik 
AuthorDate: Tue Jul 21 14:04:57 2020 -0700

Simpler way to determine Graal runtime

Also, allows to mock the behavior

https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_CODE_KEY
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 16 +---
 java/org/apache/naming/NamingContext.java | 15 +--
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 15 +--
 3 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index cfb6e75..f27ce3b 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -56,21 +56,7 @@ import org.apache.tomcat.InstanceManager;
  */
 public class JspRuntimeLibrary {
 
-public static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = nativeImageClazz.getMethod("inImageCode").invoke(null) != 
null;
-// Note: This will also be true for the Graal substrate VM
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+public static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 /**
  * Returns the value of the jakarta.servlet.error.exception request
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 0471279..40f4085 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -792,20 +792,7 @@ public class NamingContext implements Context {
 // -- Protected Methods
 
 
-private static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 /**
  * Retrieves the named object.
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 9fb835a..e3cb09d 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -20,20 +20,7 @@ import java.io.IOException;
 
 class GraalCompat extends Jre9Compat {
 
-private static final boolean GRAAL;
-
-static {
-boolean result = false;
-try {
-Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
-result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
-} catch (ClassNotFoundException e) {
-// Must be Graal
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Should never happen
-}
-GRAAL = result;
-}
+private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
 
 static boolean isSupported() {
 // This property does not exist for a native image


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Avoid reflection for default instantiation

2020-07-21 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new c08bf81  Avoid reflection for default instantiation
c08bf81 is described below

commit c08bf81f0db7742779ab0c5da45818dde8465d34
Author: Filip Hanik 
AuthorDate: Mon Jul 13 12:43:55 2020 -0700

Avoid reflection for default instantiation

(Most commonly used codepath)

Avoid having to load APR classes in the Connector

Ensure that IntrospectionUtils can call setProperty on
PersistentProviderRegistrations
---
 .../auth/message/config/AuthConfigFactory.java |  8 ++-
 .../jaspic/PersistentProviderRegistrations.java| 12 -
 java/org/apache/catalina/connector/Connector.java  |  8 +--
 .../apache/catalina/core/AprLifecycleListener.java | 32 +---
 java/org/apache/catalina/core/AprStatus.java   | 60 ++
 java/org/apache/catalina/core/StandardHost.java|  4 +-
 java/org/apache/catalina/loader/WebappLoader.java  |  4 ++
 java/org/apache/catalina/startup/Tomcat.java   |  8 ++-
 8 files changed, 109 insertions(+), 27 deletions(-)

diff --git a/java/jakarta/security/auth/message/config/AuthConfigFactory.java 
b/java/jakarta/security/auth/message/config/AuthConfigFactory.java
index d0e1cbd..6f02fde 100644
--- a/java/jakarta/security/auth/message/config/AuthConfigFactory.java
+++ b/java/jakarta/security/auth/message/config/AuthConfigFactory.java
@@ -72,8 +72,12 @@ public abstract class AuthConfigFactory {
 // this class. Note that the Thread context class 
loader
 // should not be used since that would trigger a 
memory leak
 // in container environments.
-Class clazz = Class.forName(className);
-return (AuthConfigFactory) 
clazz.getConstructor().newInstance();
+if 
(className.equals("org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl"))
 {
+return new 
org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl();
+} else {
+Class clazz = Class.forName(className);
+return (AuthConfigFactory) 
clazz.getConstructor().newInstance();
+}
 }
 });
 } catch (PrivilegedActionException e) {
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index a1ba60c..8ffe8ec 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -41,7 +41,7 @@ import org.xml.sax.SAXException;
  * Utility class for the loading and saving of JASPIC persistent provider
  * registrations.
  */
-final class PersistentProviderRegistrations {
+public final class PersistentProviderRegistrations {
 
 private static final StringManager sm =
 StringManager.getManager(PersistentProviderRegistrations.class);
@@ -233,6 +233,16 @@ final class PersistentProviderRegistrations {
 public void addProperty(Property property) {
 properties.put(property.getName(), property.getValue());
 }
+
+/**
+ * Used by IntrospectionUtils via reflection.
+ * @param name - the name of of the property to set on this object
+ * @param value - the value to set
+ * @see #addProperty(String, String)
+ */
+public void setProperty(String name, String value) {
+addProperty(name, value);
+}
 void addProperty(String name, String value) {
 properties.put(name, value);
 }
diff --git a/java/org/apache/catalina/connector/Connector.java 
b/java/org/apache/catalina/connector/Connector.java
index c35c4cf..c2e7e25 100644
--- a/java/org/apache/catalina/connector/Connector.java
+++ b/java/org/apache/catalina/connector/Connector.java
@@ -29,7 +29,7 @@ import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Service;
-import org.apache.catalina.core.AprLifecycleListener;
+import org.apache.catalina.core.AprStatus;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.coyote.AbstractProtocol;
 import org.apache.coyote.Adapter;
@@ -1022,15 +1022,15 @@ public class Connector extends LifecycleMBeanBase  {
 setParseBodyMethods(getParseBodyMethods());
 }
 
-if (protocolHandler.isAprRequired() && 
!AprLifecycleListener.isInstanceCreate

[tomcat] branch 9.0.x updated: Enable graal reflection on all ParallelWebappClassLoader methods

2020-07-20 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 0599a24  Enable graal reflection on all ParallelWebappClassLoader 
methods
0599a24 is described below

commit 0599a24c3f7effecdcaef42cf2caa6afccb73432
Author: Filip Hanik 
AuthorDate: Mon Jul 20 08:31:30 2020 -0700

Enable graal reflection on all ParallelWebappClassLoader methods
---
 res/graal/tomcat-embed-core/native-image/tomcat-reflection.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json 
b/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
index 9d80526..f4d6560 100644
--- a/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
@@ -37,7 +37,7 @@
 { "name":"org.apache.catalina.Wrapper" },
 { "name":"org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl", 
"methods" : [{"name": "","parameterTypes":[]}] },
 { "name":"org.apache.catalina.core.StandardContext", "methods" : [{"name": 
"","parameterTypes":[]}] },
-{ "name":"org.apache.catalina.loader.ParallelWebappClassLoader", 
"allPublicMethods":true, 
"methods":[{"name":"","parameterTypes":["java.lang.ClassLoader"] }]},
+{ "name":"org.apache.catalina.loader.ParallelWebappClassLoader", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true},
 { "name":"org.apache.catalina.servlets.DefaultServlet", 
"allDeclaredFields":true, "allDeclaredMethods":true },
 { "name":"org.apache.catalina.valves.ErrorReportValve", "methods" : [{"name": 
"","parameterTypes":[]}] },
 { "name":"org.apache.coyote.http11.Http11NioProtocol", "methods" : [{"name": 
"","parameterTypes":[]}] },


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Enable graal reflection on all ParallelWebappClassLoader methods

2020-07-20 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 06958d1  Enable graal reflection on all ParallelWebappClassLoader 
methods
06958d1 is described below

commit 06958d1edc23f3ced1d0db094c221be47b5bb67f
Author: Filip Hanik 
AuthorDate: Mon Jul 20 08:31:30 2020 -0700

Enable graal reflection on all ParallelWebappClassLoader methods
---
 res/graal/tomcat-embed-core/native-image/tomcat-reflection.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json 
b/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
index e98a55b..ee96509 100644
--- a/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
@@ -37,7 +37,7 @@
 { "name":"org.apache.catalina.Wrapper" },
 { "name":"org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl", 
"methods" : [{"name": "","parameterTypes":[]}] },
 { "name":"org.apache.catalina.core.StandardContext", "methods" : [{"name": 
"","parameterTypes":[]}] },
-{ "name":"org.apache.catalina.loader.ParallelWebappClassLoader", 
"allPublicMethods":true, 
"methods":[{"name":"","parameterTypes":["java.lang.ClassLoader"] }]},
+{ "name":"org.apache.catalina.loader.ParallelWebappClassLoader", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true},
 { "name":"org.apache.catalina.servlets.DefaultServlet", 
"allDeclaredFields":true, "allDeclaredMethods":true },
 { "name":"org.apache.catalina.valves.ErrorReportValve", "methods" : [{"name": 
"","parameterTypes":[]}] },
 { "name":"org.apache.coyote.http11.Http11NioProtocol", "methods" : [{"name": 
"","parameterTypes":[]}] },


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Make `ant -f mvn-pub.xml generic-install` work with the new ant tasks

2020-06-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 3717e06  Make `ant -f mvn-pub.xml generic-install` work with the new 
ant tasks
3717e06 is described below

commit 3717e06e5f2d58deb7379a20d43f688d89f716d4
Author: Filip Hanik 
AuthorDate: Tue Jun 23 11:11:24 2020 -0700

Make `ant -f mvn-pub.xml generic-install` work with the new ant tasks
---
 res/maven/mvn-pub.xml | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/res/maven/mvn-pub.xml b/res/maven/mvn-pub.xml
index ae4e85d..0f5d6d2 100644
--- a/res/maven/mvn-pub.xml
+++ b/res/maven/mvn-pub.xml
@@ -50,8 +50,11 @@
   
 
 
-
+
+  
   
+  
+  
 
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Revert "Fixes OSGI bundling error"

2020-06-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 7ec1d31  Revert "Fixes OSGI bundling error"
7ec1d31 is described below

commit 7ec1d3158461c50123092a96c7ca8f032721a314
Author: Filip Hanik 
AuthorDate: Tue Jun 23 14:17:46 2020 -0700

Revert "Fixes OSGI bundling error"

This reverts commit caed3194b48ccbbac0572417b0e60807683a8690.
---
 res/bnd/build-defaults.bnd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/bnd/build-defaults.bnd b/res/bnd/build-defaults.bnd
index a099b49..cdefb9c 100644
--- a/res/bnd/build-defaults.bnd
+++ b/res/bnd/build-defaults.bnd
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-Bundle-Version: ${version}
+Bundle-Version: ${version_cleanup;${version}}
 
 Specification-Title: Apache Tomcat
 Specification-Version: ${version.major.minor}


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Fixes OSGI bundling error

2020-06-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new caed319  Fixes OSGI bundling error
caed319 is described below

commit caed3194b48ccbbac0572417b0e60807683a8690
Author: Filip Hanik 
AuthorDate: Tue Jun 23 11:53:08 2020 -0700

Fixes OSGI bundling error

add-osgi:
 [echo] add-osgi

/development/pivotal/cloudfoundry/spring-projects/graal/tomcat/output/build/lib/annotations-api.jar
true
  [bnd] 1 ERRORS
  [bnd]  Invalid value for Bundle-Version,
${version_cleanup;9.0.0-native-image-dev} does not match
[0-9]{1,9}(\.[0-9]{1,9}(\.[0-9]{1,9}(\.[0-9A-Za-z_-]+)?)?)?
  [bnd]

/development/pivotal/cloudfoundry/spring-projects/graal/tomcat/res/bnd/annotations-api.jar.tmp.bnd:
bnd failed
  [bnd] at
aQute.bnd.ant.BndTask.executeBackwardCompatible(BndTask.java:240)
  [bnd] at aQute.bnd.ant.BndTask.execute(BndTask.java:119)
  [bnd] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  [bnd] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
  [bnd] at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [bnd] at java.lang.reflect.Method.invoke(Method.java:498)
  [bnd] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  [bnd] at org.apache.tools.ant.Task.perform(Task.java:350)
  [bnd] at org.apache.tools.ant.Target.execute(Target.java:449)
  [bnd] at
org.apache.tools.ant.Target.performTasks(Target.java:470)
  [bnd] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
  [bnd] at

org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
  [bnd] at
org.apache.tools.ant.Project.executeTargets(Project.java:1254)
  [bnd] at
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
  [bnd] at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
  [bnd] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  [bnd] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
  [bnd] at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [bnd] at java.lang.reflect.Method.invoke(Method.java:498)
  [bnd] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  [bnd] at org.apache.tools.ant.Task.perform(Task.java:350)
  [bnd] at java.util.Vector.forEach(Vector.java:1249)
  [bnd] at
org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
  [bnd] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  [bnd] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
  [bnd] at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [bnd] at java.lang.reflect.Method.invoke(Method.java:498)
  [bnd] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  [bnd] at org.apache.tools.ant.Task.perform(Task.java:350)
  [bnd] at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
  [bnd] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  [bnd] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
  [bnd] at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [bnd] at java.lang.reflect.Method.invoke(Method.java:498)
  [bnd] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  [bnd] at org.apache.tools.ant.Task.perform(Task.java:350)
  [bnd] at org.apache.tools.ant.Target.execute(Target.java:449)
  [bnd] at
org.apache.tools.ant.Target.performTasks(Target.java:470)
  [bnd] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
  [bnd] at
org.apache.tools.ant.Project.executeTarget(Project.java:1364)
  [bnd] at

org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
  [bnd] at
org.apache.tools.ant.Project.executeTargets(Project.java:1254)
  [bnd] at org.apache.tools.ant.Main.runBuild(Main.java:830)
  [bnd] at org.apache.tools.ant.Main.startAnt(Main.java:223)
  [bnd] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
  [bnd

[tomcat] branch 9.0.x updated: Make `ant -f mvn-pub.xml generic-install` work with the new ant tasks

2020-06-23 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 919183b  Make `ant -f mvn-pub.xml generic-install` work with the new 
ant tasks
919183b is described below

commit 919183b438e1a2f0004082c69e34accc0c3e2f16
Author: Filip Hanik 
AuthorDate: Tue Jun 23 11:11:24 2020 -0700

Make `ant -f mvn-pub.xml generic-install` work with the new ant tasks
---
 res/maven/mvn-pub.xml | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/res/maven/mvn-pub.xml b/res/maven/mvn-pub.xml
index ea504a2..15e9380 100644
--- a/res/maven/mvn-pub.xml
+++ b/res/maven/mvn-pub.xml
@@ -50,8 +50,11 @@
   
 
 
-
+
+  
   
+  
+  
 
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Ensure that the WsContextListener can be added and that reflection works

2020-05-11 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new d5134aa  Ensure that the WsContextListener can be added and that 
reflection works
d5134aa is described below

commit d5134aa0b821041c9f29daebf1b468c79881153c
Author: Filip Hanik 
AuthorDate: Mon May 11 09:49:03 2020 -0700

Ensure that the WsContextListener can be added and that reflection works
---
 res/graal/build-tomcat-native-image.sh   |  4 +++-
 .../native-image/tomcat-reflection.json  | 12 ++--
 test/org/apache/catalina/startup/EmbeddedTomcat.java |  2 ++
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index 0fc94f7..082e129 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -15,6 +15,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -e
+
 CURDIR=`pwd`
 
 # resolve links - $0 may be a softlink
@@ -53,7 +55,7 @@ native-image \
 -H:+ReportExceptionStackTraces \
 --allow-incomplete-classpath \
 --no-fallback \
--cp 
../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar
 \
+-cp 
../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar:../embed/annotations-api.jar
 \
 org.apache.catalina.startup.EmbeddedTomcat
 
 cd $CURDIR
\ No newline at end of file
diff --git 
a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json 
b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
index 5907375..3df91d6 100644
--- a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
@@ -1,8 +1,8 @@
 [
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "methods" 
: [{"name": "","parameterTypes":[] }] },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsContextListener", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsFilter", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"methods":[{"name":"","parameterTypes":[] }] }
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsContextListener", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsFilter", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true }
 ]
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 3fd53e7..b594c5a 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -35,6 +35,7 @@ import org.apache.catalina.connector.Connector;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.scan.StandardJarScanFilter;
 import org.apache.tomcat.util.scan.StandardJarScanner;
+import org.apache.tomcat.websocket.server.WsContextListener;
 
 @Ignore
 public class EmbeddedTomcat {
@@ -66,6 +67,7 @@ public class EmbeddedTomcat {
 CounterServlet counterServlet = new CounterServlet();
 Tomcat.addServlet(ctx, "counterServlet", counterServlet);
 ctx.addServletMappingDecoded("/", "counterServlet");
+ctx.addApplicationListener(WsContextListener.class.getName());
 
 tomcat.start();
 Thread.sleep(60*1000);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Ensure that the WsContextListener can be added and that reflection works

2020-05-11 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new b5dc2dd  Ensure that the WsContextListener can be added and that 
reflection works
b5dc2dd is described below

commit b5dc2dd2396c6cdeaf5a8d422cd659812d0734e7
Author: Filip Hanik 
AuthorDate: Mon May 11 09:49:03 2020 -0700

Ensure that the WsContextListener can be added and that reflection works
---
 res/graal/build-tomcat-native-image.sh   |  4 +++-
 .../native-image/tomcat-reflection.json  | 12 ++--
 test/org/apache/catalina/startup/EmbeddedTomcat.java |  2 ++
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index fc0f26d..cbc0db1 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -15,6 +15,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -e
+
 CURDIR=`pwd`
 
 # resolve links - $0 may be a softlink
@@ -53,7 +55,7 @@ native-image \
 -H:+ReportExceptionStackTraces \
 --allow-incomplete-classpath \
 --no-fallback \
--cp 
../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar
 \
+-cp 
../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar:../embed/annotations-api.jar
 \
 org.apache.catalina.startup.EmbeddedTomcat
 
 cd $CURDIR
\ No newline at end of file
diff --git 
a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json 
b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
index 5907375..3df91d6 100644
--- a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
@@ -1,8 +1,8 @@
 [
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "methods" 
: [{"name": "","parameterTypes":[] }] },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsContextListener", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsFilter", 
"allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"methods":[{"name":"","parameterTypes":[] }] }
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsContextListener", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsFilter", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", 
"allDeclaredConstructors" : true, "allPublicConstructors" : true, 
"allDeclaredMethods" : true, "allPublicMethods" : true }
 ]
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java 
b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 869b707..5658291 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -35,6 +35,7 @@ import org.apache.catalina.connector.Connector;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.scan.StandardJarScanFilter;
 import org.apache.tomcat.util.scan.StandardJarScanner;
+import org.apache.tomcat.websocket.server.

[tomcat] branch 9.0.x updated: Correct paths for building the sample native image

2020-04-28 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 2bd1c77  Correct paths for building the sample native image
2bd1c77 is described below

commit 2bd1c77681df92f96b6ff342371b9ca4cf74cec1
Author: Filip Hanik 
AuthorDate: Tue Apr 28 10:14:50 2020 -0700

Correct paths for building the sample native image
---
 res/graal/build-tomcat-native-image.sh | 2 +-
 res/graal/graal-measure.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index 5fe6a16..0fc94f7 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -33,7 +33,7 @@ done
 PRGDIR=`dirname "$PRG"`
 
 cd $PRGDIR/../..
-ant && ant embed && ant test-compile
+ant clean && ant && ant embed && ant test-compile
 
 mkdir -p output/graal
 cd output/testclasses
diff --git a/res/graal/graal-measure.sh b/res/graal/graal-measure.sh
index 599f1b5..2f2094e 100755
--- a/res/graal/graal-measure.sh
+++ b/res/graal/graal-measure.sh
@@ -36,7 +36,7 @@ done
 # directory of this script
 PRGDIR=`dirname "$PRG"`
 
-EXECUTABLE=${PRGDIR}/output/graal/tc-graal-image
+EXECUTABLE=${PRGDIR}/../../output/graal/tc-graal-image
 
 ./${EXECUTABLE} "$@" 2>&1 &
 PID=$!


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Correct paths for building the sample native image

2020-04-28 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 7a70300  Correct paths for building the sample native image
7a70300 is described below

commit 7a7030022049c445fd47783d85c6fede1c358e00
Author: Filip Hanik 
AuthorDate: Tue Apr 28 10:14:50 2020 -0700

Correct paths for building the sample native image
---
 res/graal/build-tomcat-native-image.sh | 2 +-
 res/graal/graal-measure.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index 7503f2c..fc0f26d 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -33,7 +33,7 @@ done
 PRGDIR=`dirname "$PRG"`
 
 cd $PRGDIR/../..
-ant && ant embed && ant test-compile
+ant clean && ant && ant embed && ant test-compile
 
 mkdir -p output/graal
 cd output/testclasses
diff --git a/res/graal/graal-measure.sh b/res/graal/graal-measure.sh
index 599f1b5..2f2094e 100755
--- a/res/graal/graal-measure.sh
+++ b/res/graal/graal-measure.sh
@@ -36,7 +36,7 @@ done
 # directory of this script
 PRGDIR=`dirname "$PRG"`
 
-EXECUTABLE=${PRGDIR}/output/graal/tc-graal-image
+EXECUTABLE=${PRGDIR}/../../output/graal/tc-graal-image
 
 ./${EXECUTABLE} "$@" 2>&1 &
 PID=$!


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Include Graal configuration files

2020-04-14 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 468b6b4  Include Graal configuration files
468b6b4 is described below

commit 468b6b42c42ad7973388966bd667fecd9f74be7a
Author: Filip Hanik 
AuthorDate: Tue Apr 14 13:53:51 2020 -0700

Include Graal configuration files

for embedded jars so that the native-image compiler picks it up
automatically

Location of Graal native-image files:
META-INF/native-image/groupId/artifactId

https://www.graalvm.org/docs/reference-manual/native-image/
Native Image Configuration

This commit contains a sample embedded application, a script to build
the native image and a script to test the native image for functionality

Known Issues: reflection for JMX has intentionally been left out
---
 build.xml  | 40 --
 res/graal/README.md| 40 ++
 res/graal/build-tomcat-native-image.sh | 59 ++
 res/graal/graal-measure.sh | 58 ++
 .../native-image/native-image.properties   | 16 
 .../native-image/tomcat-reflection.json| 65 
 .../native-image/tomcat-resource.json  | 57 ++
 .../native-image/native-image.properties   | 16 
 .../native-image/tomcat-reflection.json|  3 +
 .../native-image/tomcat-resource.json  | 12 +++
 .../native-image/native-image.properties   | 16 
 .../native-image/tomcat-reflection.json|  2 +
 .../native-image/tomcat-resource.json  | 11 +++
 .../native-image/native-image.properties   | 16 
 .../native-image/tomcat-reflection.json|  8 ++
 .../native-image/tomcat-resource.json  | 13 
 .../apache/catalina/startup/EmbeddedTomcat.java| 91 ++
 17 files changed, 518 insertions(+), 5 deletions(-)

diff --git a/build.xml b/build.xml
index 43f9dff..0f42f21 100644
--- a/build.xml
+++ b/build.xml
@@ -1405,22 +1405,33 @@
filesId="files.tomcat-embed-core"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"
-   addOSGi="true" />
+   addOSGi="true"
+   addGraal="true"
+   graalPrefix="org.apache.tomcat.embed/tomcat-embed-core"
+   graalFiles="res/graal/tomcat-embed-core/native-image"/>
 
+   addOSGi="true"
+   addGraal="true"
+   graalPrefix="org.apache.tomcat.embed/tomcat-embed-jasper"
+   graalFiles="res/graal/tomcat-embed-jasper/native-image"/>
 
+   addOSGi="true"
+   addGraal="true"
+   graalPrefix="org.apache.tomcat.embed/tomcat-embed-el"
+   graalFiles="res/graal/tomcat-embed-el/native-image"/>
 
-
+   addOSGi="true"
+   addGraal="true"
+   graalPrefix="org.apache.tomcat.embed/tomcat-embed-websocket"
+   graalFiles="res/graal/tomcat-embed-websocket/native-image"/>
   
 
   
 
+
+
+
 
   
 
@@ -3373,6 +3390,12 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
 
   
+  
+
+
+
+
+  
 
   
 
@@ -3385,6 +3408,13 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
   
 
+  
+
+
+  
+
+  
+
   
   
   
diff --git a/res/graal/README.md b/res/graal/README.md
new file mode 100644
index 000..717c761
--- /dev/null
+++ b/res/graal/README.md
@@ -0,0 +1,40 @@
+
+
+Introduction
+===
+
+GraalVM is a polyglot virtual machine. In addition to that, it supports Ahead 
of Time,
+AOT, compilation of Java applications into native executable files via its
+[native-image`](https://github.com/oracle/graal/tree/master/substratevm) 
compiler.
+
+Reflection Directives
+===
+
+This directory contains directives to the compiler on what classes use 
reflection.
+These are currently stored in a file called `tomcat-reflection.json` in the 
`META-INF/native-image/groupId/artifactId`
+location.
+
+This directory also contains resource directives, so that resource files 
normally included in a JAR file
+also get compiled into the executable image.
+These are currently stored in a file called `tomcat-resource.json` in the 
`META-INF/native-image/groupId/artifactId`
+location.
+
diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
new file mod

[tomcat] branch 9.0.x updated: Checkstyle adjustments for Graal native AOT files

2020-04-14 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 89012cf  Checkstyle adjustments for Graal native AOT files
89012cf is described below

commit 89012cf4701d73c0997566f1f8413ded0b50cce5
Author: Filip Hanik 
AuthorDate: Tue Apr 14 12:35:55 2020 -0700

Checkstyle adjustments for Graal native AOT files
---
 res/graal/README.md| 34 ++
 res/graal/build-tomcat-native-image.sh | 15 
 res/graal/graal-measure.sh | 15 
 .../native-image/native-image.properties   |  1 +
 .../native-image/native-image.properties   |  1 +
 .../native-image/native-image.properties   |  1 +
 .../native-image/native-image.properties   |  1 +
 .../apache/catalina/startup/EmbeddedTomcat.java| 40 --
 8 files changed, 91 insertions(+), 17 deletions(-)

diff --git a/res/graal/README.md b/res/graal/README.md
index 8446b6b..717c761 100644
--- a/res/graal/README.md
+++ b/res/graal/README.md
@@ -1,18 +1,40 @@
+
+
 Introduction
 ===
 
-GraalVM is a polyglot virtual machine. In addition to that, it supports Ahead 
of Time, AOT, compilation of Java applications 
-into native executable files via its 
[native-image`](https://github.com/oracle/graal/tree/master/substratevm) 
compiler.
+GraalVM is a polyglot virtual machine. In addition to that, it supports Ahead 
of Time,
+AOT, compilation of Java applications into native executable files via its
+[native-image`](https://github.com/oracle/graal/tree/master/substratevm) 
compiler.
 
 Reflection Directives
 ===
 
 This directory contains directives to the compiler on what classes use 
reflection.
-These are currently stored in a file called `tomcat-reflection.json` in the 
`META-INF/native-image/groupId/artifactId` 
+These are currently stored in a file called `tomcat-reflection.json` in the 
`META-INF/native-image/groupId/artifactId`
 location.
 
-This directory also contains resource directives, so that resource files 
normally included in a JAR file 
-also get compiled into the executable image. 
-These are currently stored in a file called `tomcat-resource.json` in the 
`META-INF/native-image/groupId/artifactId` 
+This directory also contains resource directives, so that resource files 
normally included in a JAR file
+also get compiled into the executable image.
+These are currently stored in a file called `tomcat-resource.json` in the 
`META-INF/native-image/groupId/artifactId`
 location.
 
diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index 1a211c9..5fe6a16 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -1,5 +1,20 @@
 #!/bin/bash
 
+# 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.
+
 CURDIR=`pwd`
 
 # resolve links - $0 may be a softlink
diff --git a/res/graal/graal-measure.sh b/res/graal/graal-measure.sh
index 00ea504..599f1b5 100755
--- a/res/graal/graal-measure.sh
+++ b/res/graal/graal-measure.sh
@@ -1,5 +1,20 @@
 #!/bin/bash
 
+# 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.
+
 GREEN='\033[0;32m'
 RED='\033[0;31m'
 NC='\033[0m'
diff --git a/res/graal/tomcat-embed-core/native-image/native-image.properties 
b/

[tomcat] branch 9.0.x updated: Add websocket/el jars to test the native-image files

2020-04-14 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 36031a7  Add websocket/el jars to test the native-image files
36031a7 is described below

commit 36031a7fcd30332d337cecb387d4fc1aa90ef061
Author: Filip Hanik 
AuthorDate: Tue Apr 14 10:14:03 2020 -0700

Add websocket/el jars to test the native-image files

Fix type in the el resource file
---
 res/graal/build-tomcat-native-image.sh  | 2 +-
 res/graal/tomcat-embed-el/native-image/tomcat-resource.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/res/graal/build-tomcat-native-image.sh 
b/res/graal/build-tomcat-native-image.sh
index 592e930..1a211c9 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -38,7 +38,7 @@ native-image \
 -H:+ReportExceptionStackTraces \
 --allow-incomplete-classpath \
 --no-fallback \
--cp ../embed/tomcat-embed-core.jar:tomcat-embedded-sample.jar \
+-cp 
../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar
 \
 org.apache.catalina.startup.EmbeddedTomcat
 
 cd $CURDIR
\ No newline at end of file
diff --git a/res/graal/tomcat-embed-el/native-image/tomcat-resource.json 
b/res/graal/tomcat-embed-el/native-image/tomcat-resource.json
index 55b2fb3..645ff26 100644
--- a/res/graal/tomcat-embed-el/native-image/tomcat-resource.json
+++ b/res/graal/tomcat-embed-el/native-image/tomcat-resource.json
@@ -1,6 +1,6 @@
 {
   "bundles":[
-{"name":"jakarta.el.LocalStrings"},
+{"name":"javax.el.LocalStrings"},
 {"name":"org.apache.el.Messages"}
   ],
   "resources":[


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated (a7c132d -> 6ed7648)

2020-04-13 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

fhanik pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from a7c132d  Add 9.0.34 release date
 new 2e94898  Include Graal configuration files
 new 833625d  Make it known this is not a test class
 new 6ed7648  Merge pull request #274 from 
fhanik/feature/graal-config-files-for-tomcat-9

The 21920 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.xml  | 40 ++--
 res/graal/README.md| 18 ++
 res/graal/build-tomcat-native-image.sh | 44 +
 res/graal/graal-measure.sh | 43 +
 .../native-image/native-image.properties   |  3 +-
 .../native-image/tomcat-reflection.json| 65 +++
 .../native-image}/tomcat-resource.json | 27 +---
 .../native-image/native-image.properties   |  3 +-
 .../native-image/tomcat-reflection.json|  3 +
 .../native-image/tomcat-resource.json  | 12 
 .../native-image/native-image.properties   |  3 +-
 .../native-image/tomcat-reflection.json|  2 +
 .../native-image/tomcat-resource.json  | 11 
 .../native-image/native-image.properties   |  3 +-
 .../native-image/tomcat-reflection.json|  8 +++
 .../native-image/tomcat-resource.json  | 13 
 .../apache/catalina/startup/EmbeddedTomcat.java| 73 ++
 17 files changed, 332 insertions(+), 39 deletions(-)
 create mode 100644 res/graal/README.md
 create mode 100755 res/graal/build-tomcat-native-image.sh
 create mode 100755 res/graal/graal-measure.sh
 copy java/org/apache/catalina/connector/LocalStrings_pt_BR.properties => 
res/graal/tomcat-embed-core/native-image/native-image.properties (85%)
 create mode 100644 
res/graal/tomcat-embed-core/native-image/tomcat-reflection.json
 copy res/{tomcat-maven => 
graal/tomcat-embed-core/native-image}/tomcat-resource.json (64%)
 copy java/org/apache/catalina/connector/LocalStrings_pt_BR.properties => 
res/graal/tomcat-embed-el/native-image/native-image.properties (85%)
 create mode 100644 
res/graal/tomcat-embed-el/native-image/tomcat-reflection.json
 create mode 100644 res/graal/tomcat-embed-el/native-image/tomcat-resource.json
 copy java/org/apache/catalina/connector/LocalStrings_pt_BR.properties => 
res/graal/tomcat-embed-jasper/native-image/native-image.properties (85%)
 create mode 100644 
res/graal/tomcat-embed-jasper/native-image/tomcat-reflection.json
 create mode 100644 
res/graal/tomcat-embed-jasper/native-image/tomcat-resource.json
 copy java/org/apache/catalina/connector/LocalStrings_pt_BR.properties => 
res/graal/tomcat-embed-websocket/native-image/native-image.properties (85%)
 create mode 100644 
res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
 create mode 100644 
res/graal/tomcat-embed-websocket/native-image/tomcat-resource.json
 create mode 100644 test/org/apache/catalina/startup/EmbeddedTomcat.java


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1617355 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

2014-08-11 Thread fhanik
Author: fhanik
Date: Mon Aug 11 19:57:22 2014
New Revision: 1617355

URL: http://svn.apache.org/r1617355
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56318
The weak reference is for the statement itself.

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1617355&r1=1617354&r2=1617355&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 Mon Aug 11 19:57:22 2014
@@ -37,7 +37,7 @@ import org.apache.tomcat.jdbc.pool.Poole
 public class StatementFinalizer extends AbstractCreateStatementInterceptor {
 private static final Log log = LogFactory.getLog(StatementFinalizer.class);
 
-protected List> statements = new 
LinkedList<>();
+protected List statements = new LinkedList<>();
 
 private boolean logCreationStack = false;
 
@@ -45,7 +45,7 @@ public class StatementFinalizer extends 
 public Object createStatement(Object proxy, Method method, Object[] args, 
Object statement, long time) {
 try {
 if (statement instanceof Statement)
-statements.add(new WeakReference<>(new 
StatementEntry((Statement)statement)));
+statements.add(new StatementEntry((Statement)statement));
 }catch (ClassCastException x) {
 //ignore this one
 }
@@ -55,13 +55,13 @@ public class StatementFinalizer extends 
 @Override
 public void closeInvoked() {
 while (statements.size()>0) {
-WeakReference ws = statements.remove(0);
-StatementEntry st = ws.get();
+StatementEntry ws = statements.remove(0);
+Statement st = ws.getStatement();
 boolean shallClose = false;
 try {
-shallClose = st!=null && (!st.getStatement().isClosed());
+shallClose = st!=null && (!st.isClosed());
 if (shallClose) {
-st.getStatement().close();
+st.close();
 }
 } catch (Exception ignore) {
 if (log.isDebugEnabled()) {
@@ -69,7 +69,7 @@ public class StatementFinalizer extends 
 }
 } finally {
 if (logCreationStack && shallClose) {
-log.warn("Statement created, but was not closed at:", 
st.getAllocationStack());
+log.warn("Statement created, but was not closed at:", 
ws.getAllocationStack());
 }
 }
 }
@@ -92,18 +92,18 @@ public class StatementFinalizer extends 
 }
 
 protected class StatementEntry {
-private Statement statement;
-   private Throwable allocationStack;
+private WeakReference statement;
+private Throwable allocationStack;
 
 public StatementEntry(Statement statement) {
-this.statement = statement;
+this.statement = new WeakReference<>(statement);
 if (logCreationStack) {
 this.allocationStack = new Throwable();
 }
 }
 
 public Statement getStatement() {
-return statement;
+return statement.get();
 }
 
 public Throwable getAllocationStack() {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1617042 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

2014-08-09 Thread fhanik
Author: fhanik
Date: Sun Aug 10 01:55:14 2014
New Revision: 1617042

URL: http://svn.apache.org/r1617042
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56318
Only log if statement requires it.

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1617042&r1=1617041&r2=1617042&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 Sun Aug 10 01:55:14 2014
@@ -57,15 +57,18 @@ public class StatementFinalizer extends 
 while (statements.size()>0) {
 WeakReference ws = statements.remove(0);
 StatementEntry st = ws.get();
-if (st!=null) {
-try {
+boolean shallClose = false;
+try {
+shallClose = st!=null && (!st.getStatement().isClosed());
+if (shallClose) {
 st.getStatement().close();
-} catch (Exception ignore) {
-if (log.isDebugEnabled()) {
-log.debug("Unable to closed statement upon connection 
close.",ignore);
-}
 }
-if (logCreationStack) {
+} catch (Exception ignore) {
+if (log.isDebugEnabled()) {
+log.debug("Unable to closed statement upon connection 
close.",ignore);
+}
+} finally {
+if (logCreationStack && shallClose) {
 log.warn("Statement created, but was not closed at:", 
st.getAllocationStack());
 }
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616789 - /tomcat/trunk/modules/jdbc-pool/doc/changelog.xml

2014-08-08 Thread fhanik
Author: fhanik
Date: Fri Aug  8 14:53:06 2014
New Revision: 1616789

URL: http://svn.apache.org/r1616789
Log:
Update changelog with recent fixes

Modified:
tomcat/trunk/modules/jdbc-pool/doc/changelog.xml

Modified: tomcat/trunk/modules/jdbc-pool/doc/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/changelog.xml?rev=1616789&r1=1616788&r2=1616789&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/doc/changelog.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/doc/changelog.xml Fri Aug  8 14:53:06 2014
@@ -28,6 +28,25 @@
   
 
 
+
+
+  
+
+  1616760 54227 Evaluate max age upon borrow 
(fhanik)
+  1616644 56318 Ability to trace statement 
creation in StatementFinalizer (fhanik)
+  1616639 53088 More identifiable thread name 
(fhanik)
+  1616629 56789 getPool() returns the actual 
pool, always (fhanik)
+  1616625 54978 Make sure proper connection 
validation always happens, regardless of config (fhanik)
+  1616602 54537 Performance improvement in 
StatementFinalizer (fhanik)
+  1616599 54395 Fix JDBC interceptor parsing 
bug (fhanik)
+  1616595 54235 Disallow nested pools 
exploitating using data source (fhanik)
+  1616592 54225 Disallow empty init SQL 
(fhanik)
+  1616584 53853 More flexible classloading 
(fhanik)
+  1616570 53200 Selective logging for slow 
versus failed queries (fhanik)
+
+  
+
+
 
   
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616767 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java

2014-08-08 Thread fhanik
Author: fhanik
Date: Fri Aug  8 14:13:50 2014
New Revision: 1616767

URL: http://svn.apache.org/r1616767
Log:
Amendment to r1616759. Thanks markt

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java?rev=1616767&r1=1616766&r2=1616767&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
 Fri Aug  8 14:13:50 2014
@@ -47,11 +47,7 @@ public class ClassLoaderUtil {
 errorMsg.append(";");
 }
 errorMsg.append("ClassLoader:");
-if (cl == null) {
-errorMsg.append("null");
-} else {
-errorMsg.append(cl.toString());
-}
+errorMsg.append(cl);
 }
 if (onlyAttemptFirstLoader) {
 break;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616760 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/ test/java/org/apache/tomcat/jdbc/pool/ test/java/org/apache/tomcat/jdbc/test/

2014-08-08 Thread fhanik
Author: fhanik
Date: Fri Aug  8 14:02:54 2014
New Revision: 1616760

URL: http://svn.apache.org/r1616760
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54227
Proper fix for max age evaluation at time of borrow. It should be done during 
borrow, not during setup. Setup does not perform proper initialization

Rename checkUser, poor name, hard to understand what the return value is

Fix unit test around pool thread renaming

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/ShouldForceReconnectTest.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/PoolCleanerTest.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1616760&r1=1616759&r2=1616760&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 Fri Aug  8 14:02:54 2014
@@ -279,10 +279,6 @@ public class ConnectionPool {
  * @throws SQLException if an interceptor can't be configured, if the 
proxy can't be instantiated
  */
 protected Connection setupConnection(PooledConnection con) throws 
SQLException {
-//check if it's been sitting in the pool too long
-if (con.isMaxAgeExpired()) {
-con.reconnect();
-}
 //fetch previously cached interceptor proxy - one per connection
 JdbcInterceptor handler = con.getHandler();
 if (handler==null) {
@@ -750,30 +746,20 @@ public class ConnectionPool {
 boolean setToNull = false;
 try {
 con.lock();
-boolean usercheck = con.checkUser(username, password);
-
 if (con.isReleased()) {
 return null;
 }
 
+//evaluate username/password change as well as max age 
functionality
+boolean forceReconnect = con.shouldForceReconnect(username, 
password) || con.isMaxAgeExpired();
+
 if (!con.isDiscarded() && !con.isInitialized()) {
-//attempt to connect
-try {
-con.connect();
-} catch (Exception x) {
-release(con);
-setToNull = true;
-if (x instanceof SQLException) {
-throw (SQLException)x;
-} else {
-SQLException ex  = new SQLException(x.getMessage());
-ex.initCause(x);
-throw ex;
-}
-}
+//here it states that the connection not discarded, but the 
connection is null
+//don't attempt a connect here. It will be done during the 
reconnect.
+forceReconnect = true;
 }
 
-if (usercheck) {
+if (!forceReconnect) {
 if ((!con.isDiscarded()) && 
con.validate(PooledConnection.VALIDATE_BORROW)) {
 //set the timestamp
 con.setTimestamp(now);

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1616760&r1=1616759&r2=1616760&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 Fri Aug  8 14:02:54 2014
@@ -134,8 +134,24 @@ public class PooledConnection {
 return connectionVersion;
 }
 
+/**
+ * @deprecated use {@link #shouldForceReconnect(String, String)}
+ * method kept since it was public, to avoid changing interface. name was 
pooo
+ */
 public boolean checkUser(String username, String password) {
-if (!getPoolProperties().isAlternateUsernameAllowed()) return true;
+return !shouldForceReconnect(username, password);
+}
+/**
+ * Returns true if we must force reconnect based on credentials passed in.
+ * Returns false if {@link PoolConfiguration#isAlternateUsernameAllowed()} 
method returns false.
+ * Returns false if the username/password has not changed since this 
connection

svn commit: r1616649 - /tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Fri Aug  8 00:22:51 2014
New Revision: 1616649

URL: http://svn.apache.org/r1616649
Log:
Fix suspect test cases. If validation times out, it should be treated as a 
validation error.

Modified:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java?rev=1616649&r1=1616648&r2=1616649&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java
 Fri Aug  8 00:22:51 2014
@@ -34,6 +34,8 @@ import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor;
 
+import static org.junit.Assert.fail;
+
 public class TestValidationQueryTimeout extends DefaultTestCase {
 
 private static int TIMEOUT = 10;
@@ -131,7 +133,7 @@ public class TestValidationQueryTimeout 
 
 @Test(expected=SQLException.class)
 public void testValidationInvalidOnConnection() throws Exception {
-// use our mock driver
+// use a real driver cause we have an invalid query to validate
 this.datasource.setDriverClassName("org.h2.Driver");
 
this.datasource.setUrl("jdbc:h2:~/.h2/test;QUERY_TIMEOUT=0;DB_CLOSE_ON_EXIT=FALSE");
 
@@ -161,38 +163,31 @@ public class TestValidationQueryTimeout 
 //  this is a requirement for other tests to run properly
 start = System.currentTimeMillis();
 stmt.execute(longQuery);
-} catch (SQLException ex) {}
-finally {
+} catch (SQLTimeoutException ex) {
+
+} catch (SQLException x) {
+fail("We should have got a timeout exception.");  
+} finally {
 end = System.currentTimeMillis();
 
 if (stmt != null) { stmt.close(); }
 if (con != null) { con.close(); }
 
 Assert.assertTrue(start != 0 && end != 0);
-Assert.assertTrue((end - start) > 1000);
+//we're faking it
+//Assert.assertTrue((end - start) > 1000);
 }
 }
 
-@Test
+@Test(expected = SQLException.class)
 public void testValidationQueryTimeoutOnBorrow() throws Exception {
-// use our mock driver
-this.datasource.setDriverClassName("org.h2.Driver");
-
this.datasource.setUrl("jdbc:h2:~/.h2/test;QUERY_TIMEOUT=0;DB_CLOSE_ON_EXIT=FALSE");
-
 // Required to trigger validation query's execution
 this.datasource.setTestOnBorrow(true);
 this.datasource.setValidationInterval(-1);
 this.datasource.setValidationQuery(longQuery);
 this.datasource.setValidationQueryTimeout(1);
-
-// assert that even though the validation query times out, we still 
get a connection
+// assert that even though the validation query we don't get a 
connection
 Connection con = this.datasource.getConnection();
-Assert.assertNotNull(con);
-Statement st = con.createStatement();
-ResultSet rs = st.executeQuery("SELECT 1");
-rs.close();
-st.close();
-con.close();
 }
 
 /**
@@ -261,10 +256,6 @@ public class TestValidationQueryTimeout 
 @Override
 public boolean execute(String sql) throws SQLException {
 if (longQuery.equals(sql)) {
-try {
-Thread.sleep(getQueryTimeout() * 1000);
-}catch (Exception x) {
-}
 throw new SQLTimeoutException();
 } else {
 return super.execute(sql);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616644 - in /tomcat/trunk/modules/jdbc-pool: doc/jdbc-pool.xml src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Fri Aug  8 00:04:51 2014
New Revision: 1616644

URL: http://svn.apache.org/r1616644
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56318
Contribution by Danila Galimov
Ability to log statement creation stacks

Modified:
tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=1616644&r1=1616643&r2=1616644&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Fri Aug  8 00:04:51 2014
@@ -608,6 +608,13 @@
and closes these statements when the connection is returned to the pool.
 
 
+  
+(boolean as String) Enable tracing of unclosed statements. 
+   When enabled and a connection is closed, and statements are not 
closed, 
+   the interceptor will log all stack traces.
+   The default value is false.
+
+  
 
   
   

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1616644&r1=1616643&r2=1616644&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 Fri Aug  8 00:04:51 2014
@@ -19,6 +19,7 @@ package org.apache.tomcat.jdbc.pool.inte
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.jdbc.pool.ConnectionPool;
+import org.apache.tomcat.jdbc.pool.PoolProperties;
 import org.apache.tomcat.jdbc.pool.PooledConnection;
 
 import java.lang.ref.WeakReference;
@@ -26,6 +27,8 @@ import java.lang.reflect.Method;
 import java.sql.Statement;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
+
 /**
  * Keeps track of statements associated with a connection and invokes close 
upon {@link java.sql.Connection#close()}
  * Useful for applications that dont close the associated statements after 
being done with a connection.
@@ -34,13 +37,15 @@ import java.util.List;
 public class StatementFinalizer extends AbstractCreateStatementInterceptor {
 private static final Log log = LogFactory.getLog(StatementFinalizer.class);
 
-protected List> statements = new LinkedList<>();
-
+protected List> statements = new 
LinkedList<>();
+
+private boolean logCreationStack = false;
+
 @Override
 public Object createStatement(Object proxy, Method method, Object[] args, 
Object statement, long time) {
 try {
 if (statement instanceof Statement)
-statements.add(new WeakReference<>((Statement)statement));
+statements.add(new WeakReference<>(new 
StatementEntry((Statement)statement)));
 }catch (ClassCastException x) {
 //ignore this one
 }
@@ -50,25 +55,58 @@ public class StatementFinalizer extends 
 @Override
 public void closeInvoked() {
 while (statements.size()>0) {
-WeakReference ws = statements.remove(0);
-Statement st = ws.get();
+WeakReference ws = statements.remove(0);
+StatementEntry st = ws.get();
 if (st!=null) {
 try {
-st.close();
+st.getStatement().close();
 } catch (Exception ignore) {
 if (log.isDebugEnabled()) {
 log.debug("Unable to closed statement upon connection 
close.",ignore);
 }
 }
+if (logCreationStack) {
+log.warn("Statement created, but was not closed at:", 
st.getAllocationStack());
+}
 }
 }
 }
 
 @Override
+public void setProperties(Map 
properties) {
+super.setProperties(properties);
+
+PoolProperties.InterceptorProperty logProperty = 
properties.get("trace");
+if (null != logProperty) {
+logCreationStack = logProperty.getValueAsBoolean(logCreationStack);
+}
+}
+
+@Override
 public void reset(ConnectionPool parent, PooledConnection con) {
 statements.clear();
 super.reset(parent, con);
 }
 
+protected class StatementEntry {
+private Statement statement;
+   

svn commit: r1616639 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 23:51:55 2014
New Revision: 1616639

URL: http://svn.apache.org/r1616639
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53088
More readable and understandable name

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1616639&r1=1616638&r2=1616639&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 Thu Aug  7 23:51:55 2014
@@ -1283,7 +1283,7 @@ public class ConnectionPool {
 ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
 try {
 
Thread.currentThread().setContextClassLoader(ConnectionPool.class.getClassLoader());
-poolCleanTimer = new Timer("PoolCleaner["+ 
System.identityHashCode(ConnectionPool.class.getClassLoader()) + ":"+
+poolCleanTimer = new Timer("Tomcat JDBC Pool Cleaner["+ 
System.identityHashCode(ConnectionPool.class.getClassLoader()) + ":"+
System.currentTimeMillis() + "]", 
true);
 }finally {
 Thread.currentThread().setContextClassLoader(loader);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616629 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 23:28:19 2014
New Revision: 1616629

URL: http://svn.apache.org/r1616629
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56789
Always return a pool, never null

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java?rev=1616629&r1=1616628&r2=1616629&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java
 Thu Aug  7 23:28:19 2014
@@ -191,7 +191,12 @@ public class DataSourceProxy implements 
 }
 
 public ConnectionPool getPool() {
-return pool;
+try {
+return createPool();
+}catch (SQLException x) {
+log.error("Error during connection pool creation.", x);
+return null;
+}
 }
 
 
@@ -208,7 +213,7 @@ public class DataSourceProxy implements 
 }
 }
 }catch (Exception x) {
-log.warn("Error duing connection pool closure.", x);
+log.warn("Error during connection pool closure.", x);
 }
 }
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616625 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 23:16:14 2014
New Revision: 1616625

URL: http://svn.apache.org/r1616625
Log:
Fixed validation when testOnConnect=false. In this case, we need to verify, do 
we have an init query, if so, do an init validation, otherwise do a borrow 
validation.

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1616625&r1=1616624&r2=1616625&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 Thu Aug  7 23:16:14 2014
@@ -794,7 +794,11 @@ public class ConnectionPool {
 //the connection shouldn't have to poll again.
 try {
 con.reconnect();
-if (con.validate(PooledConnection.VALIDATE_INIT)) {
+int validationMode = getPoolProperties().isTestOnConnect() || 
getPoolProperties().getInitSQL()!=null ? 
+PooledConnection.VALIDATE_INIT : 
+PooledConnection.VALIDATE_BORROW;
+
+if (con.validate(validationMode)) {
 //set the timestamp
 con.setTimestamp(now);
 if (getPoolProperties().isLogAbandoned()) {

Added: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java?rev=1616625&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54978.java
 Thu Aug  7 23:16:14 2014
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.tomcat.jdbc.bugs;
+
+import org.apache.tomcat.jdbc.pool.DataSource;
+import org.apache.tomcat.jdbc.pool.PoolProperties;
+import org.apache.tomcat.jdbc.test.DefaultProperties;
+import org.junit.Test;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+public class Bug54978 {
+
+@Test
+public void testIllegalValidationQuery() throws SQLException, 
InterruptedException {
+PoolProperties poolProperties = new DefaultProperties();
+poolProperties.setMinIdle(0);
+poolProperties.setInitialSize(1);
+poolProperties.setMaxActive(1);
+poolProperties.setMaxWait(5000);
+poolProperties.setMaxAge(100);
+poolProperties.setRemoveAbandoned(false);
+poolProperties.setTestOnBorrow(true);
+poolProperties.setTestOnConnect(false);
+poolProperties.setValidationQuery("sdadsada");
+final DataSource ds = new DataSource(poolProperties);
+try {
+ds.getConnection().close();
+fail("Validation should have failed.");
+}catch (SQLException x) {
+}
+}
+
+@Test
+public void testIllegalValidationQueryWithLegalInit() throws SQLException, 
InterruptedException {
+PoolProperties poolProperties = new DefaultProperties();
+poolProperties.setMinIdle(0);
+poolProperties.setInitialSize(1);
+poolProperties.setMaxActive(1);
+poolProperties.setMaxWait(5000);
+poolProperties.setMaxAge(100);
+poolProperties.setRemoveAbandoned(false);
+poolProperties.setTestOnBorrow(true);
+poolProperties.setTestOnConnect(false);
+poolProperties.setValidationQuery("sdadsada");
+poolProperties.setInitSQL(&q

svn commit: r1616602 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.ja

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 21:47:11 2014
New Revision: 1616602

URL: http://svn.apache.org/r1616602
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54537
Use a linked list to handle O(1) insert and remove operations.

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1616602&r1=1616601&r2=1616602&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
 Thu Aug  7 21:47:11 2014
@@ -16,15 +16,16 @@
  */
 package org.apache.tomcat.jdbc.pool.interceptor;
 
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Method;
-import java.sql.Statement;
-import java.util.ArrayList;
-
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.jdbc.pool.ConnectionPool;
 import org.apache.tomcat.jdbc.pool.PooledConnection;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Method;
+import java.sql.Statement;
+import java.util.LinkedList;
+import java.util.List;
 /**
  * Keeps track of statements associated with a connection and invokes close 
upon {@link java.sql.Connection#close()}
  * Useful for applications that dont close the associated statements after 
being done with a connection.
@@ -33,7 +34,7 @@ import org.apache.tomcat.jdbc.pool.Poole
 public class StatementFinalizer extends AbstractCreateStatementInterceptor {
 private static final Log log = LogFactory.getLog(StatementFinalizer.class);
 
-protected ArrayList> statements = new 
ArrayList<>();
+protected List> statements = new LinkedList<>();
 
 @Override
 public Object createStatement(Object proxy, Method method, Object[] args, 
Object statement, long time) {

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java?rev=1616602&r1=1616601&r2=1616602&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java
 Thu Aug  7 21:47:11 2014
@@ -35,4 +35,22 @@ public class StatementFinalizerTest exte
 con.close();
 Assert.assertTrue("Statement should be closed.",st.isClosed());
 }
+
+
+@Test
+public void testStatementFinalizationForMultiple() throws Exception {
+datasource.setJdbcInterceptors(StatementFinalizer.class.getName());
+Connection con = datasource.getConnection();
+Statement[] statements = new Statement[1000];
+for (int i = 0; i < statements.length; i++) {
+statements[i] = con.createStatement();
+}
+for (Statement st : statements) {
+Assert.assertFalse("Statement should not be closed.", 
st.isClosed());
+}
+con.close();
+for (Statement st : statements) {
+Assert.assertTrue("Statement should be closed.", st.isClosed());
+}
+}
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616599 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java test/java/org/apache/tomcat/jdbc/test/TestJdbcInterceptorConfigParsing.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 21:32:27 2014
New Revision: 1616599

URL: http://svn.apache.org/r1616599
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54395
Fix JdbcInterceptor parsing

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestJdbcInterceptorConfigParsing.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=1616599&r1=1616598&r2=1616599&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 Thu Aug  7 21:32:27 2014
@@ -481,7 +481,7 @@ public class PoolProperties implements P
 } else {
 String name = 
interceptorValues[i].substring(0,propIndex).trim();
 definitions[i+1] = new InterceptorDefinition(name);
-String propsAsString = 
interceptorValues[i].substring(propIndex+1, interceptorValues[i].length()-1);
+String propsAsString = 
interceptorValues[i].substring(propIndex+1, endIndex);
 String[] props = propsAsString.split(",");
 for (int j=0; jhttp://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestJdbcInterceptorConfigParsing.java?rev=1616599&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestJdbcInterceptorConfigParsing.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestJdbcInterceptorConfigParsing.java
 Thu Aug  7 21:32:27 2014
@@ -0,0 +1,178 @@
+/*
+ * 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.
+ */
+package org.apache.tomcat.jdbc.test;
+
+import org.apache.tomcat.jdbc.pool.PoolProperties;
+import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorDefinition;
+import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorProperty;
+import org.apache.tomcat.jdbc.pool.TrapException;
+import org.junit.Test;
+
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+/**
+ * Test of JdbcInterceptor configuration parsing in the
+ * {@link org.apache.tomcat.jdbc.pool.PoolProperties PoolProperties} class.
+ * Added in context of bug 54395.
+ */
+public class TestJdbcInterceptorConfigParsing {
+
+@Test
+public void testBasic() throws Exception {
+String interceptorConfig = 
"FirstInterceptor;SecondInterceptor(parm1=value1,parm2=value2)";
+PoolProperties props = new PoolProperties();
+props.setJdbcInterceptors(interceptorConfig);
+InterceptorDefinition[] interceptorDefs = 
props.getJdbcInterceptorsAsArray();
+assertNotNull(interceptorDefs);
+
+// 3 items because parser automatically inserts TrapException 
interceptor to front of list
+assertEquals(interceptorDefs.length, 3);
+assertEquals(interceptorDefs[0].getClassName(), 
TrapException.class.getName());
+
+assertNotNull(interceptorDefs[1]);
+assertEquals(interceptorDefs[1].getClassName(), "FirstInterceptor");
+assertNotNull(interceptorDefs[2]);
+assertEquals(interceptorDefs[2].getClassName(), "SecondInterceptor");
+
+Map secondProps = 
interceptorDefs[2].getProperties();
+assertNotNull(secondProps);
+assertEquals(secondProps.size(), 2);
+assertNotNull(secondProps.get("parm1"));
+assertEquals(secondProps.get("parm1").getValue(), "value1");
+assertNotNull(secondProps.get("parm2

svn commit: r1616595 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 21:08:59 2014
New Revision: 1616595

URL: http://svn.apache.org/r1616595
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54235
Make sure misconfigurations can not happen.

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=1616595&r1=1616594&r2=1616595&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 Thu Aug  7 21:08:59 2014
@@ -1144,6 +1144,9 @@ public class PoolProperties implements P
  */
 @Override
 public void setDataSource(Object ds) {
+if (ds instanceof DataSourceProxy) {
+throw new IllegalArgumentException("Layered pools are not 
allowed.");
+}
 this.dataSource = ds;
 }
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616594 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java test/java/org/apach

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 21:04:11 2014
New Revision: 1616594

URL: http://svn.apache.org/r1616594
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54227
MaxAge should be honored upon borrow as well, to assure that no connection is 
ever used if it has been connected longer than designated time.

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54227.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1616594&r1=1616593&r2=1616594&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 Thu Aug  7 21:04:11 2014
@@ -279,6 +279,10 @@ public class ConnectionPool {
  * @throws SQLException if an interceptor can't be configured, if the 
proxy can't be instantiated
  */
 protected Connection setupConnection(PooledConnection con) throws 
SQLException {
+//check if it's been sitting in the pool too long
+if (con.isMaxAgeExpired()) {
+con.reconnect();
+}
 //fetch previously cached interceptor proxy - one per connection
 JdbcInterceptor handler = con.getHandler();
 if (handler==null) {
@@ -862,11 +866,8 @@ public class ConnectionPool {
 if (isClosed()) return true;
 if (!con.validate(action)) return true;
 if (!terminateTransaction(con)) return true;
-if (getPoolProperties().getMaxAge()>0 ) {
-return (System.currentTimeMillis()-con.getLastConnected()) > 
getPoolProperties().getMaxAge();
-} else {
-return false;
-}
+if (con.isMaxAgeExpired()) return true;
+else return false;
 }
 
 /**

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1616594&r1=1616593&r2=1616594&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 Thu Aug  7 21:04:11 2014
@@ -318,6 +318,19 @@ public class PooledConnection {
 }
 
 /**
+ * Returns true if the connection has been connected more than 
+ * {@link PoolConfiguration#getMaxAge()} milliseconds. false otherwise.
+ * @return Returns true if the connection has been connected more than 
+ * {@link PoolConfiguration#getMaxAge()} milliseconds. false otherwise.
+ */
+public boolean isMaxAgeExpired() {
+if (getPoolProperties().getMaxAge()>0 ) {
+return (System.currentTimeMillis() - getLastConnected()) > 
getPoolProperties().getMaxAge();
+} else {
+return false;
+}
+}
+/**
  * Issues a call to {@link #disconnect(boolean)} with the argument false 
followed by a call to
  * {@link #connect()}
  * @throws SQLException if the call to {@link #connect()} fails.

Added: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54227.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54227.java?rev=1616594&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54227.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54227.java
 Thu Aug  7 21:04:11 2014
@@ -0,0 +1,65 @@
+/*
+ * 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 W

svn commit: r1616592 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 20:31:19 2014
New Revision: 1616592

URL: http://svn.apache.org/r1616592
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54225
Don't allow empty strings as initSQL

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=1616592&r1=1616591&r2=1616592&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 Thu Aug  7 20:31:19 2014
@@ -791,7 +791,7 @@ public class PoolProperties implements P
 
 @Override
 public void setInitSQL(String initSQL) {
-this.initSQL = initSQL;
+this.initSQL = initSQL!=null && initSQL.trim().length()>0 ? initSQL : 
null;
 }
 
 /**

Added: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java?rev=1616592&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java
 Thu Aug  7 20:31:19 2014
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.apache.tomcat.jdbc.bugs;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import org.apache.tomcat.jdbc.pool.ConnectionPool;
+import org.apache.tomcat.jdbc.pool.DataSource;
+import org.apache.tomcat.jdbc.pool.PoolExhaustedException;
+import org.apache.tomcat.jdbc.pool.PoolProperties;
+import org.apache.tomcat.jdbc.test.DefaultProperties;
+
+import static org.junit.Assert.assertNull;
+
+@RunWith(Parameterized.class)
+public class Bug54225 {
+
+private String initSQL;
+
+public Bug54225(String initSQL) {
+this.initSQL = initSQL;
+}
+
+@Parameterized.Parameters
+public static Collection parameters() {
+return Arrays.asList(new Object[][]{
+new Object[] {""},
+new Object[] {null},
+});
+}
+
+@Test
+public void testPool() throws SQLException, InterruptedException {
+PoolProperties poolProperties = new DefaultProperties();
+poolProperties.setMinIdle(0);
+poolProperties.setInitialSize(0);
+poolProperties.setMaxWait(5000);
+poolProperties.setRemoveAbandoned(true);
+poolProperties.setRemoveAbandonedTimeout(300);
+poolProperties.setRollbackOnReturn(true);
+poolProperties.setInitSQL(initSQL);
+final DataSource ds = new DataSource(poolProperties);
+ds.getConnection().close();
+assertNull(poolProperties.getInitSQL());
+}
+}
\ No newline at end of file

Propchange: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug54225.java
--
svn:eol-style = native



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616584 - in /tomcat/trunk/modules/jdbc-pool: doc/ src/main/java/org/apache/tomcat/jdbc/naming/ src/main/java/org/apache/tomcat/jdbc/pool/

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 20:15:19 2014
New Revision: 1616584

URL: http://svn.apache.org/r1616584
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53853
Dynamic class loading of driver, validator and interceptors can be done from 
libraries on the context class loader. Behavior is partly backwards compatible, 
always try the current loader first, but then attempts the current thread's 
context class loader

Added:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
   (with props)
Modified:
tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=1616584&r1=1616583&r2=1616584&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Thu Aug  7 20:15:19 2014
@@ -170,6 +170,22 @@
   
 
   
+  
+  
+System properties are JVM wide, affect all pools created in the JVM
+
+  
+(boolean) Controls classloading of dynamic classes, such as 
+   jdbc drivers, interceptors and validators. If set to false, default 
value, 
+   the pool will first attempt to load using the current loader and if 
class loading fails
+   attempt to load using the thread context loader.
+   Set this value to try, if you wish to remain backwards compatible, 
+   Apache Tomcat 8.0.8 and earlier, and only attempt the current 
loader.
+   If not set then the default value is false.)
+
+  
+
+  
 
   
   These attributes are shared between commons-dbcp and tomcat-jdbc-pool, in 
some cases default values are different.

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java?rev=1616584&r1=1616583&r2=1616584&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 Thu Aug  7 20:15:19 2014
@@ -31,6 +31,8 @@ import javax.naming.spi.ObjectFactory;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.jdbc.pool.ClassLoaderUtil;
+
 /**
  * Simple way of configuring generic resources by using reflection.
  * Example usage:
@@ -57,7 +59,12 @@ public class GenericNamingResourcesFacto
 Enumeration refs = ref.getAll();
 
 String type = ref.getClassName();
-Object o = Class.forName(type).newInstance();
+Object o = 
+ClassLoaderUtil.loadClass(
+type,
+GenericNamingResourcesFactory.class.getClassLoader(),
+Thread.currentThread().getContextClassLoader())
+.newInstance();
 
 while (refs.hasMoreElements()) {
 RefAddr addr = refs.nextElement();

Added: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java?rev=1616584&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
 Thu Aug  7 20:15:19 2014
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ 

svn commit: r1616570 - in /tomcat/trunk/modules/jdbc-pool: doc/jdbc-pool.xml src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 19:20:00 2014
New Revision: 1616570

URL: http://svn.apache.org/r1616570
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53200
Enable selective logging of slow/failed queries

Modified:
tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java

Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=1616570&r1=1616569&r2=1616570&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Thu Aug  7 19:20:00 2014
@@ -658,6 +658,16 @@
The default value is 1000.
 
   
+  
+(boolean as String) Set to true if you wish to log slow queries
+The default value is true.
+
+  
+  
+(boolean as String) Set to true if you wish to log slow queries
+The default value is true.
+
+  
 
   
   

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=1616570&r1=1616569&r2=1616570&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
 Thu Aug  7 19:20:00 2014
@@ -58,6 +58,16 @@ public class SlowQueryReport extends Abs
 protected int  maxQueries= 1000; //don't store more than this amount of 
queries
 
 /**
+ * Flag to enable disable logging of slow queries
+ */
+protected boolean logSlow = true;
+
+/**
+ * Flag to enable disable logging of failed queries
+ */
+protected boolean logFailed = true;
+
+/**
  * Returns the query stats for a given pool
  * @param poolname - the name of the pool we want to retrieve stats for
  * @return a hash map containing statistics for 0 to maxQueries
@@ -86,7 +96,7 @@ public class SlowQueryReport extends Abs
 long delta = now - start;
 QueryStats qs = this.getQueryStats(sql);
 qs.failure(delta, now);
-if (log.isWarnEnabled()) {
+if (isLogFailed() && log.isWarnEnabled()) {
 log.warn("Failed Query Report SQL="+sql+"; time="+delta+" 
ms;");
 }
 }
@@ -99,7 +109,7 @@ public class SlowQueryReport extends Abs
 if (this.maxQueries > 0 ) {
 QueryStats qs = this.getQueryStats(sql);
 qs.add(delta, start);
-if (log.isWarnEnabled()) {
+if (isLogSlow() && log.isWarnEnabled()) {
 log.warn("Slow Query Report SQL="+sql+"; time="+delta+" ms;");
 }
 }
@@ -199,19 +209,45 @@ public class SlowQueryReport extends Abs
 }
 
 
+public boolean isLogSlow() {
+return logSlow;
+}
+
+public void setLogSlow(boolean logSlow) {
+this.logSlow = logSlow;
+}
+
+public boolean isLogFailed() {
+return logFailed;
+}
+
+public void setLogFailed(boolean logFailed) {
+this.logFailed = logFailed;
+}
+
 @Override
 public void setProperties(Map properties) {
 super.setProperties(properties);
 final String threshold = "threshold";
 final String maxqueries= "maxQueries";
+final String logslow = "logSlow";
+final String logfailed = "logFailed";
 InterceptorProperty p1 = properties.get(threshold);
 InterceptorProperty p2 = properties.get(maxqueries);
+InterceptorProperty p3 = properties.get(logSlow);
+InterceptorProperty p4 = properties.get(logfailed);
 if (p1!=null) {
 setThreshold(Long.parseLong(p1.getValue()));
 }
 if (p2!=null) {
 setMaxQueries(Integer.parseInt(p2.getValue()));
 }
+if (p3!=null) {
+setLogSlow(Boolean.getBoolean(p3.getValue()));
+}
+if (p4!=null) {
+setLogFailed(Boolean.getBoolean(p4.getValue()));
+}
 }
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616569 - in /tomcat/trunk/modules/jdbc-pool: build.properties.default pom.xml src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 19:07:21 2014
New Revision: 1616569

URL: http://svn.apache.org/r1616569
Log:
Clean up dependencies and advance snapshot version

Modified:
tomcat/trunk/modules/jdbc-pool/build.properties.default
tomcat/trunk/modules/jdbc-pool/pom.xml

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java

Modified: tomcat/trunk/modules/jdbc-pool/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.properties.default?rev=1616569&r1=1616568&r2=1616569&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/build.properties.default (original)
+++ tomcat/trunk/modules/jdbc-pool/build.properties.default Thu Aug  7 19:07:21 
2014
@@ -75,23 +75,15 @@ hamcrest.home=${base.path}/hamcrest-${ha
 hamcrest.jar=${hamcrest.home}/hamcrest-core-${hamcrest.version}.jar
 
hamcrest.loc=http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/${hamcrest.version}/hamcrest-core-${hamcrest.version}.jar
 
-c3p0.home=${base.path}/c3p0-0.9.1.2
-c3p0.jar=${c3p0.home}/lib/c3p0-0.9.1.2.jar
-c3p0.loc=http://superb-east.dl.sourceforge.net/sourceforge/c3p0/c3p0-0.9.1.2.bin.zip
-
 mysql.home=${base.path}/mysql-connector-java-5.1.12
 mysql.jar=${mysql.home}/mysql-connector-java-5.1.12-bin.jar
 
mysql.loc=http://mysql.mirrors.hoobly.com/Downloads/Connector-J/mysql-connector-java-5.1.12.zip
 
-dbcp.home=${base.path}/commons-dbcp-1.3
-dbcp.jar=${dbcp.home}/commons-dbcp-1.3.jar
-dbcp.loc=http://archive.apache.org/dist/commons/dbcp/binaries/commons-dbcp-1.3.zip
-
-tomcat.version=6.0.32
+tomcat.version=8.0.9
 tomcat.home=${base.path}/apache-tomcat-${tomcat.version}
 tomcat.dbcp.jar=${tomcat.home}/lib/tomcat-dbcp.jar
 tomcat.juli.jar=${tomcat.home}/bin/tomcat-juli.jar
-tomcat.loc=http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip
+tomcat.loc=http://archive.apache.org/dist/tomcat/tomcat-8/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip
 
 
tomcat.project.loc=http://svn.apache.org/repos/asf/tomcat/trunk/webapps/docs/project.xml
 tomcat.project.dest=${base.path}/project.xml

Modified: tomcat/trunk/modules/jdbc-pool/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/pom.xml?rev=1616569&r1=1616568&r2=1616569&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/pom.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/pom.xml Thu Aug  7 19:07:21 2014
@@ -27,7 +27,7 @@
 
   org.apache.tomcat
   jdbc-pool
-  1.2-SNAPSHOT
+  1.3-SNAPSHOT
   jar
 
   jdbc-pool
@@ -72,8 +72,8 @@
 
 
   org.apache.tomcat
-  dbcp
-  6.0.32
+  tomcat-dbcp
+  8.0.9
   test
 
 

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java?rev=1616569&r1=1616568&r2=1616569&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
 Thu Aug  7 19:07:21 2014
@@ -24,16 +24,11 @@ import java.util.Properties;
 import org.junit.After;
 import org.junit.Before;
 
-//import org.apache.commons.dbcp2.BasicDataSource;
-//import org.apache.commons.dbcp2.BasicDataSourceFactory;
 import org.apache.tomcat.dbcp.dbcp2.BasicDataSource;
 import org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory;
 import org.apache.tomcat.jdbc.pool.PoolConfiguration;
 import org.apache.tomcat.jdbc.pool.PoolProperties;
 
-//import com.mchange.v2.c3p0.ComboPooledDataSource;
-//import com.mchange.v2.log.MLevel;
-//import com.mchange.v2.log.MLog;
 
 /**
  * @version 1.0



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1616562 - /tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java

2014-08-07 Thread fhanik
Author: fhanik
Date: Thu Aug  7 18:31:49 2014
New Revision: 1616562

URL: http://svn.apache.org/r1616562
Log:
Add in test for different possible configurations using the RemoteIpValve
More complex expressions like 172/12 can be supported


Modified:
tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java?rev=1616562&r1=1616561&r2=1616562&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java Thu Aug 
 7 18:31:49 2014
@@ -319,6 +319,85 @@ public class TestRemoteIpValve {
 }
 
 @Test
+public void test172dash12InternalProxies() throws Exception {
+
+// PREPARE
+RemoteIpValve remoteIpValve = new RemoteIpValve();
+
remoteIpValve.setInternalProxies("172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}");
+remoteIpValve.setRemoteIpHeader("x-forwarded-for");
+remoteIpValve.setProtocolHeader("x-forwarded-proto");
+RemoteAddrAndHostTrackerValve remoteAddrAndHostTrackerValve = new 
RemoteAddrAndHostTrackerValve();
+remoteIpValve.setNext(remoteAddrAndHostTrackerValve);
+
+Request request = new MockRequest();
+request.setCoyoteRequest(new org.apache.coyote.Request());
+request.setRemoteAddr("172.16.0.5");
+request.setRemoteHost("remote-host-original-value");
+
request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-for").setString("209.244.0.3");
+
request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-proto").setString("https");
+
+// TEST
+remoteIpValve.invoke(request, null);
+
+// VERIFY
+String actualXForwardedFor = request.getHeader("x-forwarded-for");
+assertNull("all proxies are trusted, x-forwarded-for must be null", 
actualXForwardedFor);
+
+String actualRemoteAddr = 
remoteAddrAndHostTrackerValve.getRemoteAddr();
+assertEquals("remoteAddr", "209.244.0.3", actualRemoteAddr);
+
+String actualRemoteHost = 
remoteAddrAndHostTrackerValve.getRemoteHost();
+assertEquals("remoteHost", "209.244.0.3", actualRemoteHost);
+
+String actualPostInvokeRemoteAddr = 
remoteAddrAndHostTrackerValve.getRemoteAddr();
+assertEquals("postInvoke remoteAddr", "209.244.0.3", 
actualPostInvokeRemoteAddr);
+
+String actualPostInvokeRemoteHost = request.getRemoteHost();
+assertEquals("postInvoke remoteAddr", "remote-host-original-value", 
actualPostInvokeRemoteHost);
+
+boolean isSecure = remoteAddrAndHostTrackerValve.isSecure();
+assertTrue("request from internal proxy should be marked secure", 
isSecure);
+
+String scheme = remoteAddrAndHostTrackerValve.getScheme();
+assertEquals("Scheme should be marked to https.","https",scheme);
+
+request = new MockRequest();
+request.setCoyoteRequest(new org.apache.coyote.Request());
+request.setRemoteAddr("172.25.250.250");
+request.setRemoteHost("remote-host-original-value");
+
request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-for").setString("209.244.0.3");
+
request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-proto").setString("https");
+
+// TEST
+remoteIpValve.invoke(request, null);
+
+// VERIFY
+actualXForwardedFor = request.getHeader("x-forwarded-for");
+assertNull("all proxies are trusted, x-forwarded-for must be null", 
actualXForwardedFor);
+
+actualRemoteAddr = remoteAddrAndHostTrackerValve.getRemoteAddr();
+assertEquals("remoteAddr", "209.244.0.3", actualRemoteAddr);
+
+actualRemoteHost = remoteAddrAndHostTrackerValve.getRemoteHost();
+assertEquals("remoteHost", "209.244.0.3", actualRemoteHost);
+
+actualPostInvokeRemoteAddr = 
remoteAddrAndHostTrackerValve.getRemoteAddr();
+assertEquals("postInvoke remoteAddr", "209.244.0.3", 
actualPostInvokeRemoteAddr);
+
+actualPostInvokeRemoteHost = request.getRemoteHost();
+assertEquals("postInvoke remoteAddr", "remote-host-original-value", 
actualPostInvokeRemoteHost);
+
+isSecure = remoteAddrAndHostT

svn commit: r1613137 - in /tomcat/tc7.0.x/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 14:00:38 2014
New Revision: 1613137

URL: http://svn.apache.org/r1613137
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
Fix interrupt handling in the FairBlockingQueue

Added:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
   (with props)
Modified:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java?rev=1613137&r1=1613136&r2=1613137&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 Thu Jul 24 14:00:38 2014
@@ -148,14 +148,36 @@ public class FairBlockingQueue implem
 //unlock the global lock
 lock.unlock();
 //wait for the specified timeout
-if (!c.await(timeout, unit)) {
-//if we timed out, remove ourselves from the waitlist
+boolean didtimeout = true;
+InterruptedException interruptedException = null;
+try {
+//wait for the specified timeout
+didtimeout = !c.await(timeout, unit);
+} catch (InterruptedException ix) {
+interruptedException = ix;
+}
+if (didtimeout) {
+//if we timed out, or got interrupted
+// remove ourselves from the waitlist
 lock.lock();
-waiters.remove(c);
-lock.unlock();
+try {
+waiters.remove(c);
+} finally {
+lock.unlock();
+}
 }
 //return the item we received, can be null if we timed out
 result = c.getItem();
+if (null!=interruptedException) {
+//we got interrupted
+if (null!=result) {
+//we got a result - clear the interrupt status
+//don't propagate cause we have removed a connection 
from pool
+Thread.interrupted();
+} else {
+throw interruptedException;
+}
+}
 } else {
 //we have an object, release
 lock.unlock();

Added: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java?rev=1613137&view=auto
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
 (added)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
 Thu Jul 24 14:00:38 2014
@@ -0,0 +1,163 @@
+package org.apache.tomcat.jdbc.bugs;
+
+
+
+import org.apache.tomcat.jdbc.test.DefaultProperties;
+import org.junit.Assert;
+import org.apache.tomcat.jdbc.pool.ConnectionPool;
+import org.apache.tomcat.jdbc.pool.DataSource;
+import org.apache.tomcat.jdbc.pool.PoolExhaustedException;
+import org.apache.tomcat.jdbc.pool.PoolProperties;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.ArrayBlockingQueue;
+
+@RunWith(Parameterized.class)
+public class Bug53367 {
+
+private boolean fairQueue;
+
+public Bug53367(boolean fair) {
+this.fairQueue = fair;
+}
+
+@Parameterized.Parameters
+public static Collection parameters() {
+return Arrays.asList(new Object[][]{
+new Object[] {Boolean.TRUE},
+new Object[] {Boolean.FALSE},
+});
+}
+
+@Test
+public void testPool() throws SQLException, InterruptedException {
+DriverManager.setLoginTimeout(1);
+PoolProperties poolProperties = new DefaultProperties();
+int threadsCount = 3;
+poolProperties.setMaxActive(threadsCount);
+poolProperties.se

svn commit: r1613135 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 13:50:23 2014
New Revision: 1613135

URL: http://svn.apache.org/r1613135
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
Assume error until proven otherwise

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java?rev=1613135&r1=1613134&r2=1613135&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 Thu Jul 24 13:50:23 2014
@@ -145,7 +145,7 @@ public class FairBlockingQueue implem
 waiters.addLast(c);
 //unlock the global lock
 lock.unlock();
-boolean didtimeout = false;
+boolean didtimeout = true;
 InterruptedException interruptedException = null;
 try {
 //wait for the specified timeout
@@ -174,7 +174,7 @@ public class FairBlockingQueue implem
 } else {
 throw interruptedException;
 }
-} 
+}
 } else {
 //we have an object, release
 lock.unlock();



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1613123 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 13:42:38 2014
New Revision: 1613123

URL: http://svn.apache.org/r1613123
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
Properly handle interrupts in the FairBlockingQueue

https://issues.apache.org/bugzilla/show_bug.cgi?id=53367

Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java?rev=1613123&r1=1613122&r2=1613123&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
 Thu Jul 24 13:42:38 2014
@@ -133,9 +133,9 @@ public class FairBlockingQueue implem
 public E poll(long timeout, TimeUnit unit) throws InterruptedException {
 E result = null;
 final ReentrantLock lock = this.lock;
+//acquire the global lock until we know what to do
+lock.lock();
 try {
-//acquire the global lock until we know what to do
-lock.lock();
 //check to see if we have objects
 result = items.poll();
 if (result==null && timeout>0) {
@@ -145,15 +145,36 @@ public class FairBlockingQueue implem
 waiters.addLast(c);
 //unlock the global lock
 lock.unlock();
-//wait for the specified timeout
-if (!c.await(timeout, unit)) {
-//if we timed out, remove ourselves from the waitlist
+boolean didtimeout = false;
+InterruptedException interruptedException = null;
+try {
+//wait for the specified timeout
+didtimeout = !c.await(timeout, unit);
+} catch (InterruptedException ix) {
+interruptedException = ix;
+}
+if (didtimeout) {
+//if we timed out, or got interrupted
+// remove ourselves from the waitlist
 lock.lock();
-waiters.remove(c);
-lock.unlock();
+try {
+waiters.remove(c);
+} finally {
+lock.unlock();
+}
 }
 //return the item we received, can be null if we timed out
 result = c.getItem();
+if (null!=interruptedException) {
+//we got interrupted
+if ( null!=result) {
+//we got a result - clear the interrupt status
+//don't propagate cause we have removed a connection 
from pool
+Thread.interrupted();
+} else {
+throw interruptedException;
+}
+} 
 } else {
 //we have an object, release
 lock.unlock();
@@ -173,20 +194,20 @@ public class FairBlockingQueue implem
 public Future pollAsync() {
 Future result = null;
 final ReentrantLock lock = this.lock;
+//grab the global lock
+lock.lock();
 try {
-//grab the global lock
-lock.lock();
 //check to see if we have objects in the queue
 E item = items.poll();
 if (item==null) {
 //queue is empty, add ourselves as waiters
-ExchangeCountDownLatch c = new ExchangeCountDownLatch<>(1);
+ExchangeCountDownLatch c = new ExchangeCountDownLatch(1);
 waiters.addLast(c);
 //return a future that will wait for the object
-result = new ItemFuture<>(c);
+result = new ItemFuture(c);
 } else {
 //return a future with the item
-result = new ItemFuture<>(item);
+result = new ItemFuture(item);
 }
 } finally {
 lock.unlock();

Added: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug53367.java?rev=1613123&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug

svn commit: r1613112 - /tomcat/trunk/modules/jdbc-pool/pom.xml

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 13:18:06 2014
New Revision: 1613112

URL: http://svn.apache.org/r1613112
Log:
Code depends on DBCP2 from Tomcat

Modified:
tomcat/trunk/modules/jdbc-pool/pom.xml

Modified: tomcat/trunk/modules/jdbc-pool/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/pom.xml?rev=1613112&r1=1613111&r2=1613112&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/pom.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/pom.xml Thu Jul 24 13:18:06 2014
@@ -82,6 +82,12 @@
   1.3.152
   test
 
+
+  org.apache.tomcat
+  tomcat-dbcp
+  8.0.9
+  test
+
   
   
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1613111 - in /tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test: TestSlowQueryReport.java TestValidationQueryTimeout.java

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 13:17:46 2014
New Revision: 1613111

URL: http://svn.apache.org/r1613111
Log:
Make tests pass by properly using the mock objects and not rely on a pre 
existing table.

Modified:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestSlowQueryReport.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestSlowQueryReport.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestSlowQueryReport.java?rev=1613111&r1=1613110&r2=1613111&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestSlowQueryReport.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestSlowQueryReport.java
 Thu Jul 24 13:17:46 2014
@@ -19,17 +19,25 @@ package org.apache.tomcat.jdbc.test;
 import java.lang.management.ManagementFactory;
 import java.sql.CallableStatement;
 import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.DriverPropertyInfo;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLTimeoutException;
 import java.sql.Statement;
 import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Logger;
 
 import javax.management.AttributeChangeNotification;
 import javax.management.Notification;
 import javax.management.NotificationListener;
 
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.ConnectionPool;
@@ -37,18 +45,34 @@ import org.apache.tomcat.jdbc.pool.inter
 import org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx;
 
 public class TestSlowQueryReport extends DefaultTestCase {
+public static final String superSlowSql = "select count(1) from test where 
val1 like 'ewq%eq' and val2 = 'ew%rre' and val3 = 'sda%da' and val4 = 
'dad%ada'";
+public static final String failedSql = "select 1 from non_existent";
+@Before
+public void setUp() throws SQLException {
+DriverManager.registerDriver(new MockDriver());
+
+// use our mock driver
+this.datasource.setDriverClassName(MockDriver.class.getName());
+this.datasource.setUrl(MockDriver.url);
+
+// Required to trigger validation query's execution
+this.datasource.setInitialSize(1);
+this.datasource.setTestOnBorrow(true);
+this.datasource.setValidationInterval(-1);
+this.datasource.setValidationQuery("SELECT 1");
+this.datasource.setMaxActive(1);
+
this.datasource.setJdbcInterceptors(SlowQueryReportJmx.class.getName()+"(threshold=50,notifyPool=false)");
+}
 
 @Test
 public void testSlowSql() throws Exception {
 int count = 3;
-this.init();
 this.datasource.setMaxActive(1);
 
this.datasource.setJdbcInterceptors(SlowQueryReport.class.getName()+"(threshold=50)");
 Connection con = this.datasource.getConnection();
-String slowSql = "select count(1) from test where val1 like 'ewq%eq' 
and val2 = 'ew%rre' and val3 = 'sda%da' and val4 = 'dad%ada'";
 for (int i=0; i map = 
SlowQueryReport.getPoolStats(datasource.getPool().getName());
 Assert.assertNotNull(map);
@@ -208,5 +220,118 @@ public class TestSlowQueryReport extends
 }
 }
 
+/**
+ * Mock Driver, Connection and Statement implementations use to verify 
setQueryTimeout was called.
+ */
+public static class MockDriver implements java.sql.Driver {
+public static final String url = "jdbc:tomcat:mock";
+
+public MockDriver() {
+}
+
+@Override
+public boolean acceptsURL(String url) throws SQLException {
+return url!=null && url.equals(MockDriver.url);
+}
+
+@Override
+public Connection connect(String url, Properties info) throws 
SQLException {
+return new MockConnection(info);
+}
+
+@Override
+public int getMajorVersion() {
+return 0;
+}
+
+@Override
+public int getMinorVersion() {
+return 0;
+}
+
+@Override
+public DriverPropertyInfo[] getPropertyInfo(String url, Properties 
info) throws SQLException {
+return null;
+}
+
+@Override
+public boolean jdbcCompliant() {
+return false;
+}
+
+@Override
+

svn commit: r1613066 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

2014-07-24 Thread fhanik
Author: fhanik
Date: Thu Jul 24 10:57:26 2014
New Revision: 1613066

URL: http://svn.apache.org/r1613066
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53198
driverClassName should not be mandatory
https://issues.apache.org/bugzilla/show_bug.cgi?id=53198

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1613066&r1=1613065&r2=1613066&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 Thu Jul 24 10:57:26 2014
@@ -17,6 +17,7 @@
 package org.apache.tomcat.jdbc.pool;
 
 
+import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.HashMap;
@@ -242,9 +243,13 @@ public class PooledConnection {
 if (log.isDebugEnabled()) {
 log.debug("Instantiating driver using class: 
"+poolProperties.getDriverClassName()+" [url="+poolProperties.getUrl()+"]");
 }
-driver = (java.sql.Driver) 
Class.forName(poolProperties.getDriverClassName(),
- true, 
PooledConnection.class.getClassLoader()
- ).newInstance();
+if (poolProperties.getDriverClassName()==null) {
+   //rely on DriverManager
+   log.warn("Not loading a JDBC driver as driverClassName 
property is null.");
+} else {
+   driver = (java.sql.Driver) 
Class.forName(poolProperties.getDriverClassName(),
+   true, 
PooledConnection.class.getClassLoader()).newInstance();
+}
 }
 } catch (java.lang.Exception cn) {
 if (log.isDebugEnabled()) {
@@ -274,7 +279,11 @@ public class PooledConnection {
 if (pwd != null) properties.setProperty(PROP_PASSWORD, pwd);
 
 try {
-connection = driver.connect(driverURL, properties);
+if (driver==null) {
+   connection = DriverManager.getConnection(driverURL, properties);
+} else {
+   connection = driver.connect(driverURL, properties);
+}
 } catch (Exception x) {
 if (log.isDebugEnabled()) {
 log.debug("Unable to connect to database.", x);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1595320 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-05-16 Thread fhanik
Author: fhanik
Date: Fri May 16 19:32:00 2014
New Revision: 1595320

URL: http://svn.apache.org/r1595320
Log:
Votes

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1595320&r1=1595319&r2=1595320&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri May 16 19:32:00 2014
@@ -32,7 +32,7 @@ PATCHES PROPOSED TO BACKPORT:
   Fix NoSuchElementException while handling attributes with empty string value
   in custom tags. Patch provided by Hariprasad Manchi.
   http://svn.apache.org/viewvc?view=revision&revision=1595174
-  +1: markt
+  +1: markt, fhanik
   -1:
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593435 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-05-15 Thread fhanik
Author: fhanik
Date: Thu May  8 22:12:46 2014
New Revision: 1593435

URL: http://svn.apache.org/r1593435
Log:
Votes

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1593435&r1=1593434&r2=1593435&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu May  8 22:12:46 2014
@@ -57,7 +57,7 @@ PATCHES PROPOSED TO BACKPORT:
   Update version of Tomcat Native library included with Tomcat to 1.1.30
   and make it the recommended version.
   
https://people.apache.org/~kkolinko/patches/2014-04-27_tc6_native_1_1_30.patch
-  +1: kkolinko, markt
+  +1: kkolinko, markt, fhanik
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56027
@@ -67,31 +67,31 @@ PATCHES PROPOSED TO BACKPORT:
   (Reimplemented, based on earlier proposal by schultz)
   
https://people.apache.org/~kkolinko/patches/2014-04-27_tc6_56027_FIPSMode.patch
   http://svn.apache.org/r1590845 (javadoc fixes)
-  +1: kkolinko, markt
+  +1: kkolinko, markt, fhanik
   -1:
 
 * Defensive coding around some XML activities that are triggered by web
   applications and are therefore at potential risk of a memory leak.
   http://people.apache.org/~markt/patches/2014-04-25-memory-leak-tc6-v1.patch
-  +1: markt, kkolinko
+  +1: markt, kkolinko, fhanik
   -1:
 
 * Ensure TLD parser obtained from cache has correct value of blockExternal
   (r1590036 + r1590040 + r1590065)
   https://people.apache.org/~kkolinko/patches/2014-04-26_tc6_TldConfig.patch
-  +1: kkolinko, markt
+  +1: kkolinko, markt, fhanik
   -1:
 
 * Followup to r1589635
   To simplify code and align it with TC7 & 8.
   (Discussed in Re:r1589635)
   http://svn.apache.org/r1589737
-  +1: kkolinko, markt
+  +1: kkolinko, markt, fhanik
   -1:
 
 * Additional change missed in back-port to fix BZ 56334
   http://people.apache.org/~markt/patches/2014-04-28-bug56334-tc6-v1.patch
-  +1: markt, kkolinko
+  +1: markt, kkolinko, fhanik
   -1:
 
 * Correct the handling of back-slash escaping in the EL parser and no longer
@@ -99,12 +99,12 @@ PATCHES PROPOSED TO BACKPORT:
   escaping to take effect.
   http://svn.apache.org/r1590838
   http://svn.apache.org/r1590912
-  +1: markt, kkolinko
+  +1: markt, kkolinko, fhanik
   -1:
 
 * Additional fixes for BZ 56334
   http://svn.apache.org/r1590848
-  +1: kkolinko, markt
+  +1: kkolinko, markt, fhanik
   -1:
kkolinko: I expect to prepare a more formal patch for this later. The
merge is unlikely to complete cleanly without Mark's
@@ -113,13 +113,13 @@ PATCHES PROPOSED TO BACKPORT:
 * Clean-up and add additional packages
   https://svn.apache.org/r1593262
   https://svn.apache.org/r1593285
-  +1: markt, kkolinko
+  +1: markt, kkolinko, fhanik
   -1:
 
 * Extend token protection to either access option in NamingContextListener
   https://svn.apache.org/r1593288
   https://svn.apache.org/r1593371
-  +1: markt
+  +1: markt, fhanik
   +1: kkolinko: Added r1593371 to proposal
   -1:
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1589429 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-04-23 Thread fhanik
Author: fhanik
Date: Wed Apr 23 14:31:14 2014
New Revision: 1589429

URL: http://svn.apache.org/r1589429
Log:
Votes


Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1589429&r1=1589428&r2=1589429&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Apr 23 14:31:14 2014
@@ -31,14 +31,14 @@ PATCHES PROPOSED TO BACKPORT:
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56334
   Correct double unescaping
   
http://people.apache.org/~markt/patches/2014-04-17-attribute-escaping-tc6-v2.patch
-  +1: markt, remm
+  +1: markt, remm, fhanik
   -1:
 
 * Enabling building with Java 8
   
http://people.apache.org/~markt/patches/2014-04-12-build-with-java8-tc6-v1.patch
   (Note: It is easier to verify the AbstractReplicatedMap changes by diffing
  against the Tomcat 7 version of the class)
-  +1: markt, remm
+  +1: markt, remm, fhanik
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56369



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1378148 - /tomcat/trunk/webapps/docs/config/listeners.xml

2012-08-28 Thread fhanik
Author: fhanik
Date: Tue Aug 28 14:18:29 2012
New Revision: 1378148

URL: http://svn.apache.org/viewvc?rev=1378148&view=rev
Log:
remove as part of previous commit.

Modified:
tomcat/trunk/webapps/docs/config/listeners.xml

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1378148&r1=1378147&r2=1378148&view=diff
==
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Tue Aug 28 14:18:29 2012
@@ -208,13 +208,6 @@
 default is true.
   
 
-  
-Allows a user to configure the period of time the JVM will attempt 
to
-schedule an object-inspection. This value is used as a parameter when
-calling the method sun.misc.GC.requestLatency
-Defaults to Long.MAX_VALUE - 1.
-  
-
   
 Enables protection so that calls to
 sun.misc.GC.requestLatency(long) triggered by a web



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1378134 - /tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

2012-08-28 Thread fhanik
Author: fhanik
Date: Tue Aug 28 13:45:34 2012
New Revision: 1378134

URL: http://svn.apache.org/viewvc?rev=1378134&view=rev
Log:
revert change. vetoed per http://tomcat.markmail.org/thread/6hmjgrzys5txekew

Modified:

tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

Modified: 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1378134&r1=1378133&r2=1378134&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
Tue Aug 28 13:45:34 2012
@@ -218,17 +218,7 @@ public class JreMemoryLeakPreventionList
 this.classesToInitialize = classesToInitialize;
 }
 
-/**
- * Sets the time that this listener will request for garbage-collection 
latency
- * @see {@code sun.misc.GC#requestLatency(long)}
- */
-private long gcDaemonPeriod = Long.MAX_VALUE - 1;
-public long getGcDaemonPeriod() {
-return gcDaemonPeriod;
-}
-public void setGcDaemonPeriod(long gcDaemonPeriod) {
-this.gcDaemonPeriod = gcDaemonPeriod;
-}
+
 
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
@@ -308,7 +298,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, Long.valueOf(getGcDaemonPeriod()));
+method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1378132 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/listeners.xml

2012-08-28 Thread fhanik
Author: fhanik
Date: Tue Aug 28 13:39:36 2012
New Revision: 1378132

URL: http://svn.apache.org/viewvc?rev=1378132&view=rev
Log:
revert change. vetoed per http://tomcat.markmail.org/thread/6hmjgrzys5txekew

Modified:

tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1378132&r1=1378131&r2=1378132&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 Tue Aug 28 13:39:36 2012
@@ -218,18 +218,6 @@ public class JreMemoryLeakPreventionList
 this.classesToInitialize = classesToInitialize;
 }
 
-/**
- * Sets the time that this listener will request for garbage-collection 
latency
- * @see {@code sun.misc.GC#requestLatency(long)}
- */
-private long gcDaemonPeriod = Long.MAX_VALUE - 1;
-public long getGcDaemonPeriod() {
-return gcDaemonPeriod;
-}
-public void setGcDaemonPeriod(long gcDaemonPeriod) {
-this.gcDaemonPeriod = gcDaemonPeriod;
-}
-
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
 // Initialise these classes when Tomcat starts
@@ -308,7 +296,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, Long.valueOf(getGcDaemonPeriod()));
+method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml?rev=1378132&r1=1378131&r2=1378132&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml Tue Aug 28 13:39:36 
2012
@@ -285,13 +285,6 @@
 hard to diagnose. Defaults to true.
   
 
-  
-Allows a user to configure the period of time the JVM will attempt 
to 
-schedule an object-inspection. This value is used as a parameter when
-calling the method sun.misc.GC.requestLatency
-Defaults to Long.MAX_VALUE - 1.
-  
-
 
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377882 - /tomcat/trunk/webapps/docs/config/listeners.xml

2012-08-27 Thread fhanik
Author: fhanik
Date: Mon Aug 27 21:36:15 2012
New Revision: 1377882

URL: http://svn.apache.org/viewvc?rev=1377882&view=rev
Log:
document the new property

Modified:
tomcat/trunk/webapps/docs/config/listeners.xml

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1377882&r1=1377881&r2=1377882&view=diff
==
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Mon Aug 27 21:36:15 2012
@@ -286,6 +286,13 @@
 hard to diagnose. Defaults to true.
   
 
+  
+Allows a user to configure the period of time the JVM will attempt 
to 
+schedule an object-inspection. This value is used as a parameter when
+calling the method sun.misc.GC.requestLatency
+Defaults to Long.MAX_VALUE - 1.
+  
+
 
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377880 - /tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml

2012-08-27 Thread fhanik
Author: fhanik
Date: Mon Aug 27 21:33:49 2012
New Revision: 1377880

URL: http://svn.apache.org/viewvc?rev=1377880&view=rev
Log:
Update documentation to include the new value

Modified:
tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml?rev=1377880&r1=1377879&r2=1377880&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml Mon Aug 27 21:33:49 
2012
@@ -285,6 +285,13 @@
 hard to diagnose. Defaults to true.
   
 
+  
+Allows a user to configure the period of time the JVM will attempt 
to 
+schedule an object-inspection. This value is used as a parameter when
+calling the method sun.misc.GC.requestLatency
+Defaults to Long.MAX_VALUE - 1.
+  
+
 
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377689 - /tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

2012-08-27 Thread fhanik
Author: fhanik
Date: Mon Aug 27 14:20:55 2012
New Revision: 1377689

URL: http://svn.apache.org/viewvc?rev=1377689&view=rev
Log:
Per http://markmail.org/message/nqnogctvfuyzhtol

1. Already encountered two users that would like to set this value. There is
never any need to hard code any value, regardless of its use 
2. This turns it into a property on the listener 


Modified:

tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

Modified: 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1377689&r1=1377688&r2=1377689&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
Mon Aug 27 14:20:55 2012
@@ -218,6 +218,17 @@ public class JreMemoryLeakPreventionList
 this.classesToInitialize = classesToInitialize;
 }
 
+/**
+ * Sets the time that this listener will request for garbage-collection 
latency
+ * @see {@link sun.misc.GC#requestLatency(long)}
+ */
+private long gcDaemonPeriod = Long.MAX_VALUE - 1;
+public long getGcDaemonPeriod() {
+return gcDaemonPeriod;
+}
+public void setGcDaemonPeriod(long gcDaemonPeriod) {
+this.gcDaemonPeriod = gcDaemonPeriod;
+}
 
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
@@ -297,7 +308,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, 
Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", 
Long.valueOf(Long.MAX_VALUE-1)));
+method.invoke(null, getGcDaemonPeriod());
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377688 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/systemprops.xml

2012-08-27 Thread fhanik
Author: fhanik
Date: Mon Aug 27 14:15:36 2012
New Revision: 1377688

URL: http://svn.apache.org/viewvc?rev=1377688&view=rev
Log:
Per http://markmail.org/message/nqnogctvfuyzhtol

1. Already encountered two users that would like to set this value. There is 
never any need to hard code any value, regardless of its use
2. This turns it into a property on the listener



Modified:

tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1377688&r1=1377687&r2=1377688&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 Mon Aug 27 14:15:36 2012
@@ -218,6 +218,17 @@ public class JreMemoryLeakPreventionList
 this.classesToInitialize = classesToInitialize;
 }
 
+/**
+ * Sets the time that this listener will request for garbage-collection 
latency
+ * @see {@link sun.misc.GC#requestLatency(long)}
+ */
+private long gcDaemonPeriod = Long.MAX_VALUE - 1;
+public long getGcDaemonPeriod() {
+return gcDaemonPeriod;
+}
+public void setGcDaemonPeriod(long gcDaemonPeriod) {
+this.gcDaemonPeriod = gcDaemonPeriod;
+}
 
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
@@ -297,7 +308,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, 
Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", 
Long.valueOf(Long.MAX_VALUE-1)));
+method.invoke(null, getGcDaemonPeriod());
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml?rev=1377688&r1=1377687&r2=1377688&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml Mon Aug 27 
14:15:36 2012
@@ -637,11 +637,6 @@
  $CATALINA_BASE/catalina.properties file.
 
 
-
-  The timeout period set when the leak prevention code triggers the GC 
Daemon.
-  If not specified, the default value of Long.MAX_VALUE-1 
will be used.
-
-
   
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377544 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/systemprops.xml

2012-08-26 Thread fhanik
Author: fhanik
Date: Sun Aug 26 23:48:01 2012
New Revision: 1377544

URL: http://svn.apache.org/viewvc?rev=1377544&view=rev
Log:
don't hard code values, no need to
https://issues.apache.org/bugzilla/show_bug.cgi?id=53267

Modified:

tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
tomcat/trunk/webapps/docs/config/systemprops.xml

Modified: 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1377544&r1=1377543&r2=1377544&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
Sun Aug 26 23:48:01 2012
@@ -297,7 +297,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
+method.invoke(null, 
Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", 
Long.valueOf(Long.MAX_VALUE-1)));
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=1377544&r1=1377543&r2=1377544&view=diff
==
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Aug 26 23:48:01 2012
@@ -443,6 +443,11 @@
   else the default value will be false.
 
 
+
+  The timeout period set when the leak prevention code triggers the GC 
Daemon.
+  If not specified, the default value of Long.MAX_VALUE-1 
will be used.
+
+
   
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1377543 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/systemprops.xml

2012-08-26 Thread fhanik
Author: fhanik
Date: Sun Aug 26 23:44:19 2012
New Revision: 1377543

URL: http://svn.apache.org/viewvc?rev=1377543&view=rev
Log:
Per patches supplied in
https://issues.apache.org/bugzilla/show_bug.cgi?id=53267
Don't hard code the value, make the default the same as the hard coded value


Modified:

tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1377543&r1=1377542&r2=1377543&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 Sun Aug 26 23:44:19 2012
@@ -297,7 +297,7 @@ public class JreMemoryLeakPreventionList
 Method method = clazz.getDeclaredMethod(
 "requestLatency",
 new Class[] {long.class});
-method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
+method.invoke(null, 
Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", 
Long.valueOf(Long.MAX_VALUE-1)));
 } catch (ClassNotFoundException e) {
 if (System.getProperty("java.vendor").startsWith(
 "Sun")) {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml?rev=1377543&r1=1377542&r2=1377543&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml Sun Aug 26 
23:44:19 2012
@@ -637,6 +637,11 @@
  $CATALINA_BASE/catalina.properties file.
 
 
+
+  The timeout period set when the leak prevention code triggers the GC 
Daemon.
+  If not specified, the default value of Long.MAX_VALUE-1 
will be used.
+
+
   
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1371794 - /tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

2012-08-10 Thread fhanik
Author: fhanik
Date: Fri Aug 10 18:11:36 2012
New Revision: 1371794

URL: http://svn.apache.org/viewvc?rev=1371794&view=rev
Log:
ConnectionState must supported with short name too.

Modified:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1371794&r1=1371793&r2=1371794&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 Fri Aug 10 18:11:36 2012
@@ -183,7 +183,8 @@ public class PooledConnection {
 }
 
 //set up the default state, unless we expect the interceptor to do it
-if (poolProperties.getJdbcInterceptors()==null || 
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getName())<0)
 {
+if (poolProperties.getJdbcInterceptors()==null || 
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getName())<0 
||
+
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getSimpleName())<0)
 {
 if 
(poolProperties.getDefaultTransactionIsolation()!=DataSourceFactory.UNKNOWN_TRANSACTIONISOLATION)
 
connection.setTransactionIsolation(poolProperties.getDefaultTransactionIsolation());
 if (poolProperties.getDefaultReadOnly()!=null) 
connection.setReadOnly(poolProperties.getDefaultReadOnly().booleanValue());
 if (poolProperties.getDefaultAutoCommit()!=null) 
connection.setAutoCommit(poolProperties.getDefaultAutoCommit().booleanValue());



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1371793 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

2012-08-10 Thread fhanik
Author: fhanik
Date: Fri Aug 10 18:10:49 2012
New Revision: 1371793

URL: http://svn.apache.org/viewvc?rev=1371793&view=rev
Log:
ConnectionState must supported with short name too.

Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1371793&r1=1371792&r2=1371793&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 Fri Aug 10 18:10:49 2012
@@ -183,7 +183,8 @@ public class PooledConnection {
 }
 
 //set up the default state, unless we expect the interceptor to do it
-if (poolProperties.getJdbcInterceptors()==null || 
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getName())<0)
 {
+if (poolProperties.getJdbcInterceptors()==null || 
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getName())<0 
||
+
poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getSimpleName())<0)
 {
 if 
(poolProperties.getDefaultTransactionIsolation()!=DataSourceFactory.UNKNOWN_TRANSACTIONISOLATION)
 
connection.setTransactionIsolation(poolProperties.getDefaultTransactionIsolation());
 if (poolProperties.getDefaultReadOnly()!=null) 
connection.setReadOnly(poolProperties.getDefaultReadOnly().booleanValue());
 if (poolProperties.getDefaultAutoCommit()!=null) 
connection.setAutoCommit(poolProperties.getDefaultAutoCommit().booleanValue());



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1370259 - /tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java

2012-08-07 Thread fhanik
Author: fhanik
Date: Tue Aug  7 13:36:00 2012
New Revision: 1370259

URL: http://svn.apache.org/viewvc?rev=1370259&view=rev
Log:
cleanup

Modified:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java?rev=1370259&r1=1370258&r2=1370259&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 Tue Aug  7 13:36:00 2012
@@ -16,9 +16,7 @@
  */
 package org.apache.tomcat.jdbc.test;
 
-import java.lang.management.ManagementFactory;
 import java.sql.Connection;
-import java.util.Hashtable;
 
 import javax.sql.PooledConnection;
 
@@ -45,7 +43,6 @@ public class EqualsHashCodeTest extends 
 this.datasource.setUsername(username);
 this.datasource.getConnection().close();
 ConnectionPool pool = datasource.createPool();
-org.apache.tomcat.jdbc.pool.jmx.ConnectionPool jmxPool = new 
org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(pool);
 }
 
 public void testEquals() throws Exception {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1370258 - /tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java

2012-08-07 Thread fhanik
Author: fhanik
Date: Tue Aug  7 13:35:49 2012
New Revision: 1370258

URL: http://svn.apache.org/viewvc?rev=1370258&view=rev
Log:
cleanup

Modified:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java?rev=1370258&r1=1370257&r2=1370258&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 Tue Aug  7 13:35:49 2012
@@ -16,9 +16,7 @@
  */
 package org.apache.tomcat.jdbc.test;
 
-import java.lang.management.ManagementFactory;
 import java.sql.Connection;
-import java.util.Hashtable;
 
 import javax.sql.PooledConnection;
 
@@ -45,7 +43,6 @@ public class EqualsHashCodeTest extends 
 this.datasource.setUsername(username);
 this.datasource.getConnection().close();
 ConnectionPool pool = datasource.createPool();
-org.apache.tomcat.jdbc.pool.jmx.ConnectionPool jmxPool = new 
org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(pool);
 }
 
 public void testEquals() throws Exception {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1370075 - in /tomcat/tc7.0.x/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/ test/java/org/apache/tomcat/jdbc/test/

2012-08-06 Thread fhanik
Author: fhanik
Date: Tue Aug  7 00:15:50 2012
New Revision: 1370075

URL: http://svn.apache.org/viewvc?rev=1370075&view=rev
Log:
implement equals and hashCode so that they survive connection closure

Added:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
   (with props)
Modified:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java?rev=1370075&r1=1370074&r2=1370075&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
 Tue Aug  7 00:15:50 2012
@@ -17,6 +17,7 @@
 package org.apache.tomcat.jdbc.pool;
 
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 import java.sql.SQLException;
 
 /**
@@ -44,10 +45,26 @@ public class DisposableConnectionFacade 
 public void reset(ConnectionPool parent, PooledConnection con) {
 }
 
+
+
+@Override
+public int hashCode() {
+return System.identityHashCode(this);
+}
+
+@Override
+public boolean equals(Object obj) {
+return this==obj;
+}
+
 @Override
 public Object invoke(Object proxy, Method method, Object[] args)
 throws Throwable {
-if (getNext()==null) {
+if (compare(EQUALS_VAL, method)) {
+return this.equals(Proxy.getInvocationHandler(args[0]));
+} else if (compare(HASHCODE_VAL, method)) {
+return this.hashCode();
+} else if (getNext()==null) {
 if (compare(ISCLOSED_VAL, method)) {
 return Boolean.TRUE;
 }

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java?rev=1370075&r1=1370074&r2=1370075&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
 Tue Aug  7 00:15:50 2012
@@ -67,6 +67,16 @@ public abstract class JdbcInterceptor im
 public static final String ISVALID_VAL = "isValid";
 
 /**
+ * {@link java.lang.Object#equals(Object)}
+ */
+public static final String EQUALS_VAL = "equals";
+
+/**
+ * {@link java.lang.Object#hashCode()}
+ */
+public static final String HASHCODE_VAL = "hashCode";
+
+/**
  * Properties for this interceptor.
  */
 protected Map properties = null;

Added: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java?rev=1370075&view=auto
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 (added)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 Tue Aug  7 00:15:50 2012
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+package org.apache.tomcat.jdbc.test;
+
+import java.lang.management.ManagementFactory;
+import java.sql.Connec

svn commit: r1370074 - in /tomcat/trunk/modules/jdbc-pool/src: main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java test/jav

2012-08-06 Thread fhanik
Author: fhanik
Date: Tue Aug  7 00:14:50 2012
New Revision: 1370074

URL: http://svn.apache.org/viewvc?rev=1370074&view=rev
Log:
Implement equals/hashCode so that they survive connection closure


Added:

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
   (with props)
Modified:

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java?rev=1370074&r1=1370073&r2=1370074&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
 Tue Aug  7 00:14:50 2012
@@ -17,6 +17,7 @@
 package org.apache.tomcat.jdbc.pool;
 
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 import java.sql.SQLException;
 
 /**
@@ -44,10 +45,26 @@ public class DisposableConnectionFacade 
 public void reset(ConnectionPool parent, PooledConnection con) {
 }
 
+
+
+@Override
+public int hashCode() {
+return System.identityHashCode(this);
+}
+
+@Override
+public boolean equals(Object obj) {
+return this==obj;
+}
+
 @Override
 public Object invoke(Object proxy, Method method, Object[] args)
 throws Throwable {
-if (getNext()==null) {
+if (compare(EQUALS_VAL, method)) {
+return this.equals(Proxy.getInvocationHandler(args[0]));
+} else if (compare(HASHCODE_VAL, method)) {
+return this.hashCode();
+} else if (getNext()==null) {
 if (compare(ISCLOSED_VAL, method)) {
 return Boolean.TRUE;
 }

Modified: 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java?rev=1370074&r1=1370073&r2=1370074&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
 Tue Aug  7 00:14:50 2012
@@ -67,6 +67,16 @@ public abstract class JdbcInterceptor im
 public static final String ISVALID_VAL = "isValid";
 
 /**
+ * {@link java.lang.Object#equals(Object)}
+ */
+public static final String EQUALS_VAL = "equals";
+
+/**
+ * {@link java.lang.Object#hashCode()}
+ */
+public static final String HASHCODE_VAL = "hashCode";
+
+/**
  * Properties for this interceptor.
  */
 protected Map properties = null;

Added: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java?rev=1370074&view=auto
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 (added)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
 Tue Aug  7 00:14:50 2012
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+package org.apache.tomcat.jdbc.test;
+
+import java.lang.management.ManagementFactory;
+import java.sql.Connection;
+import java.util.Hashtable;
+
+import javax.sql.PooledConnection;
+
+import org.apache.tomcat.jdbc.pool.ConnectionPool;
+import org.apache.tomcat.j

svn commit: r1369969 - /tomcat/trunk/modules/jdbc-pool/build.properties.default

2012-08-06 Thread fhanik
Author: fhanik
Date: Mon Aug  6 20:14:13 2012
New Revision: 1369969

URL: http://svn.apache.org/viewvc?rev=1369969&view=rev
Log:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53649 fix compiler warnings

Modified:
tomcat/trunk/modules/jdbc-pool/build.properties.default

Modified: tomcat/trunk/modules/jdbc-pool/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.properties.default?rev=1369969&r1=1369968&r2=1369969&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/build.properties.default (original)
+++ tomcat/trunk/modules/jdbc-pool/build.properties.default Mon Aug  6 20:14:13 
2012
@@ -37,8 +37,8 @@ version.suffix=
 # contexts by the various build scripts.
 base.path=${basedir}/includes
 
-compile.source=1.5
-compile.target=1.5
+compile.source=1.7
+compile.target=1.7
 compile.debug=true
 
 # - Settings for Junit test database.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360929 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 20:48:31 2012
New Revision: 1360929

URL: http://svn.apache.org/viewvc?rev=1360929&view=rev
Log:
brain farts today. Must get the value of the keycount key

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1360929&r1=1360928&r2=1360929&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Thu Jul 
12 20:48:31 2012
@@ -199,7 +199,7 @@ public class NioSelectorPool {
 if (writeTimeout==0) {
 timedout = buf.hasRemaining();
 } else if (writeTimeout<0) {
-selector.select();
+keycount = selector.select();
 } else {
 keycount = selector.select(writeTimeout);
 }
@@ -273,7 +273,7 @@ public class NioSelectorPool {
 if (readTimeout==0) {
 timedout = (read==0);
 } else if (readTimeout<0) {
-selector.select();
+keycount = selector.select();
 } else {
 keycount = selector.select(readTimeout);
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360917 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 20:40:02 2012
New Revision: 1360917

URL: http://svn.apache.org/viewvc?rev=1360917&view=rev
Log:
Fix timeout according to Javadoc

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1360917&r1=1360916&r2=1360917&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Thu Jul 
12 20:40:02 2012
@@ -196,8 +196,10 @@ public class NioSelectorPool {
 //register OP_WRITE to the selector
 if (key==null) key = 
socket.getIOChannel().register(selector, SelectionKey.OP_WRITE);
 else key.interestOps(SelectionKey.OP_WRITE);
-if (writeTimeout<=0) {
-keycount = selector.selectNow();
+if (writeTimeout==0) {
+timedout = buf.hasRemaining();
+} else if (writeTimeout<0) {
+selector.select();
 } else {
 keycount = selector.select(writeTimeout);
 }
@@ -268,8 +270,10 @@ public class NioSelectorPool {
 //register OP_WRITE to the selector
 if (key==null) key = 
socket.getIOChannel().register(selector, SelectionKey.OP_READ);
 else key.interestOps(SelectionKey.OP_READ);
-if (readTimeout<=0) {
-keycount = selector.selectNow();
+if (readTimeout==0) {
+timedout = (read==0);
+} else if (readTimeout<0) {
+selector.select();
 } else {
 keycount = selector.select(readTimeout);
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360905 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 20:11:31 2012
New Revision: 1360905

URL: http://svn.apache.org/viewvc?rev=1360905&view=rev
Log:
Correct handling of timeout - negative or zero means no timeout but an instant


Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1360905&r1=1360904&r2=1360905&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Thu Jul 
12 20:11:31 2012
@@ -196,7 +196,11 @@ public class NioSelectorPool {
 //register OP_WRITE to the selector
 if (key==null) key = 
socket.getIOChannel().register(selector, SelectionKey.OP_WRITE);
 else key.interestOps(SelectionKey.OP_WRITE);
-keycount = selector.select(writeTimeout);
+if (writeTimeout<=0) {
+keycount = selector.selectNow();
+} else {
+keycount = selector.select(writeTimeout);
+}
 }
 if (writeTimeout > 0 && (selector == null || keycount == 0) ) 
timedout = (System.currentTimeMillis()-time)>=writeTimeout;
 }//while
@@ -264,7 +268,11 @@ public class NioSelectorPool {
 //register OP_WRITE to the selector
 if (key==null) key = 
socket.getIOChannel().register(selector, SelectionKey.OP_READ);
 else key.interestOps(SelectionKey.OP_READ);
-keycount = selector.select(readTimeout);
+if (readTimeout<=0) {
+keycount = selector.selectNow();
+} else {
+keycount = selector.select(readTimeout);
+}
 }
 if (readTimeout > 0 && (selector == null || keycount == 0) ) 
timedout = (System.currentTimeMillis()-time)>=readTimeout;
 }//while



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360811 - /tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 16:50:58 2012
New Revision: 1360811

URL: http://svn.apache.org/viewvc?rev=1360811&view=rev
Log:
fix override annotation

Modified:

tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java?rev=1360811&r1=1360810&r2=1360811&view=diff
==
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
 Thu Jul 12 16:50:58 2012
@@ -82,7 +82,6 @@ public class Driver implements java.sql.
 // Can't add @Override annotations since this code also has to compile with
 // Java 6 for Tomcat 7.
 
-@Override
 public Logger getParentLogger() throws SQLFeatureNotSupportedException {
 return null;
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360730 - /tomcat/trunk/build.xml

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 15:41:01 2012
New Revision: 1360730

URL: http://svn.apache.org/viewvc?rev=1360730&view=rev
Log:
removed debug statement

Modified:
tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1360730&r1=1360729&r2=1360730&view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Thu Jul 12 15:41:01 2012
@@ -2426,7 +2426,6 @@ Apache Tomcat ${version} native binaries
 
   
 
-Copied files to ${tomcat-dbcp.home}
 
 

svn commit: r1360729 - in /tomcat/trunk: ./ modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ res/dbcp/

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 15:38:28 2012
New Revision: 1360729

URL: http://svn.apache.org/viewvc?rev=1360729&view=rev
Log:
Configure Tomcat trunk to build with Java 7.
This includes adding a patch to the Commons-DBCP code from res/dbcp


Added:
tomcat/trunk/res/dbcp/
tomcat/trunk/res/dbcp/dbcp-java-7.patch   (with props)
Modified:
tomcat/trunk/build.properties.default
tomcat/trunk/build.xml

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java

Modified: tomcat/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1360729&r1=1360728&r2=1360729&view=diff
==
--- tomcat/trunk/build.properties.default (original)
+++ tomcat/trunk/build.properties.default Thu Jul 12 15:38:28 2012
@@ -57,8 +57,8 @@ base.path=/usr/share/java
 #base.path=C:/path/to/the/repository
 #base.path=/usr/local
 
-compile.source=1.6
-compile.target=1.6
+compile.source=1.7
+compile.target=1.7
 compile.debug=true
 
 base-apache.loc.1=http://www.apache.org/dist

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1360729&r1=1360728&r2=1360729&view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Thu Jul 12 15:38:28 2012
@@ -2426,6 +2426,13 @@ Apache Tomcat ${version} native binaries
 
   
 
+Copied files to ${tomcat-dbcp.home}
+
+
+
 
   http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java?rev=1360729&r1=1360728&r2=1360729&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
 Thu Jul 12 15:38:28 2012
@@ -285,25 +285,36 @@ public class Connection implements java.
 return null;
 }
 
-// -- Java 7 
methods
-// Can't add @Override annotations since this code also has to compile with
-// Java 6 for Tomcat 7.
-
+@Override
 public void setSchema(String schema) throws SQLException {
+// TODO Auto-generated method stub
+
 }
 
+@Override
 public String getSchema() throws SQLException {
+// TODO Auto-generated method stub
 return null;
 }
 
+@Override
 public void abort(Executor executor) throws SQLException {
+// TODO Auto-generated method stub
+
 }
 
-public void setNetworkTimeout(Executor executor, int milliseconds)
-throws SQLException {
+@Override
+public void setNetworkTimeout(Executor executor, int milliseconds) throws 
SQLException {
+// TODO Auto-generated method stub
+
 }
 
+@Override
 public int getNetworkTimeout() throws SQLException {
+// TODO Auto-generated method stub
 return 0;
 }
+
+
+
 }

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java?rev=1360729&r1=1360728&r2=1360729&view=diff
==
--- 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
 (original)
+++ 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
 Thu Jul 12 15:38:28 2012
@@ -78,12 +78,11 @@ public class Driver implements java.sql.
 return false;
 }
 
-// -- Java 7 
methods
-// Can't add @Override annotations since this code also has to compile with
-// Java 6 for Tomcat 7.
-
 @Override
 public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+// TODO Auto-generated method stub
 return null;
 }
+
+
 }

Modified: 
tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java?rev=1360729&r1=1360728&r2=1360729&view=diff
==
---

svn commit: r1360704 - in /tomcat/tc7.0.x/trunk/modules: ./ jdbc-pool/

2012-07-12 Thread fhanik
Author: fhanik
Date: Thu Jul 12 14:34:50 2012
New Revision: 1360704

URL: http://svn.apache.org/viewvc?rev=1360704&view=rev
Log:
jdbc-pool is branched off into Tomcat 7 so that refactoring can take place in 
trunk


Added:
tomcat/tc7.0.x/trunk/modules/jdbc-pool/
  - copied from r1360703, tomcat/trunk/modules/jdbc-pool/
Modified:
tomcat/tc7.0.x/trunk/modules/   (props changed)

Propchange: tomcat/tc7.0.x/trunk/modules/
('svn:externals' removed)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360449 - /tomcat/trunk/webapps/docs/aio.xml

2012-07-11 Thread fhanik
Author: fhanik
Date: Wed Jul 11 22:29:08 2012
New Revision: 1360449

URL: http://svn.apache.org/viewvc?rev=1360449&view=rev
Log:
fix sentence

Modified:
tomcat/trunk/webapps/docs/aio.xml

Modified: tomcat/trunk/webapps/docs/aio.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/aio.xml?rev=1360449&r1=1360448&r2=1360449&view=diff
==
--- tomcat/trunk/webapps/docs/aio.xml (original)
+++ tomcat/trunk/webapps/docs/aio.xml Wed Jul 11 22:29:08 2012
@@ -345,7 +345,7 @@ public class ChatServlet
   
   
 In addition to setting these parameters it is necessary to set the 
content-length header.
-Tomcat will not do that for you, since you may have already written data 
to the 
+Tomcat will not do that for you, since you may have already written data 
to the output stream.
   
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1360433 - in /tomcat/trunk: build.properties.default build.xml

2012-07-11 Thread fhanik
Author: fhanik
Date: Wed Jul 11 22:01:17 2012
New Revision: 1360433

URL: http://svn.apache.org/viewvc?rev=1360433&view=rev
Log:
Add IPv4Stack flag one can control from build.properties and 
build.properties.default
default value is false but can be overridden even from command line
default compile source/target is 1.7, but has to be changed in 
build.properties.default to take into effect


Modified:
tomcat/trunk/build.properties.default
tomcat/trunk/build.xml

Modified: tomcat/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1360433&r1=1360432&r2=1360433&view=diff
==
--- tomcat/trunk/build.properties.default (original)
+++ tomcat/trunk/build.properties.default Wed Jul 11 22:01:17 2012
@@ -203,3 +203,5 @@ dojo-js.home=${base.path}/dojo-release-1
 
dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
 dojo-js.jar=${dojo-js.home}/dojo/dojo.js
 
+# - JVM settings for unit tests
+java.net.preferIPv4Stack=false
\ No newline at end of file

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1360433&r1=1360432&r2=1360433&view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Wed Jul 11 22:01:17 2012
@@ -74,9 +74,9 @@
   
   
 
-  
-  
-  
+  
+  
+  
 
   
   
@@ -1197,6 +1197,8 @@
 
 
 
+
+
 
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



  1   2   3   4   5   6   7   8   9   10   >