). The
HsObjectCreatorService then uses the Java reflection API to
dynamically load the class definition and instantiate the desired
object. If the class for a certain straw does does not exist, or for
some reason can not be created, a NoSuchStrawException is
thrown. By using the fully qualified class name
HsObjectCreatorService allows for the loading of objects not
directly in the haystack.object package. This is valuable as
it may be desirable to keep one Haystack installation on a machine
intended for multiple users. However, as users may want to generate
new object types, these will necessarily sit outside the
haystack.object package.
HsObjectCreatorService also serves two other important functions. First, it will contact the HsCounter to get a unique ID for the new straw. Second, it will contact the HsPersistentObjectService to register the newly created object so that persistent storage is guaranteed when the HDM data is flushed to disk.