Class XMLAutoStarter

  • All Implemented Interfaces:
    AutoStartMechanism

    public class XMLAutoStarter
    extends AbstractAutoStartMechanism
    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 DataNucleusAutoStart DTD to validate the file automatically. TODO If we have one per PMF, need to guarantee unique naming of file.
    • Field Detail

      • fileUrl

        protected final URL fileUrl
      • rootElement

        protected Element rootElement
    • Method Detail

      • isOpen

        public boolean isOpen()
        Whether it's open for writing (add/delete) classes to the auto start mechanism. This autostarter is always open
        Specified by:
        isOpen in interface AutoStartMechanism
        Overrides:
        isOpen in class AbstractAutoStartMechanism
        Returns:
        whether this is open for writing
      • addClass

        public void addClass​(StoreData data)
        Method to add a class to the starter. Adds attributes for all defined properties.
        Parameters:
        data - The store data to add
      • deleteClass

        public void deleteClass​(String className)
        Method to remove a class from the starter
        Parameters:
        className - The name of the class to remove.
      • deleteAllClasses

        public void deleteAllClasses()
        Remove all classes from the starter.
      • getStorageDescription

        public String getStorageDescription()
        Method to give a descriptive name for the starter process.
        Returns:
        Description of the starter process.