Updating comments; preparing to have a real docset someday!
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
44d3664db4
commit
ae09b42018
25
java/src/org/apache/env/Which.java
vendored
25
java/src/org/apache/env/Which.java
vendored
@ -2,8 +2,8 @@
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2001 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2001-2002 The Apache Software Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -64,7 +64,8 @@ import java.util.StringTokenizer;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* General environment checking and version finding service.
|
||||
* General environment checking and version finding service;
|
||||
* main external entrypoints and command line interface.
|
||||
*
|
||||
* <p>Which is the command line interface to the org.apache.env
|
||||
* package. Simply put, it provides a simplistic
|
||||
@ -85,16 +86,30 @@ import java.util.Vector;
|
||||
* servlet, you <b>must</b> call Which.blah() from your servlet as
|
||||
* it's installed in an actual container.</p>
|
||||
*
|
||||
* <p>Usage-command line:
|
||||
* <p><b>Usage</b> - command line:<br/>
|
||||
* <code>
|
||||
* java org.apache.env.Which [project;WhichProject] [-options]
|
||||
* </code></p>
|
||||
*
|
||||
* <p>Usage-from program:
|
||||
* <p><b>Usage</b> - from program:<br/>
|
||||
* <code>
|
||||
* int status = org.apache.env.Which.which(hash, projects, options);
|
||||
* </code></p>
|
||||
*
|
||||
* <p><b>Usage</b> - from XSLT stylesheet in <a href="http://xml.apache.org/xalan-j/">Xalan-J</a>:<br/>
|
||||
* (add which.jar to your classpath and run the following stylesheet)
|
||||
* <pre>
|
||||
* <?xml version="1.0"?>
|
||||
* <xsl:stylesheet version="1.0"
|
||||
* xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
* xmlns:xalan="http://xml.apache.org/xalan"
|
||||
* exclude-result-prefixes="xalan">
|
||||
* <xsl:output indent="yes"/>
|
||||
* <xsl:template match="/">
|
||||
* <xsl:copy-of select="xalan:checkEnvironment()"/>
|
||||
* </xsl:template>
|
||||
* </xsl:stylesheet>
|
||||
* </pre></p>
|
||||
* <p>Original credit to org.apache.xalan.xslt.EnvironmentCheck</p>
|
||||
* @author shane_curcuru@us.ibm.com
|
||||
* @version $Id$
|
||||
|
||||
20
java/src/org/apache/env/WhichClass.java
vendored
20
java/src/org/apache/env/WhichClass.java
vendored
@ -62,10 +62,19 @@ import org.apache.env.WhichConstant;
|
||||
|
||||
/**
|
||||
* Class finding service.
|
||||
* This effectively replaces Class.forName() calls in this package.
|
||||
* Similar to code in javax.xml.*.FactoryFinder. Options included
|
||||
* for future use; they could specify something like
|
||||
* LOCAL_CLASSLOADER_ONLY for servlet environments, etc.
|
||||
*
|
||||
* <p>This effectively replaces all Class.forName() calls in this
|
||||
* package. Similar to code in javax.xml.*.FactoryFinder.
|
||||
* Options included for future use; they could specify something
|
||||
* like LOCAL_CLASSLOADER_ONLY for servlet environments, etc.</p>
|
||||
*
|
||||
* <p>This class detects JDKs 1.1.x versus 1.2+ and may attempt to
|
||||
* either use the current classLoader or may use a contextClassLoader.
|
||||
* Note that in some servlet environments or in IDE environments
|
||||
* like <a href="http://www.eclipse.org">Eclipse</a> that the
|
||||
* difference between classloaders is very important! Changes in
|
||||
* the JAXP FactoryFinder classes should be actively evaluated for
|
||||
* inclusion/copying here.</p>
|
||||
*
|
||||
* @author shane_curcuru@us.ibm.com
|
||||
* @version $Id$
|
||||
@ -126,6 +135,9 @@ public abstract class WhichClass // Prevent instantiation; only provide static
|
||||
{
|
||||
|
||||
// Assume that we are running JDK 1.1, use the current ClassLoader
|
||||
// Note that this will be the classloader from
|
||||
// which.jar's loading, not necessarily the one from
|
||||
// an external caller's perspective (I think)
|
||||
return WhichClass.class.getClassLoader();
|
||||
}
|
||||
|
||||
|
||||
21
java/src/org/apache/env/package.html
vendored
Normal file
21
java/src/org/apache/env/package.html
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<title>Which environment checking utility</title>
|
||||
<body>
|
||||
<p>Which is a simple utility that inspects your JVM's environment and reports simple info about versions of classes found.</p>
|
||||
<dl>
|
||||
<dt><b>Author: </b></dt><dd><a href="mailto:shane_curcuru@lotus.com">Shane_Curcuru@us.ibm.com</a></dd>
|
||||
<dt><b>See: </b>(overview)</dt><dd><a href="http://xml.apache.org/commons/">xml-commons project</a> for an overview.</dd>
|
||||
<dt><b>Usage: </b>(common)</dt><dd>
|
||||
<code>set CLASSPATH=%CLASSPATH%;\xml-commons\java\build\which.jar<br/>
|
||||
java org.apache.env.Which [project;WhichProject] [-options]</code></dd>
|
||||
<dt><b>Usage: </b>(more examples)</dt><dd>{@link org.apache.env.Which}</dd>
|
||||
</dl>
|
||||
<p>This package is a somewhat simplistic environment checking
|
||||
utility. It allows users in various environments to self-test
|
||||
their specific deployed environment to ensure that they have the
|
||||
correct classes present. Which is currently focused on various
|
||||
XML issues but is architected to be generic and easily extensible.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user