things.thinger.kernel.basic
Class KernelBasicBase

java.lang.Object
  extended by java.lang.Thread
      extended by things.thinger.kernel.ThingsProcess
          extended by things.thinger.kernel.basic.KernelBasicBase
All Implemented Interfaces:
java.lang.Runnable, Verbose, KernelBasic_Constants, ControlInterface, ProcessInterface, ResourceListener, SystemInterface, SystemSuperInterface
Direct Known Subclasses:
KernelBasic

public abstract class KernelBasicBase
extends ThingsProcess
implements SystemSuperInterface, KernelBasic_Constants

Implements underlying Kernel functionality.

- Bootstrap a property set for global properties.
- Start a list of services.

There are a set of required properties during bootstrap.

 USER_FILESYSTEM_ROOT
 SYSTEM_FILESYSTEM_ROOT
 LOGGING_LEVE
 

User property prunes are separated by their processId.toTag() in their paths.

It does not implement the System Interfaces.

Version:
1.0

Version History

 EPG - Initial - 12 JUN 05
 EPG - Split base and main - 6 FEB 06
 
Author:
Erich P. Gatejen

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  StringPoster bootstrapLogger
           
protected  KernelBasic_WriterLogger_Factory config_LOGGING_FACTORY_IMPLEMENTATION
           
protected  Logger.LEVEL config_LOGGING_LEVEL
           
protected  java.lang.String config_SYSTEM_FILESYSTEM_ROOT
           
protected  java.lang.String config_USER_FILESYSTEM_ROOT
           
protected  java.util.HashMap<WhoAmI,java.lang.String> cullPropsOnDeathMap
           
protected  java.util.List<WhoAmI> deathList
           
protected  java.lang.Object deathWatchMonitor
           
protected  KernelBasic_WriterLogger kernelLogger
           
protected  WhoAmI kernelSpaceID
           
protected  StoplightMonitor kernelStoplight
           
protected  java.util.HashMap<java.lang.String,Service> loadedServiceList
           
protected  Loader loader
           
protected  java.util.HashMap<WhoAmI,Logger> localPropertyCache
           
protected  java.util.HashMap<java.lang.String,Logger> loggerCache
           
protected  java.util.HashMap<java.lang.String,FileSystemLocator> loggerFileMap
           
protected  ThingsPropertyReaderToolkit myGlobalPropertiesKit
           
protected  ThingsPropertyTree myGlobalPropertiesTree
           
protected  ThingsPropertyView myGlobalPropertiesViewRoot
           
protected  java.util.concurrent.atomic.AtomicInteger pcbNumber
           
protected  ProcessCoordinator processes
           
protected  ResourceCoordinator resources
           
protected  ThingsPropertyView sharedGlobalPropertiesView
           
protected static int START_PROCESSED_ID
           
protected  DeadDropRendezvous<java.lang.Throwable> startupRendezvous
           
protected  BasicConduitController systemConduits
           
protected  AFileSystem systemFilesystem
           
protected  Universe systemUniverse
           
protected  UniverseRegistry universeRegistry
           
protected  AFileSystem userFilesystem
           
protected  ThingsPropertyView userGlobalConfigView
           
protected  ThingsPropertyView userGlobalPropertiesView
           
protected  WhoAmI userSpaceID
           
protected  Universe userUniverse
           
protected  boolean verbose
           
 
Fields inherited from class things.thinger.kernel.ThingsProcess
DEFAULT_NAME, internalResult, myPostLogger, ssi
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface things.thinger.SystemInterface
DEFAULT_REPORTING_THRESHOLD
 
