autohit.server
Interface SystemContext

All Known Implementing Classes:
SimpleSystemContext

public interface SystemContext

A system context interface. A context contains the cummulative knowledge of a system. It will return references to various subsystems. All the subsystems should be thread safe, though only the core and universe provide methods and services specifically intended for IPC communication.

 Each will have references to:
  - A system properties set
  - A universe factory
  - A default universe
  - A root logger and log manager
  - A uninitialized Kernel
  - A uninitialized root loader
  - An invoker properties set
 

Version:
1.0 Version History EPG - Initial - 25Apr03 EPG - Add the invoker properties - 30Jul03
Author:
Erich P. Gatejen

Method Summary
 boolean debuggingState()
          Get debugging state
 CommandRegistry getCommandRegistry()
          Get the command registry.
 XmlCompiler getCompiler()
          Get the XML compiler.
 Injector getEventDispatcher()
          Get event dispatcher injector
 org.apache.commons.collections.ExtendedProperties getInvokerProperties()
          Get a reference to the invoker properties set.
 Kernel getKernel()
          Get the Kernel
 VMLoader getLoader()
          Get the VM Loader
 AutohitBasicLogManager getLogManager()
          Get log manager
 org.apache.commons.collections.ExtendedProperties getPropertiesSet()
          Get properties set.
 AutohitLogInjectorWrapper getRootLogger()
          Get a reference to a generic, root log injector
 Universe getUniverse()
          Get the default universe.
 Universe getUniverse(java.lang.String handle)
          Get a universe service by handle.
 void init(org.apache.commons.collections.ExtendedProperties props)
          Initialize using a set of properties.
 void loadProperties(org.apache.commons.collections.ExtendedProperties props)
          Load properties.
 int uniqueInteger()
          Unique number
 

Method Detail

init

public void init(org.apache.commons.collections.ExtendedProperties props)
          throws java.lang.Exception
Initialize using a set of properties. It will destroy any previous context. It will build the components as specified in the passed properties.

Parameters:
props - properties set
Throws:
java.lang.Exception

loadProperties

public void loadProperties(org.apache.commons.collections.ExtendedProperties props)
                    throws java.lang.Exception
Load properties. It will only overwrite duplicate properties. It will not change services/components build during an init()!

Parameters:
props - properties set
Throws:
java.lang.Exception

getUniverse

public Universe getUniverse()
Get the default universe. Return null if not available.

Returns:
Universe service interface

getUniverse

public Universe getUniverse(java.lang.String handle)
Get a universe service by handle. Return null if not available. What a handle means is determined by the implemementing class.

Parameters:
handle - handle to the universe
Returns:
Universe service interface

getCompiler

public XmlCompiler getCompiler()
Get the XML compiler. Return null if not available.

Returns:
XmlCompiler base class

getRootLogger

public AutohitLogInjectorWrapper getRootLogger()
Get a reference to a generic, root log injector

Returns:
XmlCompiler base class

getEventDispatcher

public Injector getEventDispatcher()
Get event dispatcher injector

Returns:
Injector reference

getLogManager

public AutohitBasicLogManager getLogManager()
Get log manager

Returns:
reference to the main log manager

getPropertiesSet

public org.apache.commons.collections.ExtendedProperties getPropertiesSet()
Get properties set. Return null if not available.

Returns:
reference to the properties set

getKernel

public Kernel getKernel()
Get the Kernel

Returns:
reference to the kernel

getLoader

public VMLoader getLoader()
Get the VM Loader

Returns:
reference to the kernel

getCommandRegistry

public CommandRegistry getCommandRegistry()
Get the command registry. It is up to the implimentor as how to do this. It is not cached.

Returns:
a command registry instance

uniqueInteger

public int uniqueInteger()
Unique number

Returns:
an integer number unique (at least) to this Context

debuggingState

public boolean debuggingState()
Get debugging state

Returns:
true if debugging active

getInvokerProperties

public org.apache.commons.collections.ExtendedProperties getInvokerProperties()
Get a reference to the invoker properties set. Generally, only invokers should add anything to the set. It should be safe for anyone to read from it. It is up to the invoker to maintain its contents.

Returns:
reference to the invoker properties set


Test.