⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staxmonitorframe.java

📁 Software Testing Automation Framework (STAF)的开发代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF)                              *//* (C) Copyright IBM Corp. 2002, 2004                                        *//*                                                                           *//* This software is licensed under the Common Public License (CPL) V1.0.     *//*****************************************************************************/package com.ibm.staf.service.stax;import java.awt.*;import java.awt.event.*;import java.util.*;import java.io.*;import java.lang.Math.*;import javax.swing.*;import javax.swing.border.*;import javax.swing.event.*;import javax.swing.tree.*;import javax.swing.table.*;import java.lang.reflect.*;import com.ibm.staf.*;import com.ibm.staf.service.*;import java.text.SimpleDateFormat;import java.util.jar.*;public class STAXMonitorFrame extends JFrame implements ActionListener,                                                        Runnable,                                                        KeyListener,                                                        MouseListener,                                                        TreeSelectionListener,                                                        ChangeListener{    public static final int EXTENSION_ACTIVE = 1;    public static final int EXTENSION_STATUS = 2;    public static final int EXTENSION_INFO = 3;    public static final int EXTENSION_ACTIVE_JOB_ELEMENTS = 4;    public static final int EXTENSION_ACTIVE_JOB_ELEMENTS_AND_ACTIVE = 5;    public static final int EXTENSION_ACTIVE_JOB_ELEMENTS_AND_STATUS = 6;    public static final int EXTENSION_ACTIVE_JOB_ELEMENTS_AND_INFO = 7;    public static final int AUTOMONITOR_ALWAYS = 1;    public static final int AUTOMONITOR_RECOMMENDED = 2;    public static final int AUTOMONITOR_NEVER = 3;    public static final int DISABLED = 0;    public static final int ENABLED = 1;    public static final int DEFAULT = 2;    // STAX Service Error Codes    static final int BlockNotHeld = 4002;    static final int BlockAlreadyHeld = 4003;    String fStaxMachine;    String fStaxServiceName;    String fStaxMachineNickname;    String fStaxConfigMachine;    String fStaxInstanceUUID;    String fEventMachine;    String fEventServiceName;    String fJobNumber;    String fXmlFileName;    String fXmlFileMachine;    String fFunction;    String fArgs;    String fJobName;    Vector fScripts;    Vector fScriptFilesVector;    String fScriptFilesMachineName;    static String kMonitorFrameTitle = "STAX Job Monitor";    JLabel fCurrentSelection;    STAXMonitorTreeNode fCurrentSelectedNode;    JTable fDetailsTable;    STAXMonitorTableModel fDetailsTableModel;    STAXMonitorTableSorter fDetailsModelSorter;    JTree fMonitorTree;    DefaultTreeModel fMonitorTreeModel;    STAFHandle fHandle;    private Thread fQueueThread;    JTable fMessageTable;    JScrollPane fMessageScrollPane;    STAXMonitorTableModel fMessageTableModel;    STAXMonitorTableSorter fMessageModelSorter;    Hashtable fMonitorTreeBlocks = new Hashtable(); // key is block name    Hashtable fMonitorTreeBlockNodes = new Hashtable(); // key is block node    Hashtable fCmdIDHashtable = new Hashtable();    Hashtable fSubjobIDHashtable = new Hashtable();    Hashtable fProcIDHashtable = new Hashtable();    Hashtable fPluginNodeHashtable = new Hashtable();    Hashtable fPluginNodeToIDHashtable = new Hashtable();    Hashtable fPluginNodeToNodeTextHashtable = new Hashtable();    Hashtable fMonitorTreeProcessNodes = new Hashtable();    Hashtable fMonitorTreeCommandNodes = new Hashtable();    Hashtable fMonitorTreeSubjobNodes = new Hashtable();    Hashtable fMonitorTreeProcessStartTimes = new Hashtable();    Hashtable fMonitorTreeCommandStartTimes = new Hashtable();    Hashtable fMonitorTreeSubjobStartTimes = new Hashtable();    boolean fMonitorStopped = false;    JPanel fSelectionDetailsPanel;    Hashtable fDataHashtable = new Hashtable();    Vector fDataColumns;    Vector fMessageColumns;    STAFProcessMonitor fProcessMonitor;    MonitorElapsedTime fElapsedTime;    boolean fContinueProcessMonitor = true;    boolean fContinueElapsedTime = true;    JPopupMenu fBlockPopupMenu = new JPopupMenu();    JMenuItem fBlockHoldMenuItem = new JMenuItem("Hold");    JMenuItem fBlockReleaseMenuItem = new JMenuItem("Release");    JMenuItem fBlockTerminateMenuItem = new JMenuItem("Terminate");    JPopupMenu fSubjobPopupMenu = new JPopupMenu();    JMenuItem fSubjobStartMonitoringMenuItem = new        JMenuItem("Start Monitoring");    JMenuItem fSubjobDisplayJobLogMenuItem = new        JMenuItem("Display Job Log");    JMenuItem fSubjobDisplayJobUserLogMenuItem = new        JMenuItem("Display Job User Log");    JMenuItem fSubjobTerminateMenuItem = new JMenuItem("Terminate Job");    STAXMonitor fParentMonitor;    TreePath previousTreePath;    JMenu fFileMenu;    JMenu fDisplayMenu;    JMenu fViewMenu;    JMenuItem fFileResubmit;    JMenuItem fFileExitAndResubmit;    JMenuItem fFileExit;    JMenuItem fDisplayJobLog = new JMenuItem("Display Job Log");    JMenuItem fDisplayJobUserLog = new JMenuItem("Display Job User Log");    boolean fShowNoSTAXMonitorInformation = false;    int fClearLogs = STAXMonitorFrame.DEFAULT;    int fLogTCElapsedTime = STAXMonitorFrame.DEFAULT;    int fLogTCNumStarts = STAXMonitorFrame.DEFAULT;    int fLogTCStartStop = STAXMonitorFrame.DEFAULT;    int fAutoMonitorSubjobs = STAXMonitorFrame.AUTOMONITOR_NEVER;    String fLimitMessages = "";    Hashtable fRegisteredPlugins = new Hashtable();    JCheckBoxMenuItem fProcessMenu;    JCheckBoxMenuItem fSTAFCmdMenu;    JCheckBoxMenuItem fSubjobMenu;    JCheckBoxMenuItem fTestcaseInfoMenu;    JCheckBoxMenuItem fTestcaseStatusMenu;    JCheckBoxMenuItem fActiveJobElementsMenu;    JCheckBoxMenuItem fCurrentSelectionMenu;    JCheckBoxMenuItem fMessagesMenu;    Hashtable fViewablePlugins = new Hashtable();    Hashtable fViewableComponents = new Hashtable();    JTabbedPane fActiveElementsPane = new JTabbedPane();    JTabbedPane fStatusPane = new JTabbedPane();    JTabbedPane fInfoPane = new JTabbedPane();    Vector fPluginJarsVector;    Vector fExternalPluginNotificationTypes = new Vector();    Hashtable fPluginNodeDetailsHashtable = new Hashtable();    STAXMonitorProcessExtension processTablePlugin;    STAXMonitorExtension stafcmdTablePlugin;    STAXMonitorExtension subjobTablePlugin;    STAXMonitorExtension testcaseTablePlugin;    STAXMonitorExtension testcaseInfoTablePlugin;    String fMessageFontName = "Dialog";    String fLogViewerFontName = "Dialog";    public STAXMonitorFrame()    {    }    public STAXMonitorFrame(STAXMonitor parentMonitor, String staxMach,                            String staxService, String staxMachNickname,                            String jobNum,                            String eventMach, String eventService,                            boolean showNoMonitorInfo, String limitMessages,                            Vector pluginJarsVector,                            int autoMonitorSubjobs) throws STAFException    {        this(false, parentMonitor, staxMach, staxService, staxMachNickname,             jobNum, eventMach, eventService, "", "", "", "", "", null,             showNoMonitorInfo, limitMessages, pluginJarsVector, null, "",             STAXMonitorFrame.DEFAULT, STAXMonitorFrame.DEFAULT,             STAXMonitorFrame.DEFAULT, STAXMonitorFrame.DEFAULT,             autoMonitorSubjobs);    }    public STAXMonitorFrame(STAXMonitor parentMonitor, String staxMachine,                            String staxServiceName,                             String staxMachineNickname, String jobNumber,                            String eventMachine, String eventServiceName,                            String xmlFileName, String xmlFileMachine,                            String function, String args, String jobName,                            Vector scripts, boolean showNoMonitorInfo,                            String limitMessages, Vector pluginJarsVector,                            Vector scriptFilesVector,                            String scriptFilesMachineName,                            int clearLogs, int logTCElapsedTime,                            int logTCNumStarts, int logTCStartStop,                            int autoMonitorSubjobs) throws STAFException    {        this(true, parentMonitor, staxMachine, staxServiceName,             staxMachineNickname, jobNumber,             eventMachine, eventServiceName, xmlFileName, xmlFileMachine,             function, args, jobName, scripts, showNoMonitorInfo,             limitMessages, pluginJarsVector, scriptFilesVector,             scriptFilesMachineName, clearLogs, logTCElapsedTime,             logTCNumStarts, logTCStartStop, autoMonitorSubjobs);    }    public STAXMonitorFrame(boolean newJob,                            STAXMonitor parentMonitor, String staxMachine,                            String staxServiceName,                            String staxMachineNickname, String jobNumber,                            String eventMachine, String eventServiceName,                            String xmlFileName, String xmlFileMachine,                            String function, String args, String jobName,                            Vector scripts,                            boolean showNoMonitorInfo,                            String limitMessages,                            Vector pluginJarsVector, Vector scriptFilesVector,                            String scriptFilesMachineName,                            int clearLogs,                            int autoMonitorSubjobs) throws STAFException    {        this(newJob, parentMonitor, staxMachine, staxServiceName,             staxMachineNickname, jobNumber,             eventMachine, eventServiceName, xmlFileName, xmlFileMachine,             function, args, jobName, scripts, showNoMonitorInfo,             limitMessages, pluginJarsVector, scriptFilesVector,             scriptFilesMachineName, clearLogs, STAXMonitorFrame.DEFAULT,             STAXMonitorFrame.DEFAULT, STAXMonitorFrame.DEFAULT,             autoMonitorSubjobs);    }    public STAXMonitorFrame(boolean newJob,                            STAXMonitor parentMonitor, String staxMachine,                            String staxServiceName,                            String staxMachineNickname,                            String jobNumber,                            String eventMachine, String eventServiceName,                            String xmlFileName, String xmlFileMachine,                            String function, String args, String jobName,                            Vector scripts,                            boolean fShowNoSTAXMonitorInformation,                            String limitMessages,                            Vector pluginJarsVector, Vector scriptFilesVector,                            String scriptFilesMachineName,                            int clearLogs, int logTCElapsedTime,                            int logTCNumStarts, int logTCStartStop,                            int autoMonitorSubjobs) throws STAFException    {        fPluginJarsVector = pluginJarsVector;        fParentMonitor = parentMonitor;        fStaxMachine = staxMachine;        fStaxServiceName = staxServiceName;        fStaxMachineNickname = staxMachineNickname;        fStaxConfigMachine = parentMonitor.getStaxConfigMachine();        fStaxInstanceUUID = parentMonitor.getStaxInstanceUUID();        fJobNumber = jobNumber;        fEventMachine = eventMachine;        fLimitMessages = limitMessages;        if (fEventMachine.equals(""))        {            fEventMachine = "local";        }        fEventServiceName = eventServiceName;        fXmlFileName = xmlFileName;        fXmlFileMachine = xmlFileMachine;        fFunction = function;        fArgs = args;        fJobName = jobName;        fScripts = scripts;        fScriptFilesVector = scriptFilesVector;        fScriptFilesMachineName = scriptFilesMachineName;        fClearLogs = clearLogs;        fLogTCElapsedTime = logTCElapsedTime;        fLogTCNumStarts = logTCNumStarts;        fLogTCStartStop = logTCStartStop;        fAutoMonitorSubjobs = autoMonitorSubjobs;        fMessageFontName = parentMonitor.getMessageFontName();        fLogViewerFontName = parentMonitor.getLogViewerFontName();        if (newJob)        {            StringBuffer request = new StringBuffer("EXECUTE HOLD file ");            request.append(STAFUtil.wrapData(fXmlFileName));            if (!fXmlFileMachine.equals(""))            {                request.append(" MACHINE ").append(                    STAFUtil.wrapData(fXmlFileMachine));            }            if (!fFunction.equals(""))            {                request.append(" FUNCTION ").append(                    STAFUtil.wrapData(fFunction));            }            if (fArgs != null && !fArgs.equals(""))            {                request.append(" ARGS ").append(STAFUtil.wrapData(fArgs));            }            if (fJobName != null && !fJobName.equals(""))            {                request.append(" JOBNAME ").append(                    STAFUtil.wrapData(fJobName));            }            if (fScripts != null)            {                if (!fScripts.isEmpty())                {                    for (int i=0; i < fScripts.size(); i++)                    {                        request.append(" SCRIPT ").append(                            STAFUtil.wrapData((String)fScripts.elementAt(i)));                    }                }            }            if (fScriptFilesMachineName != null &&                !fScriptFilesMachineName.equals(""))            {                request.append(" SCRIPTFILEMACHINE ").append(                    STAFUtil.wrapData(fScriptFilesMachineName));            }            if (fScriptFilesVector != null)            {                if (!fScriptFilesVector.isEmpty())                {                    for (int i=0; i < fScriptFilesVector.size(); i++)                    {                        request.append(" SCRIPTFILE ").append(                            STAFUtil.wrapData(                                (String)fScriptFilesVector.elementAt(i)));                    }                }            }            if (fClearLogs == STAXMonitorFrame.ENABLED)                request.append(" CLEARLOGS Enabled");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -