uk.ac.essex.common.keymapper
Class KeyMapServiceImpl

java.lang.Object
  extended by uk.ac.essex.common.keymapper.KeyMapServiceImpl
All Implemented Interfaces:
KeyMapService, Service

public class KeyMapServiceImpl
extends java.lang.Object
implements KeyMapService

TODO: This class needs finishing
Date: 15-Jul-2002


Field Summary
protected static KeyMapServiceImpl ourInstance
          The singleton instance
 
Fields inherited from interface uk.ac.essex.common.keymapper.KeyMapService
DEFAULT_KEY_MAP_NAME
 
Constructor Summary
protected KeyMapServiceImpl()
           
 
Method Summary
 void add(java.io.File xmlFile)
          Load the keymap from the file given
 void add(java.io.Reader reader)
          Load the keymap from the stream given
 void addAll(java.io.File directoryToLoadFrom)
          Loads all xml files from the given directory
 void destroy()
          Destroy the service
static KeyMapService getInstance()
           
 KeyMap getKeyMap(java.lang.String keyMapId)
          Get the keymap with the given id
 java.lang.String[] getKeyMapNames()
          Get an array of the key map names that are available
 KeyMapXML getKeyMapXML(java.lang.String name)
           
 void initialise()
          Initialise the service
static void main(java.lang.String[] argStrings)
          For testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ourInstance

protected static KeyMapServiceImpl ourInstance
The singleton instance

Constructor Detail

KeyMapServiceImpl

protected KeyMapServiceImpl()
Method Detail

getInstance

public static KeyMapService getInstance()
Returns:
KeyMapServiceImpl - The singleton instance

initialise

public void initialise()
                throws InitialisationException
Initialise the service

Specified by:
initialise in interface Service
Throws:
InitialisationException

destroy

public void destroy()
             throws DestructionException,
                    ShutdownCancelledException
Destroy the service

Specified by:
destroy in interface Service
Throws:
DestructionException
ShutdownCancelledException

addAll

public void addAll(java.io.File directoryToLoadFrom)
Loads all xml files from the given directory

Specified by:
addAll in interface KeyMapService
Parameters:
directoryToLoadFrom -

add

public void add(java.io.File xmlFile)
Description copied from interface: KeyMapService
Load the keymap from the file given

Specified by:
add in interface KeyMapService

add

public void add(java.io.Reader reader)
Description copied from interface: KeyMapService
Load the keymap from the stream given

Specified by:
add in interface KeyMapService
Parameters:
reader - - The stream

getKeyMapXML

public KeyMapXML getKeyMapXML(java.lang.String name)
Parameters:
name -
Returns:

getKeyMap

public KeyMap getKeyMap(java.lang.String keyMapId)
Get the keymap with the given id

Specified by:
getKeyMap in interface KeyMapService
Parameters:
keyMapId -
Returns:

getKeyMapNames

public java.lang.String[] getKeyMapNames()
Get an array of the key map names that are available

Specified by:
getKeyMapNames in interface KeyMapService
Returns:

main

public static void main(java.lang.String[] argStrings)
For testing

Parameters:
argStrings -