org.jpox.store
Class XMLAutoStarter

java.lang.Object
  extended byorg.jpox.store.XMLAutoStarter
All Implemented Interfaces:
AutoStartMechanism

public class XMLAutoStarter
extends java.lang.Object
implements AutoStartMechanism

An auto-starter mechanism storing its definition in an XML file. Is independent of the datastore since it is stored as a file and not in the actual datastore. TODO Add a JPOXAutoStart DTD to validate the file automatically. TODO If we have one per PMF, need to guarantee unique naming of file.

Version:
$Revision: 1.6 $

Field Summary
protected  org.w3c.dom.Document doc
           
protected  java.net.URL fileUrl
           
protected static Localiser LOCALISER
           
protected  java.lang.String mode
           
protected  org.w3c.dom.Element rootElement
           
static java.lang.String XML_STARTER
          XML auto starter
 
Fields inherited from interface org.jpox.store.AutoStartMechanism
MODE_CHECKED, MODE_IGNORED, MODE_QUIET, NONE
 
Constructor Summary
XMLAutoStarter(java.net.URL fileUrl)
          Constructor, taking the XML file URL.
 
Method Summary
 void addClass(StoreData data)
          Method to add a class to the starter.
 void close()
          Closes a transaction for writing (add/delete) classes to the auto start mechanism
 void deleteAllClasses()
          Method to remove all classes from the starter.
 void deleteClass(java.lang.String className)
          Method to remove a class from the starter
 java.util.Collection getAllClassData()
          Accessor for all auto start data for this starter.
 java.lang.String getMode()
          Accessor for the mode of operation
 java.lang.String getStorageDescription()
          Method to give a descriptive name for the starter process.
 boolean isOpen()
          Whether it's open for writing (add/delete) classes to the auto start mechanism
 void open()
          Starts a transaction for writting (add/delete) classes to the auto start mechanism
 void setMode(java.lang.String mode)
          Mutator for the mode of operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_STARTER

public static final java.lang.String XML_STARTER
XML auto starter

See Also:
Constant Field Values

LOCALISER

protected static final Localiser LOCALISER

mode

protected java.lang.String mode

fileUrl

protected final java.net.URL fileUrl

doc

protected org.w3c.dom.Document doc

rootElement

protected org.w3c.dom.Element rootElement
Constructor Detail

XMLAutoStarter

public XMLAutoStarter(java.net.URL fileUrl)
Constructor, taking the XML file URL.

Parameters:
fileUrl - The file URL
Method Detail

getMode

public java.lang.String getMode()
Accessor for the mode of operation

Specified by:
getMode in interface AutoStartMechanism
Returns:
The mode of operation

setMode

public void setMode(java.lang.String mode)
Mutator for the mode of operation

Specified by:
setMode in interface AutoStartMechanism
Parameters:
mode - The mode of operation

getAllClassData

public java.util.Collection getAllClassData()
                                     throws DatastoreInitialisationException
Accessor for all auto start data for this starter.

Specified by:
getAllClassData in interface AutoStartMechanism
Returns:
The class auto start data
Throws:
DatastoreInitialisationException

open

public void open()
Starts a transaction for writting (add/delete) classes to the auto start mechanism

Specified by:
open in interface AutoStartMechanism

isOpen

public boolean isOpen()
Whether it's open for writing (add/delete) classes to the auto start mechanism

Specified by:
isOpen in interface AutoStartMechanism
Returns:
whether this is open for writing

close

public void close()
Closes a transaction for writing (add/delete) classes to the auto start mechanism

Specified by:
close in interface AutoStartMechanism

addClass

public void addClass(StoreData data)
Method to add a class to the starter.

Specified by:
addClass in interface AutoStartMechanism
Parameters:
data - The store data to add

deleteClass

public void deleteClass(java.lang.String className)
Method to remove a class from the starter

Specified by:
deleteClass in interface AutoStartMechanism
Parameters:
className - The name of the class to remove.

deleteAllClasses

public void deleteAllClasses()
Method to remove all classes from the starter.

Specified by:
deleteAllClasses in interface AutoStartMechanism

getStorageDescription

public java.lang.String getStorageDescription()
Method to give a descriptive name for the starter process.

Specified by:
getStorageDescription in interface AutoStartMechanism
Returns:
Description of the starter process.


Copyright © -2007 . All Rights Reserved.