Class FileHibernate

java.lang.Object
ca.uqac.lif.cep.Processor
ca.uqac.lif.cep.SynchronousProcessor
ca.uqac.lif.cep.hibernate.Hibernate
ca.uqac.lif.cep.hibernate.FileHibernate
All Implemented Interfaces:
ca.uqac.lif.cep.Contextualizable, ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.DuplicableProcessor

public class FileHibernate extends Hibernate
A Hibernate processor that saves its internal processor into a local file. The name of the file is made of a fixed path, followed by the hibernated processor's unique ID.
Author:
Sylvain Hallé
  • Nested Class Summary

    Nested classes/interfaces inherited from class ca.uqac.lif.cep.SynchronousProcessor

    ca.uqac.lif.cep.SynchronousProcessor.InputPushable, ca.uqac.lif.cep.SynchronousProcessor.OutputPullable

    Nested classes/interfaces inherited from class ca.uqac.lif.cep.Processor

    ca.uqac.lif.cep.Processor.InternalProcessorState
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected ca.uqac.lif.azrael.ObjectPrinter<String>
    The printer that is used to print to a file
    protected ca.uqac.lif.azrael.ObjectReader<String>
    The reader that is used to read from the file

    Fields inherited from class ca.uqac.lif.cep.hibernate.Hibernate

    m_fridge, m_queues, m_sink

    Fields inherited from class ca.uqac.lif.cep.SynchronousProcessor

    m_inputPushables, m_outputPullables, m_tempQueue

    Fields inherited from class ca.uqac.lif.cep.Processor

    m_context, m_hasBeenNotifiedOfEndOfTrace, m_inputArity, m_inputPullables, m_inputQueues, m_notifiedEndOfTraceDownstream, m_outputArity, m_outputPushables, m_outputQueues, MAX_PULL_RETRIES, s_versionString
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileHibernate(ca.uqac.lif.cep.Processor p, String path, ca.uqac.lif.azrael.ObjectPrinter<String> printer, ca.uqac.lif.azrael.ObjectReader<String> reader)
    Creates a new file hibernate processor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getFilename(ca.uqac.lif.cep.Processor p, String path)
    Creates a filename from a pattern expression and the processor's current context.

    Methods inherited from class ca.uqac.lif.cep.hibernate.Hibernate

    compute, duplicate, getFridge, setContext, setContext

    Methods inherited from class ca.uqac.lif.cep.SynchronousProcessor

    getPullableOutput, getPushableInput

    Methods inherited from class ca.uqac.lif.cep.Processor

    allNotifiedEndOfTrace, allNull, copyInputQueue, copyOutputQueue, duplicate, duplicateInto, equals, getAt, getContext, getContext, getEmptyQueue, getId, getInputArity, getInputQueue, getInputType, getInputTypesFor, getOutputArity, getOutputQueue, getOutputType, getPullableInput, getPullableOutput, getPushableInput, getPushableOutput, hashCode, leftShift, newContext, onEndOfTrace, or, or, or, printState, readState, reset, rightShift, setPullableInput, setPushableOutput, start, startAll, stop, stopAll

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_printer

      protected transient ca.uqac.lif.azrael.ObjectPrinter<String> m_printer
      The printer that is used to print to a file
    • m_reader

      protected transient ca.uqac.lif.azrael.ObjectReader<String> m_reader
      The reader that is used to read from the file
  • Constructor Details

    • FileHibernate

      public FileHibernate(ca.uqac.lif.cep.Processor p, String path, ca.uqac.lif.azrael.ObjectPrinter<String> printer, ca.uqac.lif.azrael.ObjectReader<String> reader)
      Creates a new file hibernate processor.
      Parameters:
      p - The processor to be hibernated
      path - The path where to save the files. Must end with a trailing slash.
      printer - The printer that is used to print to a file
      reader - The reader that is used to read from the file
  • Method Details

    • getFilename

      public static String getFilename(ca.uqac.lif.cep.Processor p, String path)
      Creates a filename from a pattern expression and the processor's current context.

      The method is declared as public on purpose, so that it can be tested by external scripts.

      Parameters:
      p - The processor for which to create a filename
      path - The path to prefix to the filename
      Returns:
      The filename