com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck Java Examples

The following examples show how to use com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Extensions.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Return a Node of basic debugging information from the
 * EnvironmentCheck utility about the Java environment.
 *
 * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
 * utility to grab info about the Java environment and CLASSPATH,
 * etc., and then returns the resulting Node.  Stylesheets can
 * then maniuplate this data or simply xsl:copy-of the Node.  Note
 * that we first attempt to load the more advanced
 * org.apache.env.Which utility by reflection; only if that fails
 * to we still use the internal version.  Which is available from
 * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
 *
 * <p>We throw a WrappedRuntimeException in the unlikely case
 * that reading information from the environment throws us an
 * exception. (Is this really the best thing to do?)</p>
 *
 * @param myContext an <code>ExpressionContext</code> passed in by the
 *                  extension mechanism.  This must be an XPathContext.
 * @return a Node as described above.
 */
public static Node checkEnvironment(ExpressionContext myContext)
{

  Document factoryDocument = getDocument();

  Node resultNode = null;
  try
  {
    // First use reflection to try to load Which, which is a
    //  better version of EnvironmentCheck
    resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);

    if (null != resultNode)
      return resultNode;

    // If reflection failed, fallback to our internal EnvironmentCheck
    EnvironmentCheck envChecker = new EnvironmentCheck();
    Map<String, Object> h = envChecker.getEnvironmentHash();
    resultNode = factoryDocument.createElement("checkEnvironmentExtension");
    envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
    envChecker = null;
  }
  catch(Exception e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }

  return resultNode;
}
 
Example #2
Source File: Extensions.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a Node of basic debugging information from the
 * EnvironmentCheck utility about the Java environment.
 *
 * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
 * utility to grab info about the Java environment and CLASSPATH,
 * etc., and then returns the resulting Node.  Stylesheets can
 * then maniuplate this data or simply xsl:copy-of the Node.  Note
 * that we first attempt to load the more advanced
 * org.apache.env.Which utility by reflection; only if that fails
 * to we still use the internal version.  Which is available from
 * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
 *
 * <p>We throw a WrappedRuntimeException in the unlikely case
 * that reading information from the environment throws us an
 * exception. (Is this really the best thing to do?)</p>
 *
 * @param myContext an <code>ExpressionContext</code> passed in by the
 *                  extension mechanism.  This must be an XPathContext.
 * @return a Node as described above.
 */
public static Node checkEnvironment(ExpressionContext myContext)
{

  Document factoryDocument = getDocument();

  Node resultNode = null;
  try
  {
    // First use reflection to try to load Which, which is a
    //  better version of EnvironmentCheck
    resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);

    if (null != resultNode)
      return resultNode;

    // If reflection failed, fallback to our internal EnvironmentCheck
    EnvironmentCheck envChecker = new EnvironmentCheck();
    Hashtable h = envChecker.getEnvironmentHash();
    resultNode = factoryDocument.createElement("checkEnvironmentExtension");
    envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
    envChecker = null;
  }
  catch(Exception e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }

  return resultNode;
}
 
Example #3
Source File: Extensions.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a Node of basic debugging information from the
 * EnvironmentCheck utility about the Java environment.
 *
 * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
 * utility to grab info about the Java environment and CLASSPATH,
 * etc., and then returns the resulting Node.  Stylesheets can
 * then maniuplate this data or simply xsl:copy-of the Node.  Note
 * that we first attempt to load the more advanced
 * org.apache.env.Which utility by reflection; only if that fails
 * to we still use the internal version.  Which is available from
 * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
 *
 * <p>We throw a WrappedRuntimeException in the unlikely case
 * that reading information from the environment throws us an
 * exception. (Is this really the best thing to do?)</p>
 *
 * @param myContext an <code>ExpressionContext</code> passed in by the
 *                  extension mechanism.  This must be an XPathContext.
 * @return a Node as described above.
 */
public static Node checkEnvironment(ExpressionContext myContext)
{

  Document factoryDocument = getDocument();

  Node resultNode = null;
  try
  {
    // First use reflection to try to load Which, which is a
    //  better version of EnvironmentCheck
    resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);

    if (null != resultNode)
      return resultNode;

    // If reflection failed, fallback to our internal EnvironmentCheck
    EnvironmentCheck envChecker = new EnvironmentCheck();
    Map<String, Object> h = envChecker.getEnvironmentHash();
    resultNode = factoryDocument.createElement("checkEnvironmentExtension");
    envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
    envChecker = null;
  }
  catch(Exception e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }

  return resultNode;
}
 
Example #4
Source File: Extensions.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a Node of basic debugging information from the
 * EnvironmentCheck utility about the Java environment.
 *
 * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
 * utility to grab info about the Java environment and CLASSPATH,
 * etc., and then returns the resulting Node.  Stylesheets can
 * then maniuplate this data or simply xsl:copy-of the Node.  Note
 * that we first attempt to load the more advanced
 * org.apache.env.Which utility by reflection; only if that fails
 * to we still use the internal version.  Which is available from
 * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
 *
 * <p>We throw a WrappedRuntimeException in the unlikely case
 * that reading information from the environment throws us an
 * exception. (Is this really the best thing to do?)</p>
 *
 * @param myContext an <code>ExpressionContext</code> passed in by the
 *                  extension mechanism.  This must be an XPathContext.
 * @return a Node as described above.
 */
public static Node checkEnvironment(ExpressionContext myContext)
{

  Document factoryDocument = getDocument();

  Node resultNode = null;
  try
  {
    // First use reflection to try to load Which, which is a
    //  better version of EnvironmentCheck
    resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);

    if (null != resultNode)
      return resultNode;

    // If reflection failed, fallback to our internal EnvironmentCheck
    EnvironmentCheck envChecker = new EnvironmentCheck();
    Hashtable h = envChecker.getEnvironmentHash();
    resultNode = factoryDocument.createElement("checkEnvironmentExtension");
    envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
    envChecker = null;
  }
  catch(Exception e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }

  return resultNode;
}
 
Example #5
Source File: Extensions.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a Node of basic debugging information from the
 * EnvironmentCheck utility about the Java environment.
 *
 * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
 * utility to grab info about the Java environment and CLASSPATH,
 * etc., and then returns the resulting Node.  Stylesheets can
 * then maniuplate this data or simply xsl:copy-of the Node.  Note
 * that we first attempt to load the more advanced
 * org.apache.env.Which utility by reflection; only if that fails
 * to we still use the internal version.  Which is available from
 * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
 *
 * <p>We throw a WrappedRuntimeException in the unlikely case
 * that reading information from the environment throws us an
 * exception. (Is this really the best thing to do?)</p>
 *
 * @param myContext an <code>ExpressionContext</code> passed in by the
 *                  extension mechanism.  This must be an XPathContext.
 * @return a Node as described above.
 */
public static Node checkEnvironment(ExpressionContext myContext)
{

  Document factoryDocument = getDocument();

  Node resultNode = null;
  try
  {
    // First use reflection to try to load Which, which is a
    //  better version of EnvironmentCheck
    resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);

    if (null != resultNode)
      return resultNode;

    // If reflection failed, fallback to our internal EnvironmentCheck
    EnvironmentCheck envChecker = new EnvironmentCheck();
    Hashtable h = envChecker.getEnvironmentHash();
    resultNode = factoryDocument.createElement("checkEnvironmentExtension");
    envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
    envChecker = null;
  }
  catch(Exception e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }

  return resultNode;
}