|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.thinger.kernel.basic.KernelBasic_Loader
public class KernelBasic_Loader
A THINGS loader implementation for KernelBasic. This one will always take the cached version, even if it is aged.
It also load modules, but we do not allow the loader to compile new versions. The modules need to be in the classpath. I'll add the dynamic loading later it if it becomes desirable.
There is a lot of extra stuff here for more dynamic class management and caching. Of course, java isn't a big fan of multiple versions of the same named class, so I don't know if I'll ever get around to playing with it.
To be honest, this never really worked right. The library compiler and command line compiler named the inner classes differently, causing mayhem when encountered with a mix-match of dependent classes with inner classes. It is all fixable, but it just wasn't important at the time. I don't know anyone that actually used the dynamic loading anyway. (Too bad, because that was part of the reason for building a new kernel in the first place.
Trying to mesh the library compiler with the abstract universe was a gigantic pain in the ass. Thus was born the 'makeLocal' methods, which was a very unfortunate compromise. To a large degree, this one class alone might lead me to abandon Java for future personal projects.
Version History
EPG - Initial - 8 JUL 07
Constructor Summary | |
---|---|
KernelBasic_Loader()
Constructor. |
Method Summary | |
---|---|
void |
addSource(Universe sourceUniverse,
java.lang.String sourceRoot)
Add a source universe. |
void |
init(Universe cacheUniverse,
java.lang.String cacheRoot)
Initialize the loader. |
boolean |
isVerbose()
Is it set to verbose? |
java.lang.Class<MODULE> |
loadModule(java.lang.String name)
Load a MODULE class. |
java.lang.Class<THING> |
loadThing(java.lang.String name)
Load a THING class. |
void |
purge()
Purge the loader. |
void |
purgeThing(java.lang.String path)
Purge a specific thing from the loader. |
void |
screech(java.lang.String message)
Post a verbose message if verbose mode is on. |
void |
verboseOff()
Turn off the verbose mode. |
void |
verboseOn(StringPoster poster)
Turn on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KernelBasic_Loader() throws SystemException
SystemException
Method Detail |
---|
public void init(Universe cacheUniverse, java.lang.String cacheRoot) throws SystemException
init
in interface Loader
cacheUniverse
- The universe in which to cache.cacheRoot
- The root for cached items.
SystemException
public void addSource(Universe sourceUniverse, java.lang.String sourceRoot) throws SystemException
addSource
in interface Loader
sourceUniverse
- The universe from where to load items.sourceRoot
- The root within the universe.
SystemException
public void purge() throws SystemException
purge
in interface Loader
SystemException
public void purgeThing(java.lang.String path) throws SystemException
purgeThing
in interface Loader
path
- the path to the item to purge.
SystemException
public java.lang.Class<THING> loadThing(java.lang.String name) throws SystemException
loadThing
in interface Loader
name
- to the THING.
SystemException
THING
public java.lang.Class<MODULE> loadModule(java.lang.String name) throws SystemException
loadModule
in interface Loader
name
- the name/path to the MODULE. Depends on the loader being used, but typically it's a classpath.
SystemException
MODULE
public void verboseOn(StringPoster poster) throws ThingsException
verboseOn
in interface Verbose
poster
- StringPoster where to put the debug info
ThingsException
public void verboseOff()
verboseOff
in interface Verbose
public void screech(java.lang.String message)
screech
in interface Verbose
message
- The message.public boolean isVerbose()
isVerbose
in interface Verbose
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |