Package helma.framework.core
Class TypeManager
- java.lang.Object
-
- helma.framework.core.TypeManager
-
public final class TypeManager extends java.lang.Object
The type manager periodically checks the prototype definitions for its applications and updates the evaluators if anything has changed.
-
-
Constructor Summary
Constructors Constructor Description TypeManager(Application app, java.lang.String ignore)
Creates a new TypeManager object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPrototypes()
Run through application's prototype directories and check if anything has been updated.protected void
checkRepository(Repository repository, boolean update)
Prototype
createPrototype(java.lang.String typename, Repository repository, java.util.Map typeProps)
Create and register a new Prototype.void
createPrototypes()
Run through application's prototype directories and create prototypes, but don't compile or evaluate any scripts.java.lang.ClassLoader
getClassLoader()
Return the class loader used by this application.long
getLastCodeUpdate()
Returns the last time any resource in this app was modified.Prototype
getPrototype(java.lang.String typename)
Get a prototype defined for this applicationjava.util.Collection
getPrototypes()
Return a collection containing the prototypes defined for this type manager.void
setLastCodeUpdate(long update)
Set the last time any resource in this app was modified.
-
-
-
Constructor Detail
-
TypeManager
public TypeManager(Application app, java.lang.String ignore)
Creates a new TypeManager object.- Parameters:
app
- ...- Throws:
java.lang.RuntimeException
- ...
-
-
Method Detail
-
createPrototypes
public void createPrototypes() throws java.io.IOException
Run through application's prototype directories and create prototypes, but don't compile or evaluate any scripts.- Throws:
java.io.IOException
-
checkPrototypes
public void checkPrototypes() throws java.io.IOException
Run through application's prototype directories and check if anything has been updated. If so, update prototypes and scripts.- Throws:
java.io.IOException
-
checkRepository
protected void checkRepository(Repository repository, boolean update) throws java.io.IOException
- Throws:
java.io.IOException
-
getLastCodeUpdate
public long getLastCodeUpdate()
Returns the last time any resource in this app was modified. This can be used to find out quickly if any file has changed.
-
setLastCodeUpdate
public void setLastCodeUpdate(long update)
Set the last time any resource in this app was modified.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Return the class loader used by this application.- Returns:
- the ClassLoader
-
getPrototypes
public java.util.Collection getPrototypes()
Return a collection containing the prototypes defined for this type manager.- Returns:
- a collection containing the prototypes
-
getPrototype
public Prototype getPrototype(java.lang.String typename)
Get a prototype defined for this application
-
createPrototype
public Prototype createPrototype(java.lang.String typename, Repository repository, java.util.Map typeProps)
Create and register a new Prototype.- Parameters:
typename
- the name of the prototyperepository
- the first prototype sourcetypeProps
- custom type mapping properties- Returns:
- the newly created prototype
-
-