
public class Subsystem extends Agent
This object will register itself on the three buses (control, status, log). It broadcasts its status, and can receive Commands.
Agent.RunningCommandAGENT_HEARTBEAT_TASK, AGENT_RUNTIMEINFO_TASK, commandExecutorLock, currentAction, currentQueries, currentSignals, innerStateLock, jvmShutdown, logBusHandler, OBJECT_SUBSYSTEM_MAP, treeComponentInitialized| Constructor and Description |
|---|
Subsystem(String name,
AgentInfo.AgentType type)
Constructs a Subsystem of a given type with no inner structure.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Command to abort operation.
|
Handler |
getLogHandler(String handlerName)
Get a LogHandler for a given name.
|
int |
getNumberCommandThreads()
Command that returns the number of currently running commands.
|
static Subsystem |
getSubsystemForObject(Object obj)
Get the Subsystem for a given object belonging to a ComponentLookup.
|
void |
ping()
Command to broadcast a message of presence on the status bus.
|
String |
printRunningCommands()
Command returning a String describing which commands are running.
|
void |
setLogFormat(String format)
Command to set a format for the TextFormatter of LogBusHandler (see
logging.properties doc).
|
void |
setLogHandlerLevel(String handlerName,
String level)
Command to set a level for a given handler
Internally we use
java.util.logging.Level#parse(String) to parse the Level corresponding to the provided String. |
void |
setLogLevel(String keyLogger,
String levelName)
Command to set the Level of a named Logger.
|
void |
setStackTraceDepth(int depth)
Will modify the depth of stackTrace printing for ALL handlers (including
the LogBusHandler)
|
void |
stop(long timeHint)
Command to stop operation.
|
void |
stopAndWait(long timeHint)
forwards a STOP signal to all components and then checks if all hardwares
have been stopped within timeHint
|
boolean |
switchToEngineeringMode()
Command to switch to ENGINEERING mode.
|
void |
switchToNormalMode()
Command to switch to NORMAL mode.
|
addCommandSet, addCommandsFromObject, addStateChangeListener, broadcastStatus, checkAllHardwareStopped, executeCommandRequest, getAgentInfo, getAgentLockService, getAgentPeriodicTaskService, getAgentPersistenceService, getAgentProperties, getAgentPropertiesKeySet, getAgentProperty, getAgentStatusAggregatorService, getAlertService, getCCSVersions, getCommandCount, getCommandSet, getCommandTargets, getComponentConfigurationEnvironment, getComponentConfigurationEnvironmentByName, getComponentLookup, getComponentState, getConfigurationService, getCurrentAction, getDataProviderDictionaryService, getDescription, getDictionaries, getDistributionInfo, getEnvironmentLockService, getEnvironmentMessagingAccess, getLogger, getMessagingAccess, getMonitor, getName, getScheduler, getState, getState, getStatusBroadcastPeriod, internalCheckHardware, isComponentInState, isInEngineeringMode, isInState, isInState, populateComponentLookup, preBuild, publishStateChange, publishSubsystemDataOnStatusBus, removeStateChangeListener, sendAck, sendNack, setAgentName, setAgentProperty, shutdownAgent, startAgent, startAgent, updateAgentComponentState, updateAgentState, updateAgentState, updateHeartBeat, updateInternalState, waitForclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpreInit, preShutdown, preStartpublic Subsystem(String name, AgentInfo.AgentType type)
name - name of the subsystem : cannot be nulltype - Agent type@Command(description="abort subsystem", type=SIGNAL) public void abort()
@Command(description="stops hardware with expected max delay", type=ACTION) public void stop(@Argument(name="timeHint",defaultValue="-1") long timeHint) throws HardwareException
timeHint - time limit for executionHardwareException@Command(description="waits until all the hardware devices are actually stopped", type=ACTION) public void stopAndWait(long timeHint) throws HardwareException, InterruptedException
timeHint - HardwareException, - InterruptedExceptionHardwareExceptionInterruptedException@Command(description="switch to ENGINEERING mode", type=ACTION) public boolean switchToEngineeringMode()
true if the subsystem state has changed as a result of
execution@Command(description="Tries to get back to NORMAL mode", type=ACTION) public final void switchToNormalMode() throws SystemStateException
SystemStateException - if alarms are not cleared or signals are
still running@Command(description="set the level of a Logger", type=QUERY) public void setLogLevel(String keyLogger, String levelName)
keyLogger - name of LoggerlevelName - the name of a JUL Level@Command(description="sets the the depth of stacktraces in Logger messages", type=QUERY) public void setStackTraceDepth(int depth)
depth - could be negative if we want all the stackTrace@Command(description="sets the format used by TextFormatter for LogEvent messages ", type=QUERY) public void setLogFormat(String format)
format - @Command(description="sets the handler (ConsoleHandler, FileHandler, LogBusHandler) log level", type=QUERY) public void setLogHandlerLevel(String handlerName, String level)
java.util.logging.Level#parse(String) to parse the Level corresponding to the provided String.handlerName - The name of the LogHandler. Valid names are: LogBusHandler, LogBus, ConsoleHandler, Console, FileHandler, Filelevel - A String corresponding to a java.util.logging.Levelpublic Handler getLogHandler(String handlerName)
handlerName - The name of the LogHandler. Valid names are: LogBusHandler, LogBus, ConsoleHandler, Console, FileHandler, File@Command(description="gets the number of commands which are currently running (except the current one!)", type=QUERY) public int getNumberCommandThreads()
@Command(description="gets the name of commands which are currently running", type=QUERY) public String printRunningCommands()
@Command(description="broadcast on the status bus a message of presence", type=QUERY, category=SYSTEM) public void ping()
public static final Subsystem getSubsystemForObject(Object obj)
Copyright © 2018 LSST. All rights reserved.