org.cogchar.app.puma.config
Class PumaContextMediator

java.lang.Object
  extended by org.appdapter.core.log.BasicDebugger
      extended by org.cogchar.app.puma.config.PumaContextMediator
All Implemented Interfaces:
org.appdapter.core.log.Loggable

public abstract class PumaContextMediator
extends org.appdapter.core.log.BasicDebugger

This mediator is our "/etc/rc", the "top" mechanism available to customize the Cogchar PUMA boot up sequence.

Author:
Stu B.

Field Summary
 
Fields inherited from interface org.appdapter.core.log.Loggable
IMPO_HI, IMPO_HIHI, IMPO_LO, IMPO_LOLO, IMPO_MAX, IMPO_MIN, IMPO_NORM
 
Constructor Summary
PumaContextMediator()
           
 
Method Summary
 List<ClassLoader> getExtraResFileCLsForCat(ResourceFileCategory cat)
          Synchronous callback allowing your app to be sure it has registered classLoaders that can see all required files in the different ResourceCategories.
 boolean getFlagAllowJFrames()
           
 boolean getFlagIncludeCharacters()
           
 boolean getFlagIncludeVirtualWorld()
           
 boolean getFlagIncludeWebServices()
           
abstract  org.appdapter.core.matdat.RepoSpec getMainConfigRepoSpec()
          Mediator determines
 String getOptionalFilesysRoot()
           
 String getPanelKind()
           
 String getSysContextRootURI()
          Used to set the URI of the PumaContextCommandBox, which is used as the most powerful/general target in our "Cmd" models, which should match this URI for your application.
 void notifyBeforeBootComplete(PumaAppContext ctx)
          Boot callback sequence #4.
 void notifyCharactersLoaded(PumaAppContext ctx)
          Boot callback sequence #3.
 void notifyContextBuilt(PumaAppContext ctx)
          Boot callback sequence #1.
 void notifyPanelsConstructed(PumaAppContext ctx)
          Boot callback sequence #2 - optional.
 
Methods inherited from class org.appdapter.core.log.BasicDebugger
checkDebugImportance, forceLog4jConfig, getLogger, getLoggerForClass, isLoggerUsable, logDebug, logError, logError, logInfo, logInfo, logInfoEvent, logWarning, logWarning, logWithException, setDebugImportanceThreshold, setLogger, useLoggerForClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PumaContextMediator

public PumaContextMediator()
Method Detail

notifyContextBuilt

public void notifyContextBuilt(PumaAppContext ctx)
                        throws Throwable
Boot callback sequence #1. The mediator should now do any special init that it wants to, but without assuming GUI exists. This stage includes getting the FIRST whack (both read and write) at the configuration services. This should happen before the mediator is required to answer the getFlags and getMainConfigIdent, getModeIdent kinds of questions. However, the default mediator impl does nothing. If you want the whole application to fail and shut down, you can signal that by allowing an exception to escape.

Parameters:
ctx -
Throws:
Throwable

notifyPanelsConstructed

public void notifyPanelsConstructed(PumaAppContext ctx)
                             throws Throwable
Boot callback sequence #2 - optional. Could apply to any GUI concepts, but currently applies only to our VWorld OpenGL panel. This callback is currently *not* invoked if there is no VWorld startup (as controlled by VWorld flag below). Called after panels constructed but before startOpenGLCanvas. Allows GUI to intervene and realize the panels as needed. This step is normally used when getFlagAllowJFrames returns false, e.g. when we are running under NB platform and we want to manage windows manually). This callback comes after notifyContextBuilt, only if panels are actually constructed, as noted above. If you want the whole application to fail and shut down, you can signal that by allowing an exception to escape.

Parameters:
ctx -
Throws:
Throwable

notifyCharactersLoaded

public void notifyCharactersLoaded(PumaAppContext ctx)
                            throws Throwable
Boot callback sequence #3. The Puma chars have now been loaded, or reloaded. If you want to fix up your chars as a group, this is a good opportunity to do so. This might be called repeatedly if user re-loads the character system repeatedly, without a full reboot (and hence without the other callbacks necessarily repeating).

Parameters:
ctx -
Throws:
Throwable

notifyBeforeBootComplete

public void notifyBeforeBootComplete(PumaAppContext ctx)
                              throws Throwable
Boot callback sequence #4. Last thing that happens before result processing during a boot is this callback. Allows app to make sure it gets the last word on config + state.

Parameters:
ctx -
Throws:
Throwable

getOptionalFilesysRoot

public String getOptionalFilesysRoot()

getPanelKind

public String getPanelKind()

getFlagAllowJFrames

public boolean getFlagAllowJFrames()

getFlagIncludeVirtualWorld

public boolean getFlagIncludeVirtualWorld()

getFlagIncludeWebServices

public boolean getFlagIncludeWebServices()

getFlagIncludeCharacters

public boolean getFlagIncludeCharacters()

getSysContextRootURI

public String getSysContextRootURI()
Used to set the URI of the PumaContextCommandBox, which is used as the most powerful/general target in our "Cmd" models, which should match this URI for your application.

Returns:

getMainConfigRepoSpec

public abstract org.appdapter.core.matdat.RepoSpec getMainConfigRepoSpec()
Mediator determines

Returns:

getExtraResFileCLsForCat

public List<ClassLoader> getExtraResFileCLsForCat(ResourceFileCategory cat)
Synchronous callback allowing your app to be sure it has registered classLoaders that can see all required files in the different ResourceCategories. In a simple JavaApp, these will probably just be the default classloader, and this callback is unimportant. But under OSGi, this method is a useful and easy way to get your classLoaders "in". It is helpful to override this method with your own, because your application bundle has the best visibility into the set of classLoaders for other bundles. Under OSGi, you can easily "import" the required packages, grab a sibing class, and ask for its classLoader. Each classLoader should only be returned once, although repetitions should have little impact. The ordering does not currently control any behavior, but might be used later We intend that Puma should consult this method at least once for each category, before trying to load any resources from it. Puma may consult it multiple times, in which case Puma should not build up long lists of duplicate classloaders in any data structures! [S2B22 - 2012-10-23].

Parameters:
cat -
Returns:


Copyright © 2010-2013. All Rights Reserved.