Java Code Examples for org.hy.common.xml.XJava#getObject()

The following examples show how to use org.hy.common.xml.XJava#getObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JU_Sheets.java    From hy.common.report with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Test
public void test_Sheets() throws Exception
{
    List<JUBase<?>> v_Junits          = (List<JUBase<?>>)XJava.getObject("Junits");
    List<RTemplate> v_ReportTemplates = (List<RTemplate>)XJava.getObject("ReportTemplates");
    RWorkbook       v_RWorkbook       = null;
    RTemplate       v_RTemplate       = null;
    
    for (int i_Index=0; i_Index<v_ReportTemplates.size(); i_Index++)
    {
        v_RTemplate = v_ReportTemplates.get(i_Index);
        v_RWorkbook = ReportHelp.toExcel(v_RWorkbook ,v_Junits.get(i_Index).getDatas(10) ,v_RTemplate);
    }
    
    ExcelHelp.save(v_RWorkbook.getWorkbook() ,"/Users/hy/Downloads/Sheets");
}
 
Example 2
Source File: JU_PageTitle.java    From hy.common.report with Apache License 2.0 6 votes vote down vote up
@Test
public void test_PageTitle() throws RTemplateException
{
    RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReportPageTitle");
    RTemplate v_Clone     = new RTemplate(v_RTemplate);
    
    // 分页页眉、分页页脚的演示
    ExcelHelp.save(ReportHelp.toExcel(getDatas(10) ,v_RTemplate).getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ReportPageTitle.Page.xlsx");
    
    // 仅分页页眉的演示
    v_RTemplate.setTitlePageFooterBeginRow(null);
    ExcelHelp.save(ReportHelp.toExcel(getDatas(10) ,v_RTemplate).getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ReportPageTitle.Header.xlsx");
    
    // 仅分页页脚的演示
    v_RTemplate.init(v_Clone);
    v_RTemplate.setTitlePageHeaderBeginRow(null);
    ExcelHelp.save(ReportHelp.toExcel(getDatas(10) ,v_RTemplate).getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ReportPageTitle.Footer.xlsx");
    
    // 无分页的演示
    v_RTemplate.setTitlePageHeaderBeginRow(null);
    v_RTemplate.setTitlePageFooterBeginRow(null);
    ExcelHelp.save(ReportHelp.toExcel(getDatas(10) ,v_RTemplate).getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ReportPageTitle.Normal.xlsx");
}
 
Example 3
Source File: JU_Total03.java    From hy.common.report with Apache License 2.0 6 votes vote down vote up
@Test
public void test_Subtotal() throws RTemplateException
{
    RTemplate v_RTemplate01 = (RTemplate)XJava.getObject("PartSprayRecordStatistics");
    RTemplate v_RTemplate02 = (RTemplate)XJava.getObject("PartSprayRecordStatistics_t");
    
    
    List<PartSprayRecordGroup> v_Datas = getDatas(10);
    
    Date v_BeginTime = new Date();
    RWorkbook v_RWorkbook = null;
    
    v_RWorkbook = ReportHelp.toExcel(v_RWorkbook ,v_Datas ,v_RTemplate01);
    v_RWorkbook = ReportHelp.toExcel(v_RWorkbook ,v_Datas ,v_RTemplate02);
    
    ExcelHelp.save(v_RWorkbook.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\PartSprayRecordStatistics");
    Date v_EndTime  = new Date();
    
    System.out.println(v_EndTime.getTime() - v_BeginTime.getTime());
}
 
Example 4
Source File: SelectFamilyNameListener.java    From HBaseClient with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e)
{
    JComboBox v_FamilyNameObj = (JComboBox)e.getSource();
    JComboBox v_ColumnNameObj = null;
    
    if ( v_FamilyNameObj.getName().equals("Edit_FamilyName") )
    {
        v_ColumnNameObj = (JComboBox)XJava.getObject("Edit_ColumnName");
    }
    else
    {
        v_ColumnNameObj = (JComboBox)XJava.getObject("ColumnName");
        ((JComponent)XJava.getObject("xbSubmitFilter")).setEnabled(false);
    }
    
    this.getAppFrame().initColumnNames(e.getItem().toString() ,v_ColumnNameObj);
}
 
Example 5
Source File: JU_ReportNormal.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Normal() throws RTemplateException
{
    RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReportNormal");
    
    RWorkbook v_RWorkbook = ReportHelp.toExcel("常规列表加合计的报表演示" ,getDatas(10) ,v_RTemplate);
    
    // 同一Excel的工作表追加输出第二张报表。
    // 并且与前一张报表间隔3行空行
    v_RWorkbook = ReportHelp.toExcel(v_RWorkbook ,getDatas(20) ,v_RTemplate ,true ,3);
    
    ExcelHelp.save(v_RWorkbook.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ReportNormal.xlsx");
}
 
Example 6
Source File: JU_ImageReport02.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Image02() throws RTemplateException
{
    RTemplate             v_RTemplate = (RTemplate)XJava.getObject("Report_Image02_xlsx");
    List<ImageReportBean> v_Datas     = this.getDatas(3);
    
    RWorkbook v_RWorkbook02 = ReportHelp.toExcel(v_Datas ,v_RTemplate);
    
    ExcelHelp.save(v_RWorkbook02.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ImageReport_" + Date.getNowTime().getFull_ID() + ".xlsx");
}
 
Example 7
Source File: ShowDialogAction.java    From HBaseClient with GNU General Public License v3.0 5 votes vote down vote up
public JDialog getDialog()
{
    if ( !JavaHelp.isNull(this.dialogName) )
    {
        return (JDialog)XJava.getObject(this.dialogName);
    }
    else
    {
        throw new NullPointerException("Dialog name is null.");
    }
}
 
Example 8
Source File: JU_Report01.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Report01() throws RTemplateException
{
    RTemplate v_RTemplate01 = (RTemplate)XJava.getObject("Report01");
    RTemplate v_RTemplate02 = (RTemplate)XJava.getObject("Report02");
    
    ExcelHelp.save(ReportHelp.toExcel("XLSX格式" ,getDatas(11) ,v_RTemplate02).getWorkbook() ,"/Volumes/HY_HD_06/Downloads/Report01");
    // ExcelHelp.save(ReportHelp.toExcel("XLS格式"  ,getDatas(11) ,v_RTemplate01).getWorkbook() ,"/Volumes/HY_HD_06/Downloads/Report01");
}
 
Example 9
Source File: JU_Total02.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Subtotal() throws RTemplateException
{
    RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReportTotalSubtotal");
    
    
    List<ProductPressureTestStatisticsGroup> v_Datas = getDatas(100);
    
    Date v_BeginTime = new Date();
    ExcelHelp.save(ReportHelp.toExcel("小计、分组数据的报表演示" ,v_Datas ,v_RTemplate).getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\TotalSubtotal");
    Date v_EndTime  = new Date();
    
    System.out.println(v_EndTime.getTime() - v_BeginTime.getTime());
}
 
Example 10
Source File: JU_ReadVertical.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_ReadHorizontal()
{
    RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReadVertical");
    List<?>   v_Datas     = ReportHelp.toJava(v_RTemplate ,JU_ReadVertical.class.getResource("JU_ReadVertical_Datas.xlsx").toString());
    
    Help.print(v_Datas);
}
 
Example 11
Source File: JU_ImageReport02.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Image05() throws RTemplateException
{
    RTemplate             v_RTemplate = (RTemplate)XJava.getObject("Report_Image05_xlsx");
    List<ImageReportBean> v_Datas     = this.getDatas(3);
    
    RWorkbook v_RWorkbook05 = ReportHelp.toExcel(v_Datas ,v_RTemplate);
    v_RWorkbook05 = ReportHelp.toExcel(v_RWorkbook05 ,v_Datas ,v_RTemplate ,true);
    v_RWorkbook05 = ReportHelp.toExcel(v_RWorkbook05 ,v_Datas ,v_RTemplate ,true);
    
    ExcelHelp.save(v_RWorkbook05.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ImageReport_" + Date.getNowTime().getFull_ID() + ".xlsx");
}
 
Example 12
Source File: JU_FontReport.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Font() throws RTemplateException
{
    RTemplate      v_RTemplate = (RTemplate)XJava.getObject("Report_Font_xlsx");
    List<FontTest> v_Datas     = this.getDatas(1);
    
    RWorkbook v_RWorkbook02 = ReportHelp.toExcel(v_Datas ,v_RTemplate);
    
    ExcelHelp.save(v_RWorkbook02.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\FontReport_" + Date.getNowTime().getFull_ID() + ".xlsx");
}
 
Example 13
Source File: AppFrame.java    From HBaseClient with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 显示提示信息
 * 
 * @param i_HintInfo
 * @param i_Color
 */
public void showHintInfo(String i_HintInfo ,Color i_Color)
{
    JLabel v_XLHintInfo = (JLabel)XJava.getObject("xlHintInfo");
    
    v_XLHintInfo.setText(i_HintInfo);
    v_XLHintInfo.setForeground(i_Color);
    v_XLHintInfo.repaint();
    this.revalidate();
}
 
Example 14
Source File: AppFrame.java    From HBaseClient with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 初始化查询结果集列表的数据模型
 */
public void initTableModel()
{
    List<?> v_Titles = (List<?>)XJava.getObject("titles");
    this.tableModel = new DefaultTableModel();
    
    for (int v_ColIndex=0; v_ColIndex<v_Titles.size(); v_ColIndex++)
    {
        this.tableModel.addColumn(v_Titles.get(v_ColIndex));
    }
    
    
    JTable v_xtDataList = (JTable)XJava.getObject("xtDataList");
    v_xtDataList.setModel(this.tableModel);
    
    
    List<?> v_Titles_Size    = (List<?>)XJava.getObject("titles_Size");
    List<?> v_Titles_MaxSize = (List<?>)XJava.getObject("titles_MaxSize");
    for (int v_ColIndex=0; v_ColIndex<v_Titles_Size.size(); v_ColIndex++)
    {
        int v_Size    = Integer.parseInt(v_Titles_Size   .get(v_ColIndex).toString());
        int v_MaxSize = Integer.parseInt(v_Titles_MaxSize.get(v_ColIndex).toString());
        
        v_xtDataList.getColumnModel().getColumn(v_ColIndex).setMinWidth(v_Size);
        if ( v_MaxSize >= 0 )
        {
            v_xtDataList.getColumnModel().getColumn(v_ColIndex).setPreferredWidth(v_MaxSize);
        }
        
        v_xtDataList.getColumnModel().getColumn(v_ColIndex).setCellRenderer(new ResultCellRenderer());
    }
}
 
Example 15
Source File: JU_ImageReport02.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
@Test
public void test_Image03() throws RTemplateException
{
    RTemplate             v_RTemplate = (RTemplate)XJava.getObject("Report_Image03_xlsx");
    List<ImageReportBean> v_Datas     = this.getDatas(3);
    
    RWorkbook v_RWorkbook03 = ReportHelp.toExcel(v_Datas ,v_RTemplate);
    
    ExcelHelp.save(v_RWorkbook03.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\ImageReport_" + Date.getNowTime().getFull_ID() + ".xlsx");
}
 
Example 16
Source File: JU_Formula.java    From hy.common.report with Apache License 2.0 5 votes vote down vote up
/**
 * 测试:带公式的报表生成
 * 
 * @author      ZhengWei(HY)
 * @createDate  2020-05-21
 * @version     v1.0
 *
 * @throws RTemplateException
 */
@Test
public void test_Formula() throws RTemplateException
{
    RTemplate             v_RTemplate = (RTemplate)XJava.getObject("Report_Formula_xlsx");
    List<ImageReportBean> v_Datas     = this.getDatas(3);
    
    RWorkbook v_RWorkbook = ReportHelp.toExcel(v_Datas ,v_RTemplate);
    
    ExcelHelp.save(v_RWorkbook.getWorkbook() ,"C:\\Users\\ZhengWei\\Desktop\\Formula_" + Date.getNowTime().getFull_ID() + ".xlsx");
}
 
Example 17
Source File: AppFrame.java    From HBaseClient with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 设置当前选择的表对象
 * 
 * 将触发以下多个动作:
 * 1. 获取列族信息  (设置查询条件及编辑面板中的列族名控件)
 * 2. 猜想表结构     (设置查询条件及编辑面板中的字段名控件)
 * 3. 全表查询动作
 * 
 * @param tableName
 */
public synchronized void setTableName(String i_TableName)
{
    this.tableName = i_TableName;
    
    if ( Help.isNull(this.tableName) )
    {
        return;
    }
    
    this.getHPage().setRowKey("");
    this.setTables_Tools_Edit_Enabled(true);

    
    ((JTextComponent)XJava.getObject("RowKey"))     .setText("");
    ((JTextComponent)XJava.getObject("ColumnValue")).setText("");
    ((JCheckBox)     XJava.getObject("IsLike"))     .setSelected(true);
    
    
    // 获取列族信息
    JComboBox v_FamilyNameObj = (JComboBox)XJava.getObject("FamilyName");
    JComboBox v_FamilyEditObj = (JComboBox)XJava.getObject("Edit_FamilyName");
    v_FamilyNameObj.removeAllItems();
    v_FamilyEditObj.removeAllItems();
    v_FamilyNameObj.addItem("" ,"");
    v_FamilyEditObj.addItem("" ,"");
    List<String> v_FamilyNames = this.hbase.getTableFamilyNames(this.tableName);
    for (String v_FamilyName : v_FamilyNames)
    {
        v_FamilyNameObj.addItem(v_FamilyName ,v_FamilyName);
        v_FamilyEditObj.addItem(v_FamilyName ,v_FamilyName);
    }
    
    
    // 猜想表结构
    this.structure = this.hbase.getTableStructure(this.tableName);
    this.initColumnNames("" ,(JComboBox)XJava.getObject("ColumnName"));
    this.initColumnNames("" ,(JComboBox)XJava.getObject("Edit_ColumnName"));
    
    
    // 全表查询动作
    ((JButton)XJava.getObject("xbSubmit")).doClick();
}
 
Example 18
Source File: ExportActionListener.java    From HBaseClient with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onClick(ActionEvent arg0)
{
    if ( JavaHelp.isNull(this.getAppFrame().getTableName()) )
    {
        this.getAppFrame().showHintInfo("请先选择要导出的表" ,Color.BLUE);
        return;
    }
    
    if ( this.getAppFrame().getRowCount() == 0 )
    {
        this.getAppFrame().showHintInfo("查询结果无数据,无法导出" ,Color.BLUE);
        return;
    }
    
    
    JTable        v_JTable      = (JTable)XJava.getObject("xtDataList");
    int []        v_RowIndexArr = v_JTable.getSelectedRows();
    StringBuilder v_FileName    = new StringBuilder();
    
    // 生成文件名称
    v_FileName.append(this.getTableName());
    if ( v_RowIndexArr.length <= 0 )
    {
        String v_Text = "";
        
        v_Text = ((JTextComponent)XJava.getObject("RowKey"))     .getText();
        if ( !JavaHelp.isNull(v_Text) )
        {
            v_FileName.append("_R.").append(v_Text.trim());
        }
        
        v_Text = ((JComboBox)     XJava.getObject("FamilyName")) .getSelectedItem().toString();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_F.").append(v_Text.trim());
        }
        
        v_Text = ((JComboBox)     XJava.getObject("ColumnName")) .getSelectedItem().toString();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_C.").append(v_Text.trim());
        }
        
        v_Text = ((JTextComponent)XJava.getObject("ColumnValue")).getText();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_V.").append(v_Text.trim());
        }
    }
    else
    {
        v_FileName.append("_CCount.").append(v_RowIndexArr.length);
        v_FileName.append("_").append(Date.getNowTime().getFull_ID());
    }
    v_FileName.append(".txt");
    
    
    
    File         v_SaveFile    = new File(v_FileName.toString());
    JFileChooser v_FileChooser = new JFileChooser();
    v_FileChooser.setSelectedFile(v_SaveFile);
    
    int v_Result = v_FileChooser.showSaveDialog(this.getAppFrame());
    if ( v_Result == JFileChooser.APPROVE_OPTION )
    {
        v_SaveFile = v_FileChooser.getSelectedFile();
        
        this.writeContents(v_JTable ,v_RowIndexArr ,v_SaveFile);
    }
}
 
Example 19
Source File: EditSubmitActionListener.java    From HBaseClient with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onClick(ActionEvent arg0)
{
    HData v_HData = new HData();
    
    v_HData.setRowKey(    ((JTextComponent)XJava.getObject("Edit_RowKey"))     .getText().trim());
    v_HData.setFamilyName(((JComboBox)     XJava.getObject("Edit_FamilyName")) .getSelectedItem().toString().trim());
    v_HData.setColumnName(((JComboBox)     XJava.getObject("Edit_ColumnName")) .getSelectedItem().toString().trim());
    v_HData.setValue(     ((JTextComponent)XJava.getObject("Edit_ColumnValue")).getText().trim());
    
    if ( JavaHelp.isNull(v_HData.getRowKey()) )
    {
        this.getAppFrame().showHintInfo("提交时,行主键不能为空!" ,Color.RED);
        ((JComponent)XJava.getObject("Edit_RowKey")).requestFocus();
        return;
    }
    
    if ( JavaHelp.isNull(v_HData.getFamilyName()) )
    {
        this.getAppFrame().showHintInfo("提交时,列族名不能为空!" ,Color.RED);
        ((JComponent)XJava.getObject("Edit_FamilyName")).requestFocus();
        return;
    }
    
    if ( JavaHelp.isNull(v_HData.getColumnName()) )
    {
        this.getAppFrame().showHintInfo("提交时,字段名不能为空!" ,Color.RED);
        ((JComponent)XJava.getObject("Edit_ColumnName")).requestFocus();
        return;
    }
    
    try
    {
        HData v_OldHData = (HData)this.getHBase().getValue(this.getTableName() ,v_HData);
        
        this.getHBase().update(this.getTableName() ,v_HData);
        
        // 重新从数据库是查询一次,主要想获取时间戳
        HData v_NewHData = (HData)this.getHBase().getValue(this.getTableName() ,v_HData);
        
        JTable  v_JTable  = (JTable)XJava.getObject("xtDataList");
        int     v_RowNo   = v_JTable.getSelectedRow();
        int     v_OptType = 1; // 操作类型(0:修改   1:添加)
        
        if ( v_JTable.getSelectedRowCount() == 1 )
        {
            if ( v_NewHData.getRowKey().equals(v_JTable.getValueAt(v_RowNo ,1)) )
            {
                if ( v_NewHData.getFamilyName().equals(v_JTable.getValueAt(v_RowNo ,2)) )
                {
                    if ( v_NewHData.getColumnName().equals(v_JTable.getValueAt(v_RowNo ,3)) )
                    {
                        v_OptType = 0;
                    }
                }
            }
        }
        
        if ( v_OptType == 0 )
        {
            v_JTable.setValueAt(v_NewHData.getValue().toString()    ,v_RowNo ,4);
            v_JTable.setValueAt(v_NewHData.getTimestamp()           ,v_RowNo ,5);
            v_JTable.setValueAt(v_NewHData.getTime().getFullMilli() ,v_RowNo ,6);
            this.getAppFrame().showHintInfo("修改完成!" ,Color.BLUE);
        }
        else
        {
            this.getAppFrame().setRowCount(this.getAppFrame().getRowCount() + 1);
            this.getAppFrame().getTableModel().addRow(SubmitActionListener.$MY.toObjects(this.getAppFrame().getRowCount() ,v_NewHData));
            
            if ( v_OldHData != null )
            {
                this.getAppFrame().showHintInfo("修改完成,请刷新查询结果。" ,Color.BLUE);
            }
            else
            {
                this.getAppFrame().showHintInfo("添加完成!" ,Color.BLUE);
            }
        }
        
    }
    catch (Exception exce)
    {
        this.getAppFrame().showHintInfo("修改异常:" + exce.getMessage() ,Color.RED);
    }
}
 
Example 20
Source File: Job.java    From hy.common.tpool with Apache License 2.0 4 votes vote down vote up
/**
 * 执行任务的方法
 */
public void execute()
{
    if ( Help.isNull(this.xid) )
    {
        throw new NullPointerException("Job.getXid() is null.");
    }
    
    if ( Help.isNull(this.methodName) )
    {
        throw new NullPointerException("Job.getMethodName() is null."); 
    }
    
    try
    {
        Date    v_Now     = new Date();
        boolean v_IsAllow = false;
        
        if ( this.lastTime == null )
        {
            v_IsAllow     = true;
            this.lastTime = v_Now;
        }
        else if ( this.intervalType == Job.$IntervalType_Second 
               || this.intervalType == Job.$IntervalType_Manual
               || this.jobs         == null)
        {
            v_IsAllow     = true;
            this.lastTime = v_Now;
        }
        // 第二个地方再次预防,第一个地方在Jobs.execute()中。
        // 又添加一次预防的原因是:这里离 this.lastTime = new Date(); 最近。
        // 预防因主机系统时间不精确,时间同步机制异常(如来回调整时间、时间跳跃、时间波动等),
        // 造成定时任务重复执行的可能。  ZhengWei(HY) Add 2019-03-06
        else if ( !this.getLastTime().equalsYMDHM(v_Now) && this.getLastTime().differ(v_Now) < 0 )
        {
            v_IsAllow     = true;
            this.lastTime = v_Now;
        }
        // 手工执行时
        else if ( this.jobs != null && !this.jobs.isMonitor(this) )
        {
            v_IsAllow     = true;
            this.lastTime = v_Now;
        }
        
        if ( v_IsAllow )
        {
            this.runCount++;
            this.runLogs.put(this.lastTime.getFullMilli());
            
            // 本机执行:默认的
            if ( this.cloudSocket == null )
            {
                Object v_Object = XJava.getObject(this.xid.trim());
                if ( v_Object == null )
                {
                    throw new NullPointerException("Job.getXid() = " + this.xid + " XJava.getObject(...) is null.");
                }
                
                (new Execute(v_Object ,this.methodName.trim())).start();
            }
            // 云服务执行:当配置CloudServer时。
            else
            {
                (new Execute(this.cloudSocket ,"sendCommand" ,new Object[]{this.xid ,this.methodName.trim() ,false})).start();
            }
            
            System.out.println(Date.getNowTime().getFullMilli() + " 执行定时任务 " + this.xid + ":" + this.getTaskDesc());
        }
    }
    catch (Exception exce)
    {
        exce.printStackTrace();
    }
    
    if ( this.jobs != null )
    {
        // 注意:delMonitor()方法不要加同步锁。否则会出现线程阻塞
        this.jobs.delMonitor(this);
        this.finishTask();
    }
    else
    {
        // 当 this.jobs 为空时,表示本方法是手工执行,并不是定时任务自动执行的。
    }
}