things.thinger.kernel.basic
Class KernelBasic_LoaderIDE

java.lang.Object
  extended by things.thinger.kernel.basic.KernelBasic_LoaderIDE
All Implemented Interfaces:
Verbose, Loader

public class KernelBasic_LoaderIDE
extends java.lang.Object
implements Loader, Verbose

A THINGS loader implementation for KernelBasic. This one is meant for IDE usage, so you can let the system classloader find things for you. It makes debugging a lot better. Of course, you lose the recompile on the fly feature.

Version:
1.0 Version History

, 1.0

Version History

EPG - Initial - 8 JUL 07
 
Author:
Erich P. Gatejen, Erich P. Gatejen

Constructor Summary
KernelBasic_LoaderIDE()
           
 
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

KernelBasic_LoaderIDE

public KernelBasic_LoaderIDE()
Method Detail

init

public void init(Universe cacheUniverse,
                 java.lang.String cacheRoot)
          throws SystemException
Initialize the loader. It will clear out any previous configuration, including the added sources. It should be harmless to do this whenever.

Specified by:
init in interface Loader
Parameters:
cacheUniverse - The universe in which to cache.
cacheRoot - The root for cached items.
Throws:
SystemException

addSource

public void addSource(Universe sourceUniverse,
                      java.lang.String sourceRoot)
               throws SystemException
Add a source universe.

Specified by:
addSource in interface Loader
Parameters:
sourceUniverse - The universe from where to load items.
sourceRoot - The root within the universe.
Throws:
SystemException

purge

public void purge()
           throws SystemException
Purge the loader. Any cached things will be dumped. This affects the internal cache only. The compiled cache in the system universe is left alone.

Specified by:
purge in interface Loader
Throws:
SystemException

purgeThing

public void purgeThing(java.lang.String path)
                throws SystemException
Purge a specific thing from the loader. If cached, it will be cleared. This affects the internal cache only. The compiled cache in the system universe is left alone. This will never cause an error, unless there is an init() problem.

Specified by:
purgeThing in interface Loader
Parameters:
path - the path to the item to purge.
Throws:
SystemException

loadThing

public java.lang.Class<THING> loadThing(java.lang.String name)
                                 throws SystemException
Load a THING class. It will take the cached version first.

Specified by:
loadThing in interface Loader
Parameters:
name - to the THING.
Returns:
A class for that thing. This is the binary name and it should reside in one of the registered
Throws:
SystemException
See Also:
THING

loadModule

public java.lang.Class<MODULE> loadModule(java.lang.String name)
                                   throws SystemException
Load a MODULE class.

Specified by:
loadModule in interface Loader
Parameters:
name - the path/name to the MODULE. Depends on the loader being used, but typically it's a classpath.
Returns:
A class for that module.
Throws:
SystemException
See Also:
MODULE

verboseOn

public void verboseOn(StringPoster poster)
               throws ThingsException
Turn on. It will test the poster and will throw a ThingsException if it has a problem.

Specified by:
verboseOn in interface Verbose
Parameters:
poster - StringPoster where to put the debug info
Throws:
ThingsException

verboseOff

public void verboseOff()
Turn off the verbose mode.

Specified by:
verboseOff in interface Verbose

screech

public void screech(java.lang.String message)
Post a verbose message if verbose mode is on. It will never throw an exception. The implementation may find a way to report exceptions.

Specified by:
screech in interface Verbose
Parameters:
message - The message.

isVerbose

public boolean isVerbose()
Is it set to verbose?

Specified by:
isVerbose in interface Verbose
Returns:
true if it is verbose, otherwise false.


Things.