You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/12/11 22:14:45 UTC

svn commit: r1044723 - in /tomcat/trunk: java/org/apache/tomcat/util/net/ java/org/apache/tomcat/util/net/jsse/ res/checkstyle/

Author: markt
Date: Sat Dec 11 21:14:45 2010
New Revision: 1044723

URL: http://svn.apache.org/viewvc?rev=1044723&view=rev
Log:
o.a.tomcat.util.net should not depend on o.a.catalina

Added:
    tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java   (with props)
Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
    tomcat/trunk/res/checkstyle/org-import-control.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1044723&r1=1044722&r2=1044723&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Sat Dec 11 21:14:45 2010
@@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.KeyManagerFactory;
 
-import org.apache.catalina.Globals;
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.IntrospectionUtils;
@@ -586,7 +585,8 @@ public abstract class AbstractEndpoint {
     private String keystoreFile = System.getProperty("user.home")+"/.keystore";
     public String getKeystoreFile() { return keystoreFile;}
     public void setKeystoreFile(String s ) {
-        String file = adjustRelativePath(s, System.getProperty(Globals.CATALINA_BASE_PROP));
+        String file = adjustRelativePath(s,
+                System.getProperty(Constants.CATALINA_BASE_PROP));
         this.keystoreFile = file;
     }
 
@@ -633,7 +633,8 @@ public abstract class AbstractEndpoint {
     private String truststoreFile = System.getProperty("javax.net.ssl.trustStore");
     public String getTruststoreFile() {return truststoreFile;}
     public void setTruststoreFile(String s) {
-        String file = adjustRelativePath(s, System.getProperty(Globals.CATALINA_BASE_PROP));
+        String file = adjustRelativePath(s,
+                System.getProperty(Constants.CATALINA_BASE_PROP));
         this.truststoreFile = file;
     }
 

Added: tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java?rev=1044723&view=auto
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java (added)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java Sat Dec 11 21:14:45 2010
@@ -0,0 +1,33 @@
+/*
+ *  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.util.net;
+
+public class Constants {
+
+    /**
+     * Name of the system property containing
+     * the tomcat instance installation path
+     */
+    public static final String CATALINA_BASE_PROP = "catalina.base";
+
+
+    /**
+     * Has security been turned on?
+     */
+    public static final boolean IS_SECURITY_ENABLED =
+        (System.getSecurityManager() != null);
+}

Propchange: tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1044723&r1=1044722&r2=1044723&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Sat Dec 11 21:14:45 2010
@@ -28,7 +28,6 @@ import java.util.Iterator;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.RejectedExecutionException;
 
-import org.apache.catalina.Globals;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -508,7 +507,7 @@ public class JIoEndpoint extends Abstrac
                 ClassLoader loader = Thread.currentThread().getContextClassLoader();
                 try {
                     //threads should not be created by the webapp classloader
-                    if (Globals.IS_SECURITY_ENABLED) {
+                    if (Constants.IS_SECURITY_ENABLED) {
                         PrivilegedAction<Void> pa = new PrivilegedSetTccl(
                                 getClass().getClassLoader());
                         AccessController.doPrivileged(pa);
@@ -522,7 +521,7 @@ public class JIoEndpoint extends Abstrac
                     }
                     getExecutor().execute(proc);
                 }finally {
-                    if (Globals.IS_SECURITY_ENABLED) {
+                    if (Constants.IS_SECURITY_ENABLED) {
                         PrivilegedAction<Void> pa = new PrivilegedSetTccl(loader);
                         AccessController.doPrivileged(pa);
                     } else {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=1044723&r1=1044722&r2=1044723&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java Sat Dec 11 21:14:45 2010
@@ -58,8 +58,8 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509KeyManager;
 
-import org.apache.catalina.Globals;
 import org.apache.tomcat.util.net.AbstractEndpoint;
+import org.apache.tomcat.util.net.Constants;
 import org.apache.tomcat.util.net.ServerSocketFactory;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -370,8 +370,8 @@ public class JSSESocketFactory implement
                     "".equalsIgnoreCase(path))) {
                 File keyStoreFile = new File(path);
                 if (!keyStoreFile.isAbsolute()) {
-                    keyStoreFile = new File(System.getProperty(Globals.CATALINA_BASE_PROP),
-                                            path);
+                    keyStoreFile = new File(System.getProperty(
+                            Constants.CATALINA_BASE_PROP), path);
                 }
                 istream = new FileInputStream(keyStoreFile);
             }
@@ -612,7 +612,8 @@ public class JSSESocketFactory implement
 
         File crlFile = new File(crlf);
         if( !crlFile.isAbsolute() ) {
-            crlFile = new File(System.getProperty(Globals.CATALINA_BASE_PROP), crlf);
+            crlFile = new File(
+                    System.getProperty(Constants.CATALINA_BASE_PROP), crlf);
         }
         Collection<? extends CRL> crls = null;
         InputStream is = null;

Modified: tomcat/trunk/res/checkstyle/org-import-control.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-import-control.xml?rev=1044723&r1=1044722&r2=1044723&view=diff
==============================================================================
--- tomcat/trunk/res/checkstyle/org-import-control.xml (original)
+++ tomcat/trunk/res/checkstyle/org-import-control.xml Sat Dec 11 21:14:45 2010
@@ -91,7 +91,6 @@
       <allow pkg="org.apache.tomcat.util"/>
       <disallow pkg="org.apache.util.scan"/>
       <!-- To remove? -->
-      <allow class="org.apache.catalina.Globals"/>
       <allow class="org.apache.coyote.RequestGroupInfo"/>
       <!-- end to remove -->
       <subpackage name="scan">



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