com.sdm.quasar.client.core.dialogbase.features
Class SystemSnapshotFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.core.dialogbase.features.SystemSnapshotFeature
All Implemented Interfaces:
Feature, SystemInfoProvider

public class SystemSnapshotFeature
extends AbstractFeature

This feature allows taking of system snapshots of the whole dialog hierarchy for every dialog. It uses a SystemInfoService, which must be accessible in the dialog hierarchy (because this is a core service, it should be).

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
SystemSnapshotFeature()
           
 
Method Summary
 SystemInfoOptions createSystemInfoOptions(int detailLevel)
          Creates a new SystemInfoOptions with the given detail level.
protected  void dispose()
          Called when the feature or dialog is disposed.
protected  void init()
          Called when the feature is initializing.
 void printSystemSnapshot()
          Takes a system snapshot and prints it to the console.
 void saveSystemSnapshotToFile(java.io.File file)
          Takes a system snapshot and saves it to a file.
 void saveSystemSnapshotToFile(java.io.File file, SystemInfoNode snapshot)
          Saves the system snapshot given to a file.
 SystemInfoNode takeSystemSnapshot()
          Takes a current system snapshot of the dialog hierarchy normal details and returns it.
 SystemInfoNode takeSystemSnapshot(int detailLevel)
          Takes a current system snapshot of the dialog hierarchy with the given detail level and returns it.
 SystemInfoNode takeSystemSnapshot(java.lang.String infoClass, int detailLevel)
          Takes a current system snapshot of the given information class with the given detail level and returns it.
 SystemInfoNode takeSystemSnapshot(java.lang.String infoClass, SystemInfoOptions options)
          Takes a current system snapshot of the given information class with the given SystemInfoOptions and returns it.
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized, prepare, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemSnapshotFeature

public SystemSnapshotFeature()
Method Detail

init

protected void init()
Description copied from class: AbstractFeature
Called when the feature is initializing. This is normally done, when the feature is connected to the lifecycle of the DialogControl installed to. To access the DialogControl use the AbstractFeature.getDialogControl() method.

Override this method to perform some action on initialization e.g. register public services.

Specified by:
init in class AbstractFeature
See Also:
AbstractFeature.init()

dispose

protected void dispose()
                throws DisposeException
Description copied from class: AbstractFeature
Called when the feature or dialog is disposed. Override this method to clean up resources and free memory when disposing.

Specified by:
dispose in class AbstractFeature
Throws:
DisposeException
See Also:
AbstractFeature.dispose()

takeSystemSnapshot

public SystemInfoNode takeSystemSnapshot(int detailLevel)
Takes a current system snapshot of the dialog hierarchy with the given detail level and returns it.

Parameters:
detailLevel - the detail level to take snapshit with
Returns:
a SystemInfoNode with the collected information

takeSystemSnapshot

public SystemInfoNode takeSystemSnapshot()
Takes a current system snapshot of the dialog hierarchy normal details and returns it.

Returns:
a SystemInfoNode with the collected information

printSystemSnapshot

public void printSystemSnapshot()
Takes a system snapshot and prints it to the console.


saveSystemSnapshotToFile

public void saveSystemSnapshotToFile(java.io.File file)
Takes a system snapshot and saves it to a file.

Parameters:
file - the File to save information into

saveSystemSnapshotToFile

public void saveSystemSnapshotToFile(java.io.File file,
                                     SystemInfoNode snapshot)
Saves the system snapshot given to a file.

Parameters:
file - the File to save information into
snapshot - a SystemInfoNode with the system information

takeSystemSnapshot

public SystemInfoNode takeSystemSnapshot(java.lang.String infoClass,
                                         int detailLevel)
Takes a current system snapshot of the given information class with the given detail level and returns it.

Parameters:
infoClass - the information class to get the information for
detailLevel - the detail level to take snapshit with
Returns:
a SystemInfoNode with the collected information

takeSystemSnapshot

public SystemInfoNode takeSystemSnapshot(java.lang.String infoClass,
                                         SystemInfoOptions options)
Takes a current system snapshot of the given information class with the given SystemInfoOptions and returns it.

Parameters:
infoClass - the information class to get the information for
options - the SystemInfoOptions to use
Returns:
a SystemInfoNode with the collected information

createSystemInfoOptions

public SystemInfoOptions createSystemInfoOptions(int detailLevel)
Creates a new SystemInfoOptions with the given detail level. This method should only be used when starting collection of system information to create the initial SystemInfoOptions for a collection run.

Parameters:
detailLevel - the detail level to collect information of
Returns:
the created SystemInfoOptions