Author: markt
Date: Tue Mar 8 11:04:38 2011
New Revision: 1079320
URL: http://svn.apache.org/viewvc?rev=1079320&view=rev
Log:
Restore the ability to register the Tomcat jndi URL handler via the
java.protocol.handler.pkgs system property.
Added:
tomcat/trunk/java/org/apache/naming/resources/jndi/ (props changed)
- copied from r1078797,
tomcat/trunk/java/org/apache/naming/resources/jndi/
Modified:
tomcat/trunk/java/org/apache/naming/resources/Constants.java
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
tomcat/trunk/java/org/apache/naming/resources/jndi/Handler.java
Modified: tomcat/trunk/java/org/apache/naming/resources/Constants.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/Constants.java?rev=1079320&r1=1079319&r2=1079320&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/Constants.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/Constants.java Tue Mar 8
11:04:38 2011
@@ -24,5 +24,9 @@ package org.apache.naming.resources;
*/
public final class Constants {
+
+ public static final String PROTOCOL_HANDLER_VARIABLE =
+ "java.protocol.handler.pkgs";
+
public static final String Package = "org.apache.naming.resources";
}
Modified:
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java?rev=1079320&r1=1079319&r2=1079320&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
(original)
+++
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
Tue Mar 8 11:04:38 2011
@@ -133,6 +133,23 @@ public class DirContextURLStreamHandler
/**
+ * Set the java.protocol.handler.pkgs system property. For use when
+ * embedding Tomcat and the embedding application has already set its own
+ * {@link java.net.URLStreamHandlerFactory}.
+ */
+ public static void setProtocolHandler() {
+ String value = System.getProperty(Constants.PROTOCOL_HANDLER_VARIABLE);
+ if (value == null) {
+ value = Constants.Package;
+ System.setProperty(Constants.PROTOCOL_HANDLER_VARIABLE, value);
+ } else if (value.indexOf(Constants.Package) == -1) {
+ value += "|" + Constants.Package;
+ System.setProperty(Constants.PROTOCOL_HANDLER_VARIABLE, value);
+ }
+ }
+
+
+ /**
* Returns true if the thread or the context class loader of the current
* thread is bound.
*/
Propchange: tomcat/trunk/java/org/apache/naming/resources/jndi/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Mar 8 11:04:38 2011
@@ -0,0 +1 @@
+/tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/jndi:742915
Modified: tomcat/trunk/java/org/apache/naming/resources/jndi/Handler.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/jndi/Handler.java?rev=1079320&r1=1078797&r2=1079320&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/jndi/Handler.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/jndi/Handler.java Tue Mar 8
11:04:38 2011
@@ -14,16 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.naming.resources.jndi;
import org.apache.naming.resources.DirContextURLStreamHandler;
/**
- * Stream handler to a JNDI directory context.
- *
- * @author <a href="mailto:[email protected]">Remy Maucherat</a>
- * @version $Revision$
+ * Stream handler to a JNDI directory context. For use when
+ * embedding Tomcat and the embedding application has already set its own
+ * {@link java.net.URLStreamHandlerFactory} and the Tomcat jndi handler needs
to
+ * be registered via the java.protocol.handler.pkgs system property.
*/
public class Handler extends DirContextURLStreamHandler {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]