Package com.arbortext.epic
Class AOMAccessController
java.lang.Object
com.arbortext.epic.AOMAccessController
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> VIf the access controller is locked to a specific thread viarunMultiThreadedJob(Callable), and the calling thread is not that thread, executes the given command on that thread and waits for the result.static booleanisLocked()Whether or not access to AOM is locked.static <V> VrunMultiThreadedJob(Callable<V> job) Launches the given job on a new thread.
-
Constructor Details
-
AOMAccessController
public AOMAccessController()
-
-
Method Details
-
isLocked
public static boolean isLocked()Whether or not access to AOM is locked.- Returns:
-
runMultiThreadedJob
Launches the given job on a new thread. While the job is executing, executes any calls toexecute(Callable)on the current thread. Be aware that all calls to the methods onAclgo 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 toexecute(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
If the access controller is locked to a specific thread viarunMultiThreadedJob(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.
-