Interface InMemoryService<T extends ASGService>

  • Type Parameters:
    T -

    public interface InMemoryService<T extends ASGService>
    A service that holds all the data in memory. An InMemoryService can operate in different modes. Access to the mode definition and configuration is provided by this interface.
    Version:
    $Id: $Id
    Author:
    lrosenberg
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Clears all data if the instance is unpaired.
      void pairTo​(T instance)
      Pairs this instance to another service.
      void readFrom​(T anInstance)
      Reads the data from a given instance.
      void synchBack()
      Synchs the data back to the paired instance.
      void synchTo​(T anInstance)
      Synches current data to a service instance.
      void unpair​(T instance)
      Unpairs the service.
    • Method Detail

      • pairTo

        void pairTo​(T instance)
             throws ASGRuntimeException
        Pairs this instance to another service. The paired instanceof the service shouldn't be used directly anymore (until unpaired). Pairing is useful if you want to perform bulk write operations and let them be written back to the original service. Pairing will force all current data to be thrown away.
        Parameters:
        instance - a T object.
        Throws:
        ASGRuntimeException - if any.
      • unpair

        void unpair​(T instance)
             throws ASGRuntimeException
        Unpairs the service. Only previously paired service can be unpaired.
        Parameters:
        instance - a T object.
        Throws:
        ASGRuntimeException - if any.
      • readFrom

        void readFrom​(T anInstance)
               throws ASGRuntimeException
        Reads the data from a given instance. Only possible if unpaired.
        Parameters:
        anInstance - a T object.
        Throws:
        ASGRuntimeException - if any.
      • synchTo

        void synchTo​(T anInstance)
              throws ASGRuntimeException
        Synches current data to a service instance. The results are quite unpredictable.
        Parameters:
        anInstance - a T object.
        Throws:
        ASGRuntimeException - if any.