Fields inherited from interface things.thinger.kernel.basic.KernelBasic_Constants
CHANNEL_SYSTEM_BACKBONE, CONFIG_DIRECTORY, CORE_SERVICES, CORE_SERVICES_suffix_CLASS, CORE_SERVICES_suffix_LOCAL, CORE_SERVICES_suffix_NAME, DEBUGGING_IDE, DEFAULT_KERNEL_CLEARANCE, DEFAULT_LOGGING_FACTORY_IMPLEMENTATION, DEFAULT_SERVICE_CLEARANCE, DEFAULT_UNIVERSE_CONFIG, DEFAULT_USER_CLEARANCE, ID_SEPERATOR, KERNEL_ID_STRING, KERNEL_ID_TAG, KERNEL_LOG_PATH, KERNEL_RUNTIME_SLEEP_INTERVAL, KERNEL_SHUTDOWN__SWEEPS, LOG_DIRECTORY, LOG_SUFFIX, LOGGING_FACTORY_IMPLEMENTATION, LOGGING_LEVEL, PROCESS_ID_STRING_PREFIX, PROCESS_ID_TAG_PREFIX, RESOURCENAME_LOGGER_PREFIX, SERVICE_ID_STRING_PREFIX, SERVICE_ID_TAG_PREFIX, SERVICE_LOG_PREFIX, SHARED_ROOT_GLOBAL_SPACE, SYSTEM_FILESYSTEM_ROOT, THINGS_CACHE_LOCATION, THINGS_UNIVERSE_LOCATION_PLY, UNIVERSE_SYSTEM_DEFAULT_NAME_CONFIG, UNIVERSE_USER_DEFAULT_NAME_CONFIG, USER_FILESYSTEM_ROOT, USER_LOG_PREFIX, USER_ROOT, USER_ROOT_CONFIGURED_SPACE, USER_ROOT_GLOBAL_SPACE, USER_ROOT_PROCESS_SPACE, USER_suffix_KERNEL_NAME, USERSPACE_ID_STRING, USERSPACE_ID_TAG
 
Constructor Summary
KernelBasicBase()
           
 
Method Summary
 void bootstrap(boolean verboseMode, StringPoster bootstrapLoggerPoster, ThingsPropertyTree globalPropertiesTree)
          BOOTSTRAP.
 void constructThingsProcess()
          Complete construction.
 void destructThingsProcess()
          Destroy.
 void executeThingsProcess()
          This is the entry point for the actual processing
protected  ResourceManager forgeLogger(WhoAmI owner, AFileSystem fileSystem, java.lang.String path)
          Create a file logger from the current factory and put it in a resource manager.
 WhoAmI getListenerId()
          Get the ID of the listener.
 java.lang.String getProcessName()
          Get process name.
 void resourceRevocation(WhoAmI resourceID)
          The identified resource is in the process of being revoked.
 void resourceRevoked(WhoAmI resourceID)
          The identified resource bas been revoked.
 
Methods inherited from class things.thinger.kernel.ThingsProcess
acceptHalt, acceptPause, finalize, fix, forceFinalize, forceHalt, getCurrentState, getCurrentStateNumeric, getProcessId, getResult, getStartTime, getThingsState, init, isVerbose, release, releasePause, requestHalt, requestPause, run, screech, verboseOff, verboseOn
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface things.thinger.SystemSuperInterface
deathNotice, flingException, getConfigPropertiesWritable, getGlobalProperties, getLocalProperties, getSystemConduits, getUserGlobalProperties, registerProcess, requestQuit, startProcess, startProcess
 
Methods inherited from interface things.thinger.SystemInterface
getCallingProcessId, getConfigProperties, getLocalProperties, getLocalPropertiesImplementation, getLogLocal, getNamedExpressor, getNamedLogger, getProcessInterface, getProcessList, getProcessState, getSharedProperties, getSystemLogger, getUniverse, loadModule, loadThing, requestSuperSystemInterface, runThing, runThing, runThing, waitProcessDone
 

Field Detail

myGlobalPropertiesTree

protected ThingsPropertyTree myGlobalPropertiesTree

myGlobalPropertiesViewRoot

protected ThingsPropertyView myGlobalPropertiesViewRoot

myGlobalPropertiesKit

protected ThingsPropertyReaderToolkit myGlobalPropertiesKit

userGlobalPropertiesView

protected ThingsPropertyView userGlobalPropertiesView

userGlobalConfigView

protected ThingsPropertyView userGlobalConfigView

sharedGlobalPropertiesView

protected ThingsPropertyView sharedGlobalPropertiesView

loadedServiceList

protected java.util.HashMap<java.lang.String,Service> loadedServiceList

processes

protected ProcessCoordinator processes

pcbNumber

protected java.util.concurrent.atomic.AtomicInteger pcbNumber

verbose

protected boolean verbose

deathList

protected java.util.List<WhoAmI> deathList

cullPropsOnDeathMap

protected java.util.HashMap<WhoAmI,java.lang.String> cullPropsOnDeathMap

bootstrapLogger

protected StringPoster bootstrapLogger

kernelLogger

protected KernelBasic_WriterLogger kernelLogger

kernelSpaceID

protected WhoAmI kernelSpaceID

userSpaceID

protected WhoAmI userSpaceID

startupRendezvous

protected DeadDropRendezvous<java.lang.Throwable> startupRendezvous

kernelStoplight

protected StoplightMonitor kernelStoplight

loader

protected Loader loader

config_USER_FILESYSTEM_ROOT

protected java.lang.String config_USER_FILESYSTEM_ROOT

config_SYSTEM_FILESYSTEM_ROOT

protected java.lang.String config_SYSTEM_FILESYSTEM_ROOT

config_LOGGING_LEVEL

protected Logger.LEVEL config_LOGGING_LEVEL

config_LOGGING_FACTORY_IMPLEMENTATION

protected KernelBasic_WriterLogger_Factory config_LOGGING_FACTORY_IMPLEMENTATION

resources

protected ResourceCoordinator resources

systemConduits

protected BasicConduitController systemConduits

deathWatchMonitor

protected java.lang.Object deathWatchMonitor

userFilesystem

protected AFileSystem userFilesystem

systemFilesystem

protected AFileSystem systemFilesystem

universeRegistry

protected UniverseRegistry universeRegistry

systemUniverse

protected Universe systemUniverse

userUniverse

protected Universe userUniverse

loggerCache

protected java.util.HashMap<java.lang.String,Logger> loggerCache

loggerFileMap

protected java.util.HashMap<java.lang.String,FileSystemLocator> loggerFileMap

localPropertyCache

protected java.util.HashMap<WhoAmI,Logger> localPropertyCache

START_PROCESSED_ID

protected static final int START_PROCESSED_ID
See Also:
Constant Field Values
Constructor Detail

KernelBasicBase

public KernelBasicBase()
                throws SystemException
Throws:
SystemException
Method Detail

bootstrap

public void bootstrap(boolean verboseMode,
                      StringPoster bootstrapLoggerPoster,
                      ThingsPropertyTree globalPropertiesTree)
               throws SystemException
BOOTSTRAP. This will start the kernel process. It will not return until the Kernel quits.

Parameters:
verboseMode - the verbosity mode for system internal messages. The default is false.
bootstrapLoggerPoster - String poster for low-level system logging.
globalPropertiesTree - A view to global properties.
Throws:
SystemException

executeThingsProcess

public void executeThingsProcess()
                          throws SystemException
This is the entry point for the actual processing

Specified by:
executeThingsProcess in class ThingsProcess
Throws:
SystemException

constructThingsProcess

public void constructThingsProcess()
                            throws SystemException
Complete construction. This will be called when the process is initialized.

Specified by:
constructThingsProcess in class ThingsProcess
Throws:
SystemException

destructThingsProcess

public void destructThingsProcess()
                           throws SystemException
Destroy. This will be called when the Process is finalizing.

Specified by:
destructThingsProcess in class ThingsProcess
Throws:
SystemException

getProcessName

public java.lang.String getProcessName()
Get process name. It does not have to be a unique ID.

Specified by:
getProcessName in interface ProcessInterface
Specified by:
getProcessName in class ThingsProcess
Returns:
the name as a String

resourceRevocation

public void resourceRevocation(WhoAmI resourceID)
                        throws SystemException,
                               java.lang.InterruptedException
Description copied from interface: ResourceListener
The identified resource is in the process of being revoked. It is still possible for the resource listener to call the resource within the context of this thread and call.

Specified by:
resourceRevocation in interface ResourceListener
Parameters:
resourceID - the ID of the resource that is being revoked.
Throws:
SystemException
java.lang.InterruptedException
See Also:
WhoAmI

resourceRevoked

public void resourceRevoked(WhoAmI resourceID)
                     throws SystemException,
                            java.lang.InterruptedException
Description copied from interface: ResourceListener
The identified resource bas been revoked. It is gone. Attempting to call it would be a very bad thing. The listener should remove the resource from it's internal lists..

Specified by:
resourceRevoked in interface ResourceListener
Parameters:
resourceID - the ID of the resource that has been revoked.
Throws:
SystemException
java.lang.InterruptedException
See Also:
WhoAmI

getListenerId

public WhoAmI getListenerId()
Description copied from interface: ResourceListener
Get the ID of the listener.

Specified by:
getListenerId in interface ResourceListener
Returns:
The listener's ID.
See Also:
WhoAmI

forgeLogger

protected ResourceManager forgeLogger(WhoAmI owner,
                                      AFileSystem fileSystem,
                                      java.lang.String path)
                               throws SystemException
Create a file logger from the current factory and put it in a resource manager.

Throws:
SystemException


Things.