You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-cvs@xml.apache.org by cu...@apache.org on 2002/08/07 21:23:54 UTC

cvs commit: xml-commons/java/src/org/apache/env Which.java WhichClass.java

curcuru     2002/08/07 12:23:54

  Modified:    java/src/org/apache/env Which.java WhichClass.java
  Log:
  Updating comments; preparing to have a real docset someday!
  
  Revision  Changes    Path
  1.4       +22 -7     xml-commons/java/src/org/apache/env/Which.java
  
  Index: Which.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/env/Which.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Which.java	6 Aug 2002 21:37:15 -0000	1.3
  +++ Which.java	7 Aug 2002 19:23:54 -0000	1.4
  @@ -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.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 @@
    * 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>
  + * &lt;?xml version="1.0"?>
  + * &lt;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">
  + *     &lt;xsl:output indent="yes"/>
  + *     &lt;xsl:template match="/">
  + *       &lt;xsl:copy-of select="xalan:checkEnvironment()"/>
  + *     &lt;/xsl:template>
  + * &lt;/xsl:stylesheet>
  + * </pre></p>
    * <p>Original credit to org.apache.xalan.xslt.EnvironmentCheck</p>
    * @author shane_curcuru@us.ibm.com
    * @version $Id$
  
  
  
  1.2       +17 -5     xml-commons/java/src/org/apache/env/WhichClass.java
  
  Index: WhichClass.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/env/WhichClass.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WhichClass.java	11 Dec 2001 17:42:50 -0000	1.1
  +++ WhichClass.java	7 Aug 2002 19:23:54 -0000	1.2
  @@ -62,10 +62,19 @@
   
   /**
    * 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 @@
           {
   
               // 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();
           }