IDEMPIERE-455 Discover and fix FindBugs problems / Eclipse warning - Drop deprecated class AsyncProcess.

This commit is contained in:
Heng Sin Low 2012-12-23 15:16:09 +08:00
parent 7fcd2cba58
commit 84af8c3d6a
9 changed files with 14 additions and 83 deletions

View File

@ -632,7 +632,7 @@ public class MInOut extends X_M_InOut implements DocAction
pi.setRecord_ID ( getM_InOut_ID() );
pi.setIsBatch(true);
ServerProcessCtl.process(null, pi, null);
ServerProcessCtl.process(pi, null);
return pi.getPDFReport();
}

View File

@ -1291,7 +1291,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
pi.setRecord_ID ( getC_Invoice_ID() );
pi.setIsBatch(true);
ServerProcessCtl.process(null, pi, null);
ServerProcessCtl.process(pi, null);
return pi.getPDFReport();
}

View File

@ -628,7 +628,7 @@ public class MOrder extends X_C_Order implements DocAction
pi.setRecord_ID ( getC_Order_ID() );
pi.setIsBatch(true);
ServerProcessCtl.process(null, pi, null);
ServerProcessCtl.process(pi, null);
return pi.getPDFReport();
}

View File

@ -299,7 +299,7 @@ public class MRfQResponse extends X_C_RfQResponse
pi.setRecord_ID ( getC_RfQResponse_ID() );
pi.setIsBatch(true);
ServerProcessCtl.process(null, pi, null);
ServerProcessCtl.process(pi, null);
return pi.getPDFReport();
}

View File

@ -11,7 +11,6 @@ import org.compiere.model.PrintInfo;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.ServerProcessCtl;
import org.compiere.util.ASyncProcess;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
@ -104,9 +103,7 @@ public class ServerReportCtl {
pi.setParameter(jasperPrintParams.toArray(new ProcessInfoParameter[]{}));
ServerProcessCtl.process(null, // Parent set to null for synchronous processing, see bugtracker 3010932
pi,
null);
ServerProcessCtl.process(pi, null);
boolean result = true;
return(result);
@ -132,13 +129,10 @@ public class ServerReportCtl {
* Called from ProcessCtl.
* - Check special reports first, if not, create standard Report
*
* @param parent The window which invoked the printing
* @param WindowNo The windows number which invoked the printing
* @param pi process info
* @param IsDirectPrint if true, prints directly - otherwise View
* @return true if created
*/
static public boolean start (ASyncProcess parent, ProcessInfo pi)
static public boolean start (ProcessInfo pi)
{
/**

View File

@ -11,7 +11,6 @@ import org.compiere.interfaces.Server;
import org.compiere.model.MPInstance;
import org.compiere.model.MRule;
import org.compiere.print.ServerReportCtl;
import org.compiere.util.ASyncProcess;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -24,8 +23,6 @@ public class ServerProcessCtl implements Runnable {
/** Static Logger */
private static CLogger log = CLogger.getCLogger (ServerProcessCtl.class);
/** Parent */
ASyncProcess m_parent;
/** Process Info */
ProcessInfo m_pi;
private Trx m_trx;
@ -33,13 +30,11 @@ public class ServerProcessCtl implements Runnable {
/**************************************************************************
* Constructor
* @param parent Container & ASyncProcess
* @param pi Process info
* @param trx Transaction
*/
public ServerProcessCtl (ASyncProcess parent, ProcessInfo pi, Trx trx)
public ServerProcessCtl (ProcessInfo pi, Trx trx)
{
m_parent = parent;
m_pi = pi;
m_trx = trx; // handled correctly
} // ProcessCtl
@ -57,12 +52,11 @@ public class ServerProcessCtl implements Runnable {
* Called from APanel.cmd_print, APanel.actionButton and
* VPaySelect.cmd_generate
*
* @param parent ASyncProcess & Container
* @param pi ProcessInfo process info
* @param trx Transaction
* @return worker started ProcessCtl instance or null for workflow
*/
public static ServerProcessCtl process (ASyncProcess parent, ProcessInfo pi, Trx trx)
public static ServerProcessCtl process (ProcessInfo pi, Trx trx)
{
log.fine("ServerProcess - " + pi);
@ -94,17 +88,9 @@ public class ServerProcessCtl implements Runnable {
pi.setAD_PInstance_ID (instance.getAD_PInstance_ID());
// execute
ServerProcessCtl worker = new ServerProcessCtl(parent, pi, trx);
if (parent != null)
{
//asynchrous
worker.start();
}
else
{
//synchrous
ServerProcessCtl worker = new ServerProcessCtl(pi, trx);
worker.run();
}
return worker;
} // execute
@ -284,7 +270,7 @@ public class ServerProcessCtl implements Runnable {
{
m_pi.setReportingProcess(true);
// Start Report -----------------------------------------------
boolean ok = ServerReportCtl.start(m_parent, m_pi);
boolean ok = ServerReportCtl.start(m_pi);
m_pi.setSummary("Report", !ok);
}
/**********************************************************************

View File

@ -1,49 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.util;
import org.adempiere.util.IProcessUI;
import org.compiere.process.ProcessInfo;
/**
* Async Process Interface.
* <p>
* The Process implements the methods.
* The Worker is started like
* <code> MyWorker.start()</code>
* <p>
* The worker's run method basically executes
* <pre>
* process.lockUI(pi);
* process.executeAsync(pi);
* process.unlockUI(pi);
* </pre>
* The isUILocked() method is used internally (not called by worker).
*
* @author Jorg Janke
* @version $Id: ASyncProcess.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
* @deprecated
*/
public interface ASyncProcess extends IProcessUI
{
/**
* Method to be executed async.
* Called from the Worker
* @param pi ProcessInfo
*/
public void executeASync (ProcessInfo pi);
} // ASyncProcess

View File

@ -221,7 +221,7 @@ public class Scheduler extends AdempiereServer
// ==============================
ProcessInfo jasperpi = new ProcessInfo ("", process.getAD_Process_ID());
jasperpi.setIsBatch(true);
ServerProcessCtl.process(null, jasperpi, null);
ServerProcessCtl.process(jasperpi, null);
report = jasperpi.getPDFReport();
}
else

View File

@ -263,7 +263,7 @@ public class ReportAction implements EventListener<Event>
pi.setExport(true);
winReport.onClose();
ServerProcessCtl.process(null, pi, null);
ServerProcessCtl.process(pi, null);
try
{