Logo Search packages:      
Sourcecode: velocity version File versions  Download package

org::apache::velocity::runtime::RuntimeInstance Class Reference

Inheritance diagram for org::apache::velocity::runtime::RuntimeInstance:

org::apache::velocity::runtime::RuntimeConstants org::apache::velocity::runtime::RuntimeServices org::apache::velocity::runtime::RuntimeLogger

List of all members.


Detailed Description

This is the Runtime system for Velocity. It is the single access point for all functionality in Velocity. It adheres to the mediator pattern and is the only structure that developers need to be familiar with in order to get Velocity to perform.

The Runtime will also cooperate with external systems like Turbine. Runtime properties can set and then the Runtime is initialized.

Turbine, for example, knows where the templates are to be loaded from, and where the Velocity log file should be placed.

So in the case of Velocity cooperating with Turbine the code might look something like the following:

<blockquote>

 ri.setProperty(Runtime.FILE_RESOURCE_LOADER_PATH, templatePath);
 ri.setProperty(Runtime.RUNTIME_LOG, pathToVelocityLog);
 ri.init();
 
</blockquote>

 -----------------------------------------------------------------------
 N O T E S  O N  R U N T I M E  I N I T I A L I Z A T I O N
 -----------------------------------------------------------------------
 init()

 If init() is called by itself the RuntimeInstance will initialize
 with a set of default values.
 -----------------------------------------------------------------------
 init(String/Properties)

 In this case the default velocity properties are layed down
 first to provide a solid base, then any properties provided
 in the given properties object will override the corresponding
 default property.
 -----------------------------------------------------------------------
 

Author:
Jason van Zyl

Jeff Bowden

Geir Magusson Jr.

Version:
Id
RuntimeInstance.java,v 1.19.4.1 2004/03/03 23:22:55 geirm Exp

Definition at line 106 of file RuntimeInstance.java.


Public Member Functions

void addProperty (String key, Object value)
boolean addVelocimacro (String name, String macro, String argArray[], String sourceTemplate)
void clearProperty (String key)
Parser createNewParser ()
void debug (Object message)
boolean dumpVMNamespace (String namespace)
void error (Object message)
Object getApplicationAttribute (Object key)
boolean getBoolean (String key, boolean def)
ExtendedProperties getConfiguration ()
ContentResource getContent (String name, String encoding) throws ResourceNotFoundException, ParseErrorException, Exception
ContentResource getContent (String name) throws ResourceNotFoundException, ParseErrorException, Exception
int getInt (String key, int defaultValue)
int getInt (String key)
Introspector getIntrospector ()
String getLoaderNameForResource (String resourceName)
Object getProperty (String key)
String getString (String key)
String getString (String key, String defaultValue)
Template getTemplate (String name, String encoding) throws ResourceNotFoundException, ParseErrorException, Exception
Template getTemplate (String name) throws ResourceNotFoundException, ParseErrorException, Exception
Uberspect getUberspect ()
Directive getVelocimacro (String vmName, String templateName)
void info (Object message)
void init (String configurationFile) throws Exception
void init (Properties p) throws Exception
synchronized void init () throws Exception
boolean isVelocimacro (String vmName, String templateName)
SimpleNode parse (Reader reader, String templateName, boolean dumpNamespace) throws ParseException
SimpleNode parse (Reader reader, String templateName) throws ParseException
Object setApplicationAttribute (Object key, Object o)
void setConfiguration (ExtendedProperties configuration)
void setProperty (String key, Object value)
void warn (Object message)

Static Public Attributes

static final String COUNTER_INITIAL_VALUE
static final String COUNTER_NAME
static final String DEBUG_PREFIX = " [debug] "
static final String DEFAULT_RUNTIME_DIRECTIVES
static final String DEFAULT_RUNTIME_PROPERTIES
static final String ENCODING_DEFAULT = "ISO-8859-1"
static final String ERROR_PREFIX = " [error] "
static String ERRORMSG_END
static String ERRORMSG_START
static final String FILE_RESOURCE_LOADER_CACHE
static final String FILE_RESOURCE_LOADER_PATH
static final String INFO_PREFIX = " [info] "
static final String INPUT_ENCODING = "input.encoding"
static String INTERPOLATE_STRINGLITERALS
static final String LOGSYSTEM_LOG4J_EMAIL_BUFFER_SIZE
static final String LOGSYSTEM_LOG4J_EMAIL_FROM
static final String LOGSYSTEM_LOG4J_EMAIL_SERVER
static final String LOGSYSTEM_LOG4J_EMAIL_SUBJECT
static final String LOGSYSTEM_LOG4J_EMAIL_TO
static final String LOGSYSTEM_LOG4J_FILE_BACKUPS
static final String LOGSYSTEM_LOG4J_FILE_SIZE
static final String LOGSYSTEM_LOG4J_PATTERN
static final String LOGSYSTEM_LOG4J_REMOTE_HOST
static final String LOGSYSTEM_LOG4J_REMOTE_PORT
static final String LOGSYSTEM_LOG4J_SYSLOGD_FACILITY
static final String LOGSYSTEM_LOG4J_SYSLOGD_HOST
static final int NUMBER_OF_PARSERS = 20
static final String OUTPUT_ENCODING = "output.encoding"
static String PARSE_DIRECTIVE_MAXDEPTH = "directive.parse.max.depth"
static final String PARSER_POOL_SIZE = "parser.pool.size"
static final String RESOURCE_LOADER = "resource.loader"
static String RESOURCE_MANAGER_CACHE_CLASS
static String RESOURCE_MANAGER_CLASS = "resource.manager.class"
static final String RESOURCE_MANAGER_LOGWHENFOUND
static final String RUNTIME_LOG
static final String RUNTIME_LOG_ERROR_STACKTRACE
static final String RUNTIME_LOG_INFO_STACKTRACE
static final String RUNTIME_LOG_LOGSYSTEM
static final String RUNTIME_LOG_LOGSYSTEM_CLASS
static final String RUNTIME_LOG_REFERENCE_LOG_INVALID
static final String RUNTIME_LOG_WARN_STACKTRACE
static final String UBERSPECT_CLASSNAME = "runtime.introspector.uberspect"
static final String UNKNOWN_PREFIX = " [unknown] "
static final String VM_CONTEXT_LOCALSCOPE
static final String VM_LIBRARY = "velocimacro.library"
static final String VM_LIBRARY_AUTORELOAD
static final String VM_MESSAGES_ON = "velocimacro.messages.on"
static final String VM_PERM_ALLOW_INLINE
static final String VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL
static final String VM_PERM_INLINE_LOCAL
static final String WARN_PREFIX = " [warn] "

Private Member Functions

void initializeDirectives () throws Exception
void initializeIntrospection () throws Exception
void initializeLogger () throws Exception
void initializeParserPool ()
void initializeProperties ()
void initializeResourceManager () throws Exception
void loadDirective (String directiveClass, String caption)
void log (int level, Object message)
void setDefaultProperties ()
boolean showStackTrace ()

Private Attributes

Map applicationAttributes = null
ExtendedProperties configuration = new ExtendedProperties()
boolean initialized
Introspector introspector = null
LogSystem logSystem = new PrimordialLogSystem()
ExtendedProperties overridingProperties = null
SimplePool parserPool
ResourceManager resourceManager = null
Hashtable runtimeDirectives
Uberspect uberSpect
VelocimacroFactory vmFactory = null

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index