|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.pvlogger.LoggerSession
LoggerSession manages a session of logging machine state. One can create an instance to log the current machine state either on demand or periodically.
| Field Summary | |
protected boolean |
_enabled
|
protected ChannelGroup |
_group
|
protected StateStore |
_stateStore
|
protected LoggerChangeListener |
changeProxy
|
protected static double |
DEFAULT_LOGGING_PERIOD
default logging period in seconds |
protected int |
INITIAL_DELAY
|
protected javax.swing.Timer |
logTimer
|
protected MessageCenter |
messageCenter
|
| Constructor Summary | |
LoggerSession(ChannelGroup group,
StateStore stateStore)
LoggerSession constructor |
|
| Method Summary | |
void |
addLoggerChangeListener(LoggerChangeListener listener)
Add a logger change listener to receive logger change events. |
ChannelGroup |
getChannelGroup()
Get the active channel group for this session |
java.util.Collection |
getChannels()
Get the channels which we are attempting to monitor and log |
double |
getLoggingPeriod()
Get the loggin period. |
StateStore |
getStateStore()
Get the state store for this logger session |
boolean |
isEnabled()
Determine whether this logger session is enabled |
boolean |
isLogging()
Reveal whether the logger is scheduled to run periodically |
protected void |
makeLogTimer(double period)
Make a new log timer |
void |
publishSnapshot(MachineSnapshot machineSnapshot)
Publish the machine snapshot to the persistent storage. |
void |
removeLoggerChangeListener(LoggerChangeListener listener)
Remove a logger change listener from receiving logger change events. |
void |
resumeLogging()
Resume periodic logging with the most recent settings. |
void |
setChannelGroup(ChannelGroup group)
Set the channel group for this logger session |
protected void |
setEnabled(boolean enable)
Set whether this session should be enabled |
void |
setLoggingPeriod(double period)
Set the period between events where we take and store machine snapshots. |
void |
startLogging()
Start periodically logging machine state to the persistent storage. |
void |
startLogging(double period)
Start periodically logging machine state to the persistent storage. |
void |
stopLogging()
Stop the periodic machine state logging. |
MachineSnapshot |
takeSnapshot()
Take a snapshot of the current machine state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final int INITIAL_DELAY
protected static final double DEFAULT_LOGGING_PERIOD
protected MessageCenter messageCenter
protected LoggerChangeListener changeProxy
protected ChannelGroup _group
protected javax.swing.Timer logTimer
protected StateStore _stateStore
protected boolean _enabled
| Constructor Detail |
public LoggerSession(ChannelGroup group,
StateStore stateStore)
group - Group of channels to log.stateStore - The persistent storage to which to log machine state.| Method Detail |
public void addLoggerChangeListener(LoggerChangeListener listener)
listener - The listener of the logger change events.public void removeLoggerChangeListener(LoggerChangeListener listener)
listener - The listener of the logger change events.public void resumeLogging()
public void startLogging()
public void startLogging(double period)
period - The period in seconds between events where we take and store machine snapshots.protected void makeLogTimer(double period)
period - The timer period in seconds.public void stopLogging()
public boolean isLogging()
public void setLoggingPeriod(double period)
period - The period in seconds between events where we take and store machine snapshots.public double getLoggingPeriod()
public boolean isEnabled()
protected void setEnabled(boolean enable)
enable - true to enable this session and false to disable itpublic ChannelGroup getChannelGroup()
public StateStore getStateStore()
public void setChannelGroup(ChannelGroup group)
group - the new channel group for this logger sessionpublic java.util.Collection getChannels()
public final MachineSnapshot takeSnapshot()
public final void publishSnapshot(MachineSnapshot machineSnapshot)
machineSnapshot - The machine snapshot to publish.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||