terp - the Codemesh Modular
Template Interpreter v1.3.337

com.codemesh.terp.data
Class Jre.Impl

java.lang.Object
  extended by com.codemesh.terp.data.Jre.Impl
All Implemented Interfaces:
Named, Jre, Versioned, java.io.Serializable, java.lang.Comparable<Jre>
Enclosing interface:
Jre

public static class Jre.Impl
extends java.lang.Object
implements Jre

An implementation of the Jre interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.data.Jre
Jre.Impl
 
Field Summary
protected static java.util.Set<Jre> ALL_JRES
           
protected static boolean bIsMacOS
           
protected static boolean bIsWindows
           
protected  JavaExecutor java
           
protected static java.lang.String JAVA_EXE_NAME
           
protected static java.lang.String JAVAC_EXE_NAME
           
protected  Jdk jdk
           
protected  java.io.File jreHome
           
protected  CaseInsensitiveTreeMap<java.lang.String> properties
           
protected  Path sysClassPath
           
protected static OS theOS
           
protected static ToFile TO_FILE
           
protected static ToString TO_STRING
           
protected static ToVersion TO_VERSION
           
 
Fields inherited from interface com.codemesh.terp.data.Jre
DIR, HOME_DIR, MAKER, VERSION
 
Constructor Summary
protected Jre.Impl()
           
 
Method Summary
 int compareTo(Jre o)
          
 boolean equals(java.lang.Object o)
          
static Jre fromMap(java.util.Map<java.lang.String,java.lang.Object> map)
           
static java.util.Set<Jre> getAll()
           
 java.io.File getDir()
          Returns the JRE's home directory.
 java.io.File getHomeDir()
          Returns the JRE's home directory.
 JavaExecutor getJava()
          Returns the java executor.
 Jdk getJdk()
          Returns the JRE's JDK or null if it does not belong to a JDK.
 java.io.File[] getJvmLibraries(java.lang.Object os, java.lang.Object pa)
          Returns an array of shared library representing the JVM's main modules.
 Path getJvmLibraryPath(java.io.File jvm)
          Returns a path suitable as a dynamic library (LD_LIBRARY_PATH) when running a JNI application with this JRE.
 java.lang.String getMaker()
          Returns a code for the maker of the JRE.
 java.lang.String getName()
          Returns the named object's name.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Returns the properties defined for this runtime.
 java.lang.String getProperty(java.lang.String name)
          Returns the value of the requested Java runtime property.
 Path getSystemClassPath()
          Returns the system classpath of the JRE.
 Version getVersion()
          Returns the JRE's version.
 int hashCode()
          
static void populate()
           
 void setMaker(java.lang.String maker)
          Sets the JRE's maker code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jreHome

protected java.io.File jreHome

java

protected JavaExecutor java

properties

protected CaseInsensitiveTreeMap<java.lang.String> properties

jdk

protected Jdk jdk

sysClassPath

protected Path sysClassPath

TO_FILE

protected static final ToFile TO_FILE

TO_STRING

protected static final ToString TO_STRING

TO_VERSION

protected static final ToVersion TO_VERSION

JAVA_EXE_NAME

protected static final java.lang.String JAVA_EXE_NAME

JAVAC_EXE_NAME

protected static final java.lang.String JAVAC_EXE_NAME

ALL_JRES

protected static final java.util.Set<Jre> ALL_JRES

theOS

protected static final OS theOS

bIsWindows

protected static final boolean bIsWindows

bIsMacOS

protected static final boolean bIsMacOS
Constructor Detail

Jre.Impl

protected Jre.Impl()
Method Detail

getAll

public static java.util.Set<Jre> getAll()

fromMap

public static Jre fromMap(java.util.Map<java.lang.String,java.lang.Object> map)

populate

public static void populate()

compareTo

public int compareTo(Jre o)

Specified by:
compareTo in interface java.lang.Comparable<Jre>

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getDir

public java.io.File getDir()
Returns the JRE's home directory. This is an alias for Jre.getHomeDir().

Specified by:
getDir in interface Jre
Returns:
the home directory.

getHomeDir

public java.io.File getHomeDir()
Returns the JRE's home directory. This is an alias for Jre.getDir().

Specified by:
getHomeDir in interface Jre
Returns:
the home directory.

getSystemClassPath

public Path getSystemClassPath()
Returns the system classpath of the JRE. The system classpath is the path that contains all the built-in Java types (e.g. java.lang.Object) that you don't have to specify on the application's classpath. By using a certain version of Java, these classes are automatically made available. Normally, the system classpath consists of a set of jar files in the JRE's lib directory.

Specified by:
getSystemClassPath in interface Jre
Returns:
the built-in classpath of the JRE.
See Also:
Jdk.getToolsClassPath()

setMaker

public void setMaker(java.lang.String maker)
Sets the JRE's maker code.

Specified by:
setMaker in interface Jre
Parameters:
maker - the maker code.
See Also:
for a list of supported codes.

getMaker

public java.lang.String getMaker()
Returns a code for the maker of the JRE. Currently supported maker codes include: sun, ibm, oracle, and bea.

Specified by:
getMaker in interface Jre
Returns:
the maker code.

getJvmLibraries

public java.io.File[] getJvmLibraries(java.lang.Object os,
                                      java.lang.Object pa)
Returns an array of shared library representing the JVM's main modules. Main modules are typically named jvm.dll or libjvm.so or some such name and they can be available in different flavors (server, client, etc.).

Specified by:
getJvmLibraries in interface Jre
Parameters:
os - the operating system.
pa - the processor architecture.
Returns:
an array of files that might be empty if no such library can be found.

getJvmLibraryPath

public Path getJvmLibraryPath(java.io.File jvm)
Returns a path suitable as a dynamic library (LD_LIBRARY_PATH) when running a JNI application with this JRE.

Specified by:
getJvmLibraryPath in interface Jre
Parameters:
jvm - the JVM main module for which we want a path.
Returns:
a path that might be empty.

getJava

public JavaExecutor getJava()
Returns the java executor.

Specified by:
getJava in interface Jre
Returns:
an executor for the Java executor associated with this JRE instance.

getJdk

public Jdk getJdk()
Returns the JRE's JDK or null if it does not belong to a JDK.

Specified by:
getJdk in interface Jre
Returns:
a JDK to which the JRE belongs.

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Returns the properties defined for this runtime.

Specified by:
getProperties in interface Jre
Returns:
the runtime properties.

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the value of the requested Java runtime property.

Specified by:
getProperty in interface Jre
Parameters:
name - the property name.
Returns:
the requested property value.

getVersion

public Version getVersion()
Returns the JRE's version.

Specified by:
getVersion in interface Jre
Specified by:
getVersion in interface Versioned
Returns:
the JRE's version.

getName

public java.lang.String getName()
Description copied from interface: Named
Returns the named object's name.

Specified by:
getName in interface Named
Returns:
the name.

terp - the Codemesh Modular
Template Interpreter v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.