Class BasicContext

java.lang.Object
org.epics.archiverappliance.common.BasicContext
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
ETLContext

public class BasicContext extends Object implements Closeable
All the main units of work in the appliance that deal with plugins pass in a context that can be used to hold state that pertains to the unit of work. For now, these are
  1. The main writer thread in the engine that writes to the short term store.
  2. The ETL jobs that transfer data from one store to the other.
  3. A client retrieval that gets data from the plugin.
This class contains functionality that plugins can rely on in all these contexts. Callers are expected to call the close method on completion of the unit of work. Contexts are not expected to be thread safe and are particular to the thread of execution.
Author:
mshankar
  • Constructor Details

    • BasicContext

      public BasicContext()
    • BasicContext

      public BasicContext(ArchDBRTypes retrievalExpectedDBRType, String pvNameFromRequest)
  • Method Details

    • getPaths

      public ArchPaths getPaths()
      The PlainPB plugin deals with paths that can be translated into NIO by our implementation of Paths. We generate one per context so that things can be closed correctly.
      Returns:
      paths ArchPaths
    • addResource

      public void addResource(Closeable resource)
      Add a resource that needs to be closed once we finish the unit of work..
      Parameters:
      resource - Closeable resouce
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getRetrievalExpectedDBRType

      public ArchDBRTypes getRetrievalExpectedDBRType()
      Returns:
      retrievalExpectedDBRType ArchDBRTypes
    • getPvNameFromRequest

      public String getPvNameFromRequest()
      Returns:
      pvNameFromRequest