Class DomainObjectReader


  • @Service
    public class DomainObjectReader
    extends Object
    Processor for state log entries; creates domain object instances, stores them in repositories as well as in a master repo indexed by id value.
    Author:
    John Collins
    • Constructor Detail

      • DomainObjectReader

        public DomainObjectReader()
        Default constructor
    • Method Detail

      • setTimeslotPause

        public void setTimeslotPause​(int msec)
        Sets the per-timeslot pause value in msec
      • getTimeslotPause

        public int getTimeslotPause()
      • registerNewObjectListener

        public void registerNewObjectListener​(NewObjectListener listener,
                                              Class<?> type)
        Registers a NewObjectListener. The listener will be called with each newly-created object of the given type. If type is null, then the listener will be called for each new object.
      • registerMessageListener

        public void registerMessageListener​(LogtoolContext listener,
                                            Class<?> type)
        Registers the given LogtoolContext as a messageListener. Incoming messages must be dispatched using util.MessageDispatcher
      • setSchema

        public void setSchema​(HashMap<String,​String[]> schema)
        Sets the schema for this log.
      • readObject

        public Object readObject​(String line)
                          throws MissingDomainObject
        Converts a line from the log to an object. Each line is of the form
          ms:class::id::method{::arg}* Note that some objects cannot be resolved in the order they appear in a logfile, because they have forward dependencies. This means that a failure to resolve an object does not necessarily mean it's bogus, but could mean that it could be resolved at a later time, typically within one or a very few input lines.
        Throws:
        MissingDomainObject
      • getById

        public Object getById​(long id)