terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.launcher
Class Launcher

java.lang.Object
  extended by com.codemesh.terp.launcher.Launcher

public class Launcher
extends java.lang.Object

This is a launcher for the terp interpreter.

Since:
terp 1.0

Field Summary
protected static int EXIT_CODE_ERROR
          Exit code on trouble
static java.lang.String MAIN_CLASS
          The startup class that is to be run.
static java.lang.String TERP_HOME_PROPERTY
          The terp Home (installation) Directory property.
static java.lang.String TERP_LIBDIR_PROPERTY
          The terp Library Directory property.
static java.lang.String TERP_PRIVATEDIR
          The directory name of the per-user terp directory.
static java.lang.String TERP_PRIVATELIB
          The name of a per-user library directory.
static java.lang.String USER_HOMEDIR
          System property with user home directory.
static java.lang.String USER_LIBDIR
          The location of a per-user library directory.
 
Constructor Summary
Launcher()
           
 
Method Summary
 java.lang.Class locateClass(java.lang.String name)
          Returns a class loaded by the launcher's internal loader or null.
static void main(java.lang.String[] args)
          Entry point for starting command line terp.
 int run(java.lang.String[] args)
          Run the launcher to launch terp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TERP_HOME_PROPERTY

public static final java.lang.String TERP_HOME_PROPERTY
The terp Home (installation) Directory property. "terp.home"

See Also:
Constant Field Values

TERP_LIBDIR_PROPERTY

public static final java.lang.String TERP_LIBDIR_PROPERTY
The terp Library Directory property. "terp.library.dir"

See Also:
Constant Field Values

TERP_PRIVATEDIR

public static final java.lang.String TERP_PRIVATEDIR
The directory name of the per-user terp directory. ".terp"

See Also:
Constant Field Values

TERP_PRIVATELIB

public static final java.lang.String TERP_PRIVATELIB
The name of a per-user library directory. "lib"

See Also:
Constant Field Values

USER_LIBDIR

public static final java.lang.String USER_LIBDIR
The location of a per-user library directory.

It's value is the concatenation of TERP_PRIVATEDIR with TERP_PRIVATELIB, with an appropriate file separator in between. For example, on Unix, it's .terp/lib.


MAIN_CLASS

public static final java.lang.String MAIN_CLASS
The startup class that is to be run. "com.codemesh.terp.Main"

See Also:
Constant Field Values

USER_HOMEDIR

public static final java.lang.String USER_HOMEDIR
System property with user home directory. "user.home"

See Also:
Constant Field Values

EXIT_CODE_ERROR

protected static final int EXIT_CODE_ERROR
Exit code on trouble

See Also:
Constant Field Values
Constructor Detail

Launcher

public Launcher()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for starting command line terp.

Parameters:
args - commandline arguments

locateClass

public java.lang.Class locateClass(java.lang.String name)
Returns a class loaded by the launcher's internal loader or null. This method is useful in in-process testing because it grants access to types that would otherwise be inaccessible.

Parameters:
name - the classname.
Returns:
the class instance or null.

run

public int run(java.lang.String[] args)
        throws LaunchException,
               java.net.MalformedURLException
Run the launcher to launch terp.

Parameters:
args - the command line arguments
Returns:
an exit code. As the normal terp main calls exit when it ends, this is for handling failures at bind-time
Throws:
java.net.MalformedURLException - if the URLs required for the classloader cannot be created.
LaunchException - if the URLs required for the classloader cannot be created.

terp - the Codemesh Modular
Template Interpreter v1.3.309

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