Package org.lsst.ccs.scripting
Class ScriptingSubsystemWrapper
java.lang.Object
org.lsst.ccs.scripting.ScriptingSubsystemWrapper
This class defines how a script interacts with a CCS Subsystem.
- Author:
- The LSST CCS Team
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScriptingSubsystemWrapper(String subsystemName, ConcurrentMessagingUtils cmdAgent) -
Method Summary
Modifier and TypeMethodDescriptionsendAsynchCommand(String commandName, Object... args) Invoke an asynchronous command with arguments on the subsystemsendSynchCommand(String commandName, Object... args) sendSynchCommand(Duration timeout, String commandName, Object... args) Invoke a synchronous command with arguments on the subsystem
-
Constructor Details
-
ScriptingSubsystemWrapper
-
-
Method Details
-
sendSynchCommand
public Object sendSynchCommand(Duration timeout, String commandName, Object... args) throws ScriptingTimeoutException, Exception Invoke a synchronous command with arguments on the subsystem- Parameters:
timeout- Duration to wait for command completion. Once the timeout is reached a ScriptingTimeoutException is thrown.commandName- The name of the command to be executed. e.g. "takeImage"args- Variable number of command arguments.- Returns:
- The Object obtained from
the command execution It could be an exception if exceptions are set to
be returned. See
CCS.setThrowExceptions(boolean). - Throws:
ScriptingTimeoutException- When the timeout is reached a ScriptingTimeoutException will be either thrown or returned depending onCCS.setThrowExceptions(boolean).Exception- When an exception occurs during the command execution the underlying Exception will be either thrown or returned depending onCCS.setThrowExceptions(boolean).
-
sendSynchCommand
public Object sendSynchCommand(String commandName, Object... args) throws ScriptingTimeoutException, Exception - Throws:
ScriptingTimeoutExceptionException
-
sendAsynchCommand
Invoke an asynchronous command with arguments on the subsystem- Parameters:
commandName- The name of the command to be executed. e.g. "takeImage"args- Variable number of command arguments.- Returns:
- A java.util.concurrent.Future that will contain the
ScriptingCommandResponse containing the Object resulted from the
execution. The Future is returned only after the target subsystem has
returned an Ack/nAck. The Object could be an Exception if exceptions are
set to be returned. See
CCS.setThrowExceptions(boolean). - Throws:
Exception- When an exception occurs during the command execution the underlying Exception will be either thrown or returned as part of theFuture, depending onCCS.setThrowExceptions(boolean).
-
internalAsynchCommand
- Throws:
Exception
-