All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class key.Key

java.lang.Object
   |
   +----key.Atom
           |
           +----key.Container
                   |
                   +----key.Scape
                           |
                           +----key.Key

public class Key
extends Scape
This class is a little badly behaved, as far as containers go. It starts out life as a normal container, so it can get its defaults loaded in. These are other containers, such as 'players' and 'groups'. Once these are in place, it switches to being a reference container, meaning that everything *else* that is placed in here is just a reference to something else. This would be a problem, except that this class is never stored anywhere, it is generated everytime at bootup by its constructor.


Variable Index

 o bootStatisticsProperty
 o clans
 o clansFile
 o commandSets
 o commandSetsFile
 o config
 o configBasePath
 o configFile
 o copyright
 o daemons
 o daemonsFile
 o DEFAULT_PORT
 o groups
 o groupsFile
 o landscapeFile
 o latencyCache
 o locations
 o loginStatisticsProperty
 o logProperty
 o logsBasePath
 o nullEntry
 o nullString
 o online
 o onlineFile
 o reference
 o RELEASE
Major release number
 o residents
 o residentsBasePath
 o residentsFile
 o scheduler
 o shortcuts
 o sinceBootLoginStatisticsProperty
 o sites
 o sitesFile
 o tempFileExtension
 o unlinkedString
 o verbose
This is a global variable that can be used by any command to indicate that _everything_ on the program should start doing verbose logging.
 o VERSION
Minor version.
 o voidRoom

Constructor Index

 o Key()
 o Key(boolean)

Method Index

 o addEverything()
 o addShortcuts()
 o addTopLevel(Container)
Adds all the symbols in this container to the provided Container This container retains a reference to its elements, but full ownership (the elements parents) is given to the new container.
 o bootLog(String)
A special type of log call which sends the output to the boot log (if available), but will also always send the message to System.err
 o confirmedDirectory(String)
 o confirmedFile(File, String)
 o debug(Object, String)
A generalised debugging log function
 o debug(String, String)
Use for static routines only, please
 o evalReadOnlyProperty(ReadOnlyProperty)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null
 o fatal(Object, String)
A generalised fatal error message
 o getClans()
 o getConfig()
 o getConnectRoom(Player)
 o getId()
 o getInitialRank()
 o getInternet()
 o getLandscape(String)
Returns the landscape referenced by the supplied id.
 o getLatencyCache()
 o getOnline()
 o getParentId()
see Parent.java
 o getResidents()
 o getScheduler()
 o instance()
The easiest way to get the top level object in the running system.
 o isGenesis()
 o isRunning()
 o linkPlayer(Player)
overrides default so that timeStatistics can be updated
 o loadClans()
 o loadCommandSets()
 o loadConfig()
 o loadConfiguration()
 o loadDaemons()
 o loadEverything()
 o loadFrom(DataInput)
 o loadGroups()
 o loadLandscape()
(Re)loads the system locations from disk.
 o loadObject(DataInput)
 o loadObject(File)
 o loadOnline()
 o loadResidents()
 o loadSites()
 o log(String, String)
A log routine which will send the message to the supplied log file, if available, or System.out otherwise.
 o main(String[])
 o resolveEverything()
 o setupFiles()
 o shortcuts()
 o shutdown()
This routine is only _ever_ meant to be called from the scheduler.
 o startDaemons()
 o storeObject(Storable, DataOutput)
 o storeObject(Storable, File)
 o sync()
Updates the system disk files so that the changes to non-saved objects will be saved.
 o syncConfig()
 o unlinkPlayer(Player)
overrides default so that timeStatistics can be updated
 o writeTo(DataOutput)

Variables

 o DEFAULT_PORT
 protected static final int DEFAULT_PORT
 o RELEASE
 protected static final int RELEASE
Major release number

 o VERSION
 protected static final int VERSION
Minor version. Eg: Version release.version

 o latencyCache
 protected LatentCache latencyCache
 o scheduler
 protected Scheduler scheduler
 o reference
 protected static Key reference
 o voidRoom
 protected Room voidRoom
 o residentsBasePath
 protected File residentsBasePath
 o configBasePath
 protected File configBasePath
 o logsBasePath
 protected File logsBasePath
 o landscapeFile
 protected File landscapeFile
 o locations
 protected Landscape locations
 o commandSetsFile
 protected File commandSetsFile
 o commandSets
 protected Container commandSets
 o groupsFile
 protected File groupsFile
 o groups
 protected Container groups
 o clansFile
 protected File clansFile
 o clans
 protected Container clans
 o configFile
 protected File configFile
 o config
 protected BaseConfiguration config
 o sitesFile
 protected File sitesFile
 o sites
 protected Internet sites
 o daemonsFile
 protected File daemonsFile
 o daemons
 protected Daemons daemons
 o residentsFile
 protected File residentsFile
 o residents
 protected Residents residents
 o onlineFile
 protected File onlineFile
 o online
 protected Container online
 o shortcuts
 protected Shortcuts shortcuts
 o loginStatisticsProperty
 protected AtomicProperty loginStatisticsProperty
 o sinceBootLoginStatisticsProperty
 protected AtomicProperty sinceBootLoginStatisticsProperty
 o bootStatisticsProperty
 protected AtomicProperty bootStatisticsProperty
 o logProperty
 protected AtomicProperty logProperty
 o nullString
 public static final String nullString
 o unlinkedString
 public static final String unlinkedString
 o nullEntry
 public static final String nullEntry
 o tempFileExtension
 public static final String tempFileExtension
 o verbose
 public static boolean verbose
This is a global variable that can be used by any command to indicate that _everything_ on the program should start doing verbose logging. At any given point in time, there should be only _one_ section of code that can turn this flag on.

 o copyright
 public static final String copyright

Constructors

 o Key
 protected Key(boolean c)
 o Key
 protected Key()

Methods

 o instance
 public static Key instance()
The easiest way to get the top level object in the running system.

 o isRunning
 public boolean isRunning()
 o loadEverything
 protected void loadEverything()
 o addEverything
 protected void addEverything() throws NonUniqueKeyException, BadKeyException
 o addShortcuts
 protected void addShortcuts() throws NonUniqueKeyException, BadKeyException
 o resolveEverything
 protected void resolveEverything()
 o startDaemons
 protected void startDaemons()
 o setupFiles
 protected void setupFiles()
 o getLandscape
 public Landscape getLandscape(String match)
Returns the landscape referenced by the supplied id. eg 'realm.hill.top'

 o getInitialRank
 public Rank getInitialRank()
 o getConnectRoom
 public Room getConnectRoom(Player p)
 o getOnline
 public Container getOnline()
 o getClans
 public Container getClans()
 o getConfig
 public BaseConfiguration getConfig()
 o linkPlayer
 public void linkPlayer(Player p) throws NonUniqueKeyException, BadKeyException
overrides default so that timeStatistics can be updated

Overrides:
linkPlayer in class Scape
 o unlinkPlayer
 public void unlinkPlayer(Player p) throws NonUniqueKeyException, BadKeyException
overrides default so that timeStatistics can be updated

Overrides:
unlinkPlayer in class Scape
 o addTopLevel
 public void addTopLevel(Container addTo)
Adds all the symbols in this container to the provided Container This container retains a reference to its elements, but full ownership (the elements parents) is given to the new container.

Overrides:
addTopLevel in class Container
 o evalReadOnlyProperty
 public Object evalReadOnlyProperty(ReadOnlyProperty p)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null

Overrides:
evalReadOnlyProperty in class Scape
 o debug
 public static final void debug(Object from,
                                String message)
A generalised debugging log function

Parameters:
message - The message to store
 o debug
 public static final void debug(String name,
                                String message)
Use for static routines only, please

 o fatal
 public static void fatal(Object from,
                          String message)
A generalised fatal error message

 o getId
 public String getId()
Overrides:
getId in class Atom
 o getParentId
 public String getParentId()
see Parent.java

Overrides:
getParentId in class Container
 o shutdown
 public synchronized void shutdown()
This routine is only _ever_ meant to be called from the scheduler.

 o getLatencyCache
 public static final LatentCache getLatencyCache()
 o getScheduler
 public static final Scheduler getScheduler()
 o getInternet
 public static final Internet getInternet()
 o shortcuts
 public static final Container shortcuts()
 o isGenesis
 public boolean isGenesis()
 o sync
 public synchronized void sync()
Updates the system disk files so that the changes to non-saved objects will be saved. (eg, which commands are where, etc)

Overrides:
sync in class Atom
 o getResidents
 public Residents getResidents()
 o loadConfig
 protected synchronized void loadConfig()
 o syncConfig
 public synchronized void syncConfig()
 o loadCommandSets
 protected synchronized void loadCommandSets()
 o loadGroups
 protected synchronized void loadGroups()
 o loadClans
 protected synchronized void loadClans()
 o loadConfiguration
 protected synchronized void loadConfiguration()
 o loadSites
 protected synchronized void loadSites()
 o loadOnline
 protected synchronized void loadOnline()
 o loadDaemons
 protected synchronized void loadDaemons()
 o loadResidents
 protected synchronized void loadResidents()
 o loadLandscape
 protected synchronized void loadLandscape()
(Re)loads the system locations from disk. This command obviously overwrites any that are in memory & loads the new ones from disk. There should be no need to call this more than once, however, since the only Right and True [tm] way to modify these is online.

 o storeObject
 public static void storeObject(Storable object,
                                File to)
 o loadObject
 public static Storable loadObject(File from)
 o loadObject
 public static Storable loadObject(DataInput ds) throws ClassNotFoundException, IOException, ClassNotStorableException, InstantiationException, IllegalAccessException
 o storeObject
 public static void storeObject(Storable object,
                                DataOutput ds) throws IOException
 o confirmedFile
 public File confirmedFile(File basePath,
                           String name)
 o confirmedDirectory
 public File confirmedDirectory(String path)
 o loadFrom
 public final void loadFrom(DataInput from) throws IOException
Overrides:
loadFrom in class Container
 o writeTo
 public void writeTo(DataOutput to) throws IOException
Overrides:
writeTo in class Container
 o main
 public static void main(String args[])
 o bootLog
 public static final void bootLog(String message)
A special type of log call which sends the output to the boot log (if available), but will also always send the message to System.err

 o log
 public static void log(String logKey,
                        String message)
A log routine which will send the message to the supplied log file, if available, or System.out otherwise.


All Packages  Class Hierarchy  This Package  Previous  Next  Index