Package org.lsst.ccs
Class Subsystem
java.lang.Object
org.lsst.ccs.Agent
org.lsst.ccs.Subsystem
- All Implemented Interfaces:
CommandExecutor,ServiceLifecycle
- Direct Known Subclasses:
JythonInterpreterConsole,LogTracer,Py4JServer,Tracer
The base class for a CCS subsystem.
This object will register itself on the three buses (control, status, log). It broadcasts its status, and can receive Commands.
- Author:
- Eric Aubourg, Bernard AMADE
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lsst.ccs.Agent
Agent.RunningCommand, Agent.ShutdownResult -
Field Summary
Fields inherited from class org.lsst.ccs.Agent
AGENT_DESCRIPTION, AGENT_RUNTIMEINFO_TASK, commandExecutorLock, currentAction, currentQueries, currentSignals, jvmShutdown, logBusHandler, stateService, treeComponentInitialized -
Constructor Summary
ConstructorsConstructorDescriptionSubsystem(String name, AgentInfo.AgentType type) Constructs a Subsystem of a given type with no inner structure. -
Method Summary
Modifier and TypeMethodDescriptiongetLogHandler(String handlerName) Get a LogHandler for a given name.getLogHandlerLevel(String handlerName) Command to get the level for a given handler.getLogLevel(String keyLogger) Command to get the Level of a named Logger.intCommand that returns the number of currently running commands.booleanisLogLevelInherited(String keyLogger) Command to check if the Level of a named Logger is inherited.voidping()Command to broadcast a message of presence on the status bus.Command returning a String describing which commands are running.voidsetLogFormat(String format) Command to set a format for the TextFormatter of LogBusHandler (see logging.properties doc).voidsetLogHandlerLevel(String handlerName, String level) Command to set a level for a given handler Internally we usejava.util.logging.Level#parse(String)to parse the Level corresponding to the provided String.voidsetLogLevel(String keyLogger, String levelName) Command to set the Level of a named Logger.voidsetStackTraceDepth(int depth) Will modify the depth of stackTrace printing for ALL handlers (including the LogBusHandler)Methods inherited from class org.lsst.ccs.Agent
createHelper, executeCommandRequest, getAgentInfo, getAgentPersistenceService, getAgentService, getAgentServices, getCommandCount, getCommandForThisThread, getCommandUser, getComponentConfigurationEnvironment, getComponentConfigurationEnvironmentByName, getComponentLookup, getCurrentAction, getDescription, getEnvironmentLockService, getEnvironmentMessagingAccess, getLogger, getMessagingAccess, getName, getScheduler, helper, initAgent, initLogBusHandler, isInEngineeringMode, populateComponentLookup, preInit, preStart, printComponentNodeTree, publishSubsystemDataOnStatusBus, sendAck, sendNack, sendStatusMessage, setAgentName, shutdownAgent, shutdownAgent, shutdownAgent, startAgent, vetoTransitionToNormalModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lsst.ccs.ServiceLifecycle
afterBuild, afterInit, afterStart, preBuild, preShutdown
-
Constructor Details
-
Subsystem
Constructs a Subsystem of a given type with no inner structure.- Parameters:
name- name of the subsystem : cannot be nulltype- Agent type
-
-
Method Details
-
setLogLevel
@Command(description="set the level of a Logger", type=QUERY, category=CORE, level=0) public void setLogLevel(String keyLogger, String levelName) Command to set the Level of a named Logger.- Parameters:
keyLogger- name of LoggerlevelName- the name of a JUL Level or null or "null" to revert to inherited Level
-
getLogLevel
@Command(description="get the level of a Logger", type=QUERY, category=CORE, level=0) public Level getLogLevel(String keyLogger) Command to get the Level of a named Logger.- Parameters:
keyLogger- name of Logger- Returns:
- the Logger level (either inherited or directly set)
-
isLogLevelInherited
@Command(description="check if the level of a Logger is inherited", type=QUERY, category=CORE, level=0) public boolean isLogLevelInherited(String keyLogger) Command to check if the Level of a named Logger is inherited.- Parameters:
keyLogger- name of Logger- Returns:
- true if the Level is inherited, false if it's set directly on the Logger
-
printLoggersLevel
-
setStackTraceDepth
@Command(description="sets the the depth of stacktraces in Logger messages", type=QUERY, category=CORE, level=1) public void setStackTraceDepth(int depth) Will modify the depth of stackTrace printing for ALL handlers (including the LogBusHandler)- Parameters:
depth- could be negative if we want all the stackTrace
-
setLogFormat
@Command(description="sets the format used by TextFormatter for LogEvent messages ", type=QUERY, category=CORE, level=1) public void setLogFormat(String format) Command to set a format for the TextFormatter of LogBusHandler (see logging.properties doc).- Parameters:
format-
-
setLogHandlerLevel
@Command(description="sets the handler (ConsoleHandler, FileHandler, LogBusHandler) log level", type=QUERY, category=CORE, level=0) public void setLogHandlerLevel(String handlerName, String level) Command to set a level for a given handler Internally we usejava.util.logging.Level#parse(String)to parse the Level corresponding to the provided String.- Parameters:
handlerName- The name of the LogHandler. Valid names are: LogBusHandler, LogBus, ConsoleHandler, Console, FileHandler, Filelevel- A String corresponding to a java.util.logging.Level
-
getLogHandlerLevel
@Command(description="sets the handler (ConsoleHandler, FileHandler, LogBusHandler) log level", type=QUERY, category=CORE, level=0) public Level getLogHandlerLevel(String handlerName) Command to get the level for a given handler.- Parameters:
handlerName- The name of the LogHandler. Valid names are: LogBusHandler, LogBus, ConsoleHandler, Console, FileHandler, File- Returns:
- The Level of the specified Handler
-
printLogHandlersLevel
-
getLogHandler
Get a LogHandler for a given name.- Parameters:
handlerName- The name of the LogHandler. Valid names are: LogBusHandler, LogBus, ConsoleHandler, Console, FileHandler, File- Returns:
- The corresponding Handler or null if nothing was found.
-
getNumberCommandThreads
@Command(description="gets the number of commands which are currently running (except the current one!)", type=QUERY, category=SYSTEM) public int getNumberCommandThreads()Command that returns the number of currently running commands.- Returns:
- the number of commands currently executing (except the current one)
-
printRunningCommands
@Command(description="gets the name of commands which are currently running", type=QUERY, category=CORE) public String printRunningCommands()Command returning a String describing which commands are running.- Returns:
- summary of currently running commands.
-
ping
@Command(description="broadcast on the status bus a message of presence", type=QUERY, category=SYSTEM) public void ping()Command to broadcast a message of presence on the status bus.
-