Class AOMAccessController

java.lang.Object
com.arbortext.epic.AOMAccessController

public class AOMAccessController extends Object
This class acts as a lock for java code accessing editor. It contains the logic for calling the locks on other AOM classes, which is needed to avoid deadlocks in a multithreaded java environment. When this class is locked, calls into editor are not executed immediately. Instead they are stored in a queue managed by this class. The list of classes controlled is not exhaustive. currently known controlled classes are as follows: Acl EpicSAXAppender
  • Constructor Details

    • AOMAccessController

      public AOMAccessController()
  • Method Details

    • isLocked

      public static boolean isLocked()
      Whether or not access to AOM is locked.
      Returns:
    • runMultiThreadedJob

      public static <V> V runMultiThreadedJob(Callable<V> job) throws Exception
      Launches the given job on a new thread. While the job is executing, executes any calls to execute(Callable) on the current thread. Be aware that all calls to the methods on Acl go through. execute(Callable), so invocations to those methods do not need to be wrapped in a Callable object and passed to execute(). If the AOMAccessController is already locked to another thread (that is, there's another thread currently waiting on a call to this method to return), the job is passed to execute(Callable) and treated as a "child job" of the other job.
      Type Parameters:
      V - The return type of the job.
      Parameters:
      job - The job to execute.
      Returns:
      The return type of the job.
      Throws:
      Exception - If the job throws an exception or is interrupted.
    • execute

      public static <V> V execute(Callable<V> job) throws Exception
      If the access controller is locked to a specific thread via runMultiThreadedJob(Callable), and the calling thread is not that thread, executes the given command on that thread and waits for the result. Otherwise, executes the command in the current thread.
      Type Parameters:
      V - The return type of the command.
      Parameters:
      job - The command.
      Returns:
      The value returned by the command.
      Throws:
      Exception - If the command throws an exception or if execution is interrupted.