http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java ---------------------------------------------------------------------- diff --git a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java index 83d3c8f..cdcf4c7 100644 --- a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java +++ b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java @@ -17,12 +17,6 @@ package org.apache.oodt.cas.webcomponents.filemgr; -import java.net.URL; -import java.util.List; -import java.util.Vector; -import java.util.logging.Level; -import java.util.logging.Logger; - import org.apache.oodt.cas.filemgr.metadata.CoreMetKeys; import org.apache.oodt.cas.filemgr.structs.Element; import org.apache.oodt.cas.filemgr.structs.Product; @@ -33,6 +27,12 @@ import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient; import org.apache.oodt.cas.metadata.Metadata; +import java.net.URL; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * * Describe your class here. @@ -120,7 +120,7 @@ public class FileManagerConn { try { types = this.fm.getProductTypes(); } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to obtain product types: Reason: [" + e.getMessage() + "]"); }
http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/Types.java ---------------------------------------------------------------------- diff --git a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/Types.java b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/Types.java index 703589d..b97c163 100644 --- a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/Types.java +++ b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/Types.java @@ -18,20 +18,9 @@ package org.apache.oodt.cas.webcomponents.filemgr.browser.types; //JDK imports -import java.io.Serializable; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Vector; -import java.util.logging.Level; -import java.util.logging.Logger; - -//OODT imports import org.apache.oodt.cas.filemgr.structs.ProductType; import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException; import org.apache.oodt.cas.webcomponents.filemgr.FileManagerConn; - -//Wicket imports import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; @@ -41,6 +30,17 @@ import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.util.GenericBaseModel; +import java.io.Serializable; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; + +//OODT imports +//Wicket imports + /** * * This page is mounted to: @@ -190,7 +190,7 @@ public class Types extends Panel { try { tuple.getCounts().add(fm.getFm().getNumProducts(type)); } catch (CatalogException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to set count for product type: [" + type.getName() + "]: Reason: [" + e.getMessage() + "]"); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/workflow/instance/WorkflowInstancesViewer.java ---------------------------------------------------------------------- diff --git a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/workflow/instance/WorkflowInstancesViewer.java b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/workflow/instance/WorkflowInstancesViewer.java index dd9c50b..7157e43 100644 --- a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/workflow/instance/WorkflowInstancesViewer.java +++ b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/workflow/instance/WorkflowInstancesViewer.java @@ -41,6 +41,8 @@ import org.apache.wicket.util.value.ValueMap; import java.text.NumberFormat; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -52,6 +54,7 @@ import java.util.List; */ public class WorkflowInstancesViewer extends Panel { + private static Logger LOG = Logger.getLogger(WorkflowInstancesViewer.class.getName()); private static final long serialVersionUID = -311004303658412137L; private WorkflowMgrConn wm; @@ -256,7 +259,7 @@ public class WorkflowInstancesViewer extends Panel { metString = metStrBuf.toString(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return metString; @@ -275,7 +278,7 @@ public class WorkflowInstancesViewer extends Panel { try { lifecycleMgr = new WorkflowLifecycleManager(lifecycleFilePath); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return lifecycleMgr != null ? WorkflowLifecycleManager .formatPct((lifecycleMgr.getPercentageComplete(inst)) * 100.0) : null; http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java index df13867..27a2335 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java @@ -19,6 +19,7 @@ package org.apache.oodt.cas.product; //JDK imports + import org.apache.oodt.cas.filemgr.structs.Product; import org.apache.oodt.cas.filemgr.structs.Reference; import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException; @@ -34,8 +35,14 @@ import org.apache.oodt.xmlquery.XMLQuery; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.net.*; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; import java.util.Collections; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.apache.oodt.cas.filemgr.metadata.CoreMetKeys.PRODUCT_ID; import static org.apache.oodt.cas.product.CASProductHandlerMetKeys.CAS_PROFILE_ID; @@ -53,6 +60,7 @@ import static org.apache.oodt.cas.product.CASProductHandlerMetKeys.FILE_HEADER; */ public class CASProductHandler implements LargeProductQueryHandler { + private static Logger LOG = Logger.getLogger(CASProductHandler.class.getName()); private XmlRpcFileManagerClient fm; public CASProductHandler() throws MalformedURLException, @@ -146,7 +154,7 @@ public class CASProductHandler implements LargeProductQueryHandler { + numRead + "]"); } } catch (IOException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new ProductException( "IO exception retrieving chunk of product: [" + id + "]: Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java index b29c693..7855c43 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java @@ -193,7 +193,7 @@ public class DataDeliveryServlet extends HttpServlet implements o2.write(buf, 0, n); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception delivering data!: Message: " + e.getMessage()); } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java index 86ef290..2542764 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java @@ -156,7 +156,7 @@ public class DatasetDeliveryServlet extends HttpServlet implements } while ((page != null && !page.isLastPage()) && (page.getPageProducts() != null && page.getPageProducts().size() > 0)); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new ServletException(e.getMessage()); } @@ -199,7 +199,7 @@ public class DatasetDeliveryServlet extends HttpServlet implements } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception delivering dataset: Message: " + e.getMessage()); } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java index 50b7026..8dc1e07 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java @@ -97,7 +97,7 @@ public class RDFDatasetServlet extends HttpServlet { try { this.rdfConf = RDFUtils.initRDF(config); } catch (FileNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new ServletException(e.getMessage()); } @@ -257,7 +257,7 @@ public class RDFDatasetServlet extends HttpServlet { try { types = fClient.getProductTypes(); } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error retrieving product types: Message: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java index 3af58b6..37abfd3 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java @@ -19,11 +19,37 @@ package org.apache.oodt.cas.product.rdf; //JDK imports +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.WordUtils; +import org.apache.oodt.cas.filemgr.structs.Product; +import org.apache.oodt.cas.filemgr.structs.ProductPage; +import org.apache.oodt.cas.filemgr.structs.ProductType; +import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException; +import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException; +import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException; +import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient; +import org.apache.oodt.cas.metadata.Metadata; +import org.apache.oodt.cas.metadata.util.PathUtils; +import org.apache.oodt.commons.xml.XMLUtils; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; @@ -31,31 +57,8 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.util.List; -import java.util.Vector; -import java.util.logging.Logger; -import java.util.logging.Level; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.WordUtils; //OODT imports -import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException; -import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException; -import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException; -import org.apache.oodt.cas.filemgr.structs.Product; -import org.apache.oodt.cas.filemgr.structs.ProductPage; -import org.apache.oodt.cas.filemgr.structs.ProductType; -import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient; -import org.apache.oodt.commons.xml.XMLUtils; -import org.apache.oodt.cas.metadata.Metadata; -import org.apache.oodt.cas.metadata.util.PathUtils; /** * @@ -100,7 +103,7 @@ public class RDFProductServlet extends HttpServlet { try { this.rdfConf = RDFUtils.initRDF(config); } catch (FileNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new ServletException(e.getMessage()); } @@ -170,7 +173,7 @@ public class RDFProductServlet extends HttpServlet { } } catch (CatalogException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log(Level.WARNING, "Exception getting products from Catalog: Message: " @@ -214,7 +217,7 @@ public class RDFProductServlet extends HttpServlet { try { productType = fClient.getProductTypeById(productTypeIdStr); } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.SEVERE, "Unable to obtain product type from product type id: [" + ((Product) products.get(0)).getProductType() @@ -317,7 +320,7 @@ public class RDFProductServlet extends HttpServlet { try { met = fClient.getMetadata(p); } catch (CatalogException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error retrieving metadata for product: [" + p.getProductId() + "]: Message: " + e.getMessage()); } @@ -331,7 +334,7 @@ public class RDFProductServlet extends HttpServlet { try { types = fClient.getProductTypes(); } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error retrieving product types: Message: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java index 285bc3c..a279fb0 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java @@ -69,7 +69,6 @@ import javax.xml.transform.stream.StreamResult; * */ public class RSSProductServlet extends HttpServlet { - /* serial Version UID */ private static final long serialVersionUID = -465321738239885777L; @@ -170,7 +169,7 @@ public class RSSProductServlet extends HttpServlet { } } catch (CatalogException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log(Level.WARNING, "Exception getting products from Catalog: Message: " @@ -227,7 +226,7 @@ public class RSSProductServlet extends HttpServlet { try { productType = fm.getProductTypeById(productTypeIdStr); } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.SEVERE, "Unable to obtain product type from product type id: [" + ((Product) products.get(0)).getProductType() @@ -296,7 +295,7 @@ public class RSSProductServlet extends HttpServlet { try { return fm.getMetadata(p); } catch (CatalogException ignore) { - ignore.printStackTrace(); + LOG.log(Level.SEVERE, ignore.getMessage()); return null; } } @@ -305,7 +304,7 @@ public class RSSProductServlet extends HttpServlet { try { return fm.getProductReferences(p); } catch (CatalogException ignore) { - ignore.printStackTrace(); + LOG.log(Level.SEVERE, ignore.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java ---------------------------------------------------------------------- diff --git a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java index 3574e1f..a62604c 100644 --- a/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java +++ b/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java @@ -157,7 +157,7 @@ public class RSSProductTransferServlet extends HttpServlet { try { currentTransfers = fClient.getCurrentFileTransfers(); } catch (DataTransferException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting current transfers from file manager: Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java index a9d7424..e3d8a1a 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java @@ -296,7 +296,7 @@ public class IterativeWorkflowProcessorThread implements WorkflowStatus, .getWorkflowInstanceById(workflowInst.getId()); workflowInst = updatedInst; } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to get " + "updated workflow " + "instance record " + "when executing remote job: Message: " + e.getMessage()); @@ -572,7 +572,7 @@ public class IterativeWorkflowProcessorThread implements WorkflowStatus, LOG.log(Level.INFO, "Executing task: [" + taskName + "] locally"); instance.run(met, cfg); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception executing task: [" + taskName + "] locally: Message: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngine.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngine.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngine.java index 66102ec..315f3b9 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngine.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngine.java @@ -18,11 +18,7 @@ package org.apache.oodt.cas.workflow.engine; //JDK imports -import java.net.URL; -import java.util.Calendar; -import java.util.logging.Logger; -//OODT imports import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessorQueue; import org.apache.oodt.cas.workflow.engine.runner.EngineRunner; @@ -40,6 +36,13 @@ import org.apache.oodt.cas.workflow.structs.WorkflowInstance; import org.apache.oodt.cas.workflow.structs.exceptions.EngineException; import org.apache.oodt.cas.workflow.structs.exceptions.InstanceRepositoryException; +import java.net.URL; +import java.util.Calendar; +import java.util.logging.Level; +import java.util.logging.Logger; + +//OODT imports + /** * * Describe your class here. @@ -250,7 +253,7 @@ public class PrioritizedQueueBasedWorkflowEngine implements WorkflowEngine { repo.updateWorkflowInstance(inst); } } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new EngineException(e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngineFactory.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngineFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngineFactory.java index 99b5725..9a028df 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngineFactory.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/PrioritizedQueueBasedWorkflowEngineFactory.java @@ -18,6 +18,7 @@ package org.apache.oodt.cas.workflow.engine; //OODT imports + import org.apache.oodt.cas.metadata.util.PathUtils; import org.apache.oodt.cas.workflow.engine.runner.EngineRunner; import org.apache.oodt.cas.workflow.instrepo.WorkflowInstanceRepository; @@ -26,6 +27,9 @@ import org.apache.oodt.cas.workflow.repository.WorkflowRepository; import org.apache.oodt.cas.workflow.structs.PrioritySorter; import org.apache.oodt.cas.workflow.util.GenericWorkflowObjectFactory; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * * Constructs an instance of the {@link PrioritizedQueueBasedWorkflowEngine}, @@ -38,7 +42,7 @@ import org.apache.oodt.cas.workflow.util.GenericWorkflowObjectFactory; */ public class PrioritizedQueueBasedWorkflowEngineFactory implements WorkflowEngineFactory { - + private static Logger LOG = Logger.getLogger(PrioritizedQueueBasedWorkflowEngine.class.getName()); private static final String MODEL_REPO_FACTORY_PROPERTY = "workflow.repo.factory"; private static final String INSTANCE_REPO_FACTORY_PROPERTY = "workflow.engine.instanceRep.factory"; @@ -66,7 +70,7 @@ public class PrioritizedQueueBasedWorkflowEngineFactory implements getWorkflowLifecycle(), getEngineRunner(), getModelRepository(), getWaitSeconds()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java index 8f37643..3960108 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java @@ -211,7 +211,7 @@ public class TaskQuerier implements Runnable { repo.updateWorkflowInstance(instance); } } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to update workflow instance: [" + instance.getId() + "] status to [" + instance.getState().getName() + "]. Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskRunner.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskRunner.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskRunner.java index bef6118..83f55b1 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskRunner.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskRunner.java @@ -18,16 +18,17 @@ package org.apache.oodt.cas.workflow.engine; //JDK imports -import java.util.logging.Level; -import java.util.logging.Logger; - -//OODT imports import org.apache.oodt.cas.workflow.engine.processor.TaskProcessor; import org.apache.oodt.cas.workflow.engine.runner.EngineRunner; import org.apache.oodt.cas.workflow.structs.ParentChildWorkflow; import org.apache.oodt.cas.workflow.structs.WorkflowInstance; import org.apache.oodt.cas.workflow.structs.WorkflowTask; +import java.util.logging.Level; +import java.util.logging.Logger; + +//OODT imports + /** * * Implements the TaskRunner framework. Acts as a thread that works with the @@ -88,7 +89,7 @@ public class TaskRunner implements Runnable { runner.execute(nextTaskProcessor); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log( Level.SEVERE, "Engine failed while submitting jobs to its runner : " http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ThreadPoolWorkflowEngine.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ThreadPoolWorkflowEngine.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ThreadPoolWorkflowEngine.java index aa096fd..8e5ed4a 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ThreadPoolWorkflowEngine.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ThreadPoolWorkflowEngine.java @@ -333,7 +333,7 @@ public class ThreadPoolWorkflowEngine implements WorkflowEngine, WorkflowStatus + ", however, this engine is " + "not tracking its execution and the id: [" + workflowInstId + "] " + "was never persisted to " + "the instance repository"); - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return new Metadata(); } } @@ -445,7 +445,7 @@ public class ThreadPoolWorkflowEngine implements WorkflowEngine, WorkflowStatus instRep.updateWorkflowInstance(wInst); } } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new EngineException(e.getMessage()); } @@ -463,7 +463,7 @@ public class ThreadPoolWorkflowEngine implements WorkflowEngine, WorkflowStatus try { return DateConvert.isoParse(isoTimeStr); } catch (Exception ignore) { - ignore.printStackTrace(); + LOG.log(Level.SEVERE, ignore.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessorQueue.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessorQueue.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessorQueue.java index 3588fe3..dd4b9ba 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessorQueue.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessorQueue.java @@ -75,7 +75,7 @@ public class WorkflowProcessorQueue { try { page = repo.getPagedWorkflows(1); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to load workflow processors: Message: " + e.getMessage()); return null; @@ -90,7 +90,7 @@ public class WorkflowProcessorQueue { try { processor = fromWorkflowInstance(inst); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to convert workflow instance: [" + inst.getId() + "] into WorkflowProcessor: Message: " + e.getMessage()); @@ -117,7 +117,7 @@ public class WorkflowProcessorQueue { repo.updateWorkflowInstance(inst); } } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to update workflow instance: [" + inst.getId() + "] with status: [" + inst.getState().getName() + "]: Message: " @@ -362,7 +362,7 @@ public class WorkflowProcessorQueue { modelRepo.addTask(task); } catch(RepositoryException e){ - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } } @@ -372,7 +372,7 @@ public class WorkflowProcessorQueue { try { modelRepo.addWorkflow(workflow); } catch (RepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } } @@ -445,7 +445,7 @@ public class WorkflowProcessorQueue { } } catch(RepositoryException e){ - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return null; http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AbstractEngineRunnerBase.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AbstractEngineRunnerBase.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AbstractEngineRunnerBase.java index d5ad499..59191a1 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AbstractEngineRunnerBase.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AbstractEngineRunnerBase.java @@ -89,7 +89,7 @@ public abstract class AbstractEngineRunnerBase extends EngineRunner { instRep.updateWorkflowInstance(instance); } } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unabled to persist workflow instance: [" + instance.getId() + "]: Message: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java index d8e96c1..51ed79d 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java @@ -91,7 +91,7 @@ public class AsynchronousLocalEngineRunner extends AbstractEngineRunnerBase { taskProcessor.getWorkflowInstance().setState(state); persist(taskProcessor.getWorkflowInstance()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); String msg = "Exception executing task: [" + workflowTask.getTaskName() + "]: Message: " + e.getMessage(); LOG.log(Level.WARNING, msg); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/examples/RandomStatusUpdateTask.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/examples/RandomStatusUpdateTask.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/examples/RandomStatusUpdateTask.java index 52bf398..8f06c49 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/examples/RandomStatusUpdateTask.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/examples/RandomStatusUpdateTask.java @@ -20,15 +20,19 @@ package org.apache.oodt.cas.workflow.examples; //OODT imports + import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.structs.WorkflowTaskConfiguration; import org.apache.oodt.cas.workflow.structs.WorkflowTaskInstance; import org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManagerClient; -//JDK imports import java.net.MalformedURLException; import java.net.URL; import java.util.Random; +import java.util.logging.Level; +import java.util.logging.Logger; + +//JDK imports /** @@ -41,7 +45,7 @@ import java.util.Random; * programmatically. */ public class RandomStatusUpdateTask implements WorkflowTaskInstance { - + private static Logger LOG = Logger.getLogger(RandomStatusUpdateTask.class.getName()); private static final String[] statuses = new String[] { "THINKING", "RUNNING", "WAITING", "INFINITELY WAITING", "WATCHING TV", "SLEEPING", "DREAMING", "WORKING", "WATCHING MOVIES" }; @@ -84,7 +88,7 @@ public class RandomStatusUpdateTask implements WorkflowTaskInstance { try { this.client.updateWorkflowInstanceStatus(wInstId, status); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -98,7 +102,7 @@ public class RandomStatusUpdateTask implements WorkflowTaskInstance { try { return new URL(urlStr); } catch (MalformedURLException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/AbstractPaginatibleInstanceRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/AbstractPaginatibleInstanceRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/AbstractPaginatibleInstanceRepository.java index 5b29f54..cc1be8f 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/AbstractPaginatibleInstanceRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/AbstractPaginatibleInstanceRepository.java @@ -59,7 +59,7 @@ public abstract class AbstractPaginatibleInstanceRepository implements try { firstPage = getPagedWorkflows(1); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting first page: Message: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepository.java index d8b62db..8210d5e 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepository.java @@ -132,7 +132,7 @@ public class DataSourceWorkflowInstanceRepository extends // now add its metadata addWorkflowInstanceMetadata(wInst); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception starting workflow. Message: " + e.getMessage()); try { @@ -225,7 +225,7 @@ public class DataSourceWorkflowInstanceRepository extends addWorkflowInstanceMetadata(wInst); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception updating workflow instance. Message: " + e.getMessage()); @@ -286,7 +286,7 @@ public class DataSourceWorkflowInstanceRepository extends removeWorkflowInstanceMetadata(wInst.getId()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception removing workflow instance. Message: " + e.getMessage()); @@ -354,7 +354,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instance. Message: " + e.getMessage()); @@ -433,7 +433,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instance. Message: " + e.getMessage()); @@ -515,7 +515,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instance. Message: " + e.getMessage()); @@ -586,7 +586,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting num workflow instances. Message: " + e.getMessage()); @@ -659,7 +659,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting num workflow instances by status. Message: " + e.getMessage()); @@ -775,7 +775,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception performing query. Message: " + e.getMessage()); try { @@ -843,7 +843,7 @@ public class DataSourceWorkflowInstanceRepository extends } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instance metadata. Message: " + e.getMessage()); @@ -927,7 +927,7 @@ public class DataSourceWorkflowInstanceRepository extends conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding metadata [" + key + "=>" + val + "] to workflow inst: [" + wInstId + "]. Message: " + e.getMessage()); @@ -981,7 +981,7 @@ public class DataSourceWorkflowInstanceRepository extends conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception removing workflow instance metadata. Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/LuceneWorkflowInstanceRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/LuceneWorkflowInstanceRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/LuceneWorkflowInstanceRepository.java index 2b2184d..52689cb 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/LuceneWorkflowInstanceRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/LuceneWorkflowInstanceRepository.java @@ -411,7 +411,7 @@ public class LuceneWorkflowInstanceRepository extends + inst.getId() + "]"); reader.deleteDocuments(new Term("workflow_inst_id", inst.getId())); } catch (IOException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log(Level.WARNING, "Exception removing workflow instance: [" http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java index 0da8cc8..05f36ad 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java @@ -108,7 +108,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow. Message: " + e.getMessage()); try { @@ -201,7 +201,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow. Message: " + e.getMessage()); try { @@ -294,7 +294,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflows. Message: " + e.getMessage()); try { @@ -380,7 +380,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting tasks for workflow. Message: " + e.getMessage()); try { @@ -465,7 +465,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting tasks for workflow. Message: " + e.getMessage()); try { @@ -552,7 +552,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflows for event. Message: " + e.getMessage()); try { @@ -640,7 +640,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting conditions for task. Message: " + e.getMessage()); try { @@ -726,7 +726,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting conditions for task. Message: " + e.getMessage()); try { @@ -805,7 +805,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting task configuration for taskId: " + taskId + " Message: " + e.getMessage()); @@ -880,7 +880,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting task configuration for condId: " + condId + " Message: " + e.getMessage()); @@ -958,7 +958,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting task by id. Message: " + e.getMessage()); try { @@ -1036,7 +1036,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting condition by id. Message: " + e.getMessage()); try { @@ -1115,7 +1115,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting registered events. Message: " + e.getMessage()); try { @@ -1270,7 +1270,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log( Level.WARNING, "Exception getting conditions for workflow. Message: " @@ -1352,7 +1352,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting tasks for workflow. Message: " + e.getMessage()); try { @@ -1430,7 +1430,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding workflow. Message: " + e.getMessage()); try { @@ -1521,7 +1521,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding task. Message: " + e.getMessage()); try { @@ -1596,7 +1596,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting conditions. Message: " + e.getMessage()); try { @@ -1676,7 +1676,7 @@ public class DataSourceWorkflowRepository implements WorkflowRepository { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting tasks. Message: " + e.getMessage()); try { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java index d2ce28f..a93a619 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java @@ -88,7 +88,7 @@ public class PackagedWorkflowRepository implements WorkflowRepository { try { this.init(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new InstantiationException(e.getMessage()); } } @@ -408,7 +408,7 @@ public class PackagedWorkflowRepository implements WorkflowRepository { computeWorkflowConditions(); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException(e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepositoryFactory.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepositoryFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepositoryFactory.java index 12ae9c9..57fe166 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepositoryFactory.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepositoryFactory.java @@ -62,7 +62,7 @@ public class PackagedWorkflowRepositoryFactory implements return new PackagedWorkflowRepository( Arrays.asList(new File(this.wDirPath).listFiles())); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log( Level.SEVERE, "Unable to create packaged workflow repository! Reason: " http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/HighestFIFOPrioritySorter.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/HighestFIFOPrioritySorter.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/HighestFIFOPrioritySorter.java index 53fe62c..883537a 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/HighestFIFOPrioritySorter.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/HighestFIFOPrioritySorter.java @@ -18,6 +18,8 @@ package org.apache.oodt.cas.workflow.structs; //JDK imports +import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessor; + import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -25,7 +27,6 @@ import java.util.logging.Level; import java.util.logging.Logger; //OODT imports -import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessor; /** * @@ -78,7 +79,7 @@ public class HighestFIFOPrioritySorter implements PrioritySorter { aliveTime = (double) (System.currentTimeMillis() - processorStub .getWorkflowInstance().getCreationDate().getTime()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to compute aliveTime for computing FIFO priority: Reason: [" + e.getMessage() + "]"); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/WorkflowInstance.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/WorkflowInstance.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/WorkflowInstance.java index e91c602..5c541bc 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/WorkflowInstance.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/structs/WorkflowInstance.java @@ -18,14 +18,18 @@ package org.apache.oodt.cas.workflow.structs; //JDK imports -import java.text.ParseException; -import java.util.Date; -//OODT imports import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.lifecycle.WorkflowState; import org.apache.oodt.commons.util.DateConvert; +import java.text.ParseException; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; + +//OODT imports + /** * A WorkflowInstance is an instantiation of the abstract description of a * Workflow provided by the {@link Workflow} class. WorkflowInstances have @@ -57,7 +61,7 @@ import org.apache.oodt.commons.util.DateConvert; * */ public class WorkflowInstance { - + private static Logger LOG = Logger.getLogger(WorkflowInstance.class.getName()); private ParentChildWorkflow workflow; private String id; @@ -308,7 +312,7 @@ public class WorkflowInstance { try { this.endDate = DateConvert.isoParse(endDateTimeIsoStr); } catch (ParseException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // fail silently besides this: it's just a setter } } @@ -333,7 +337,7 @@ public class WorkflowInstance { try { this.startDate = DateConvert.isoParse(startDateTimeIsoStr); } catch (ParseException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // fail silently besides this: it's just a setter } } @@ -364,7 +368,7 @@ public class WorkflowInstance { this.getTaskById(currentTaskId). setEndDate(DateConvert.isoParse(currentTaskEndDateTimeIsoStr)); } catch (ParseException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // fail silently besides this: it's just a setter } } @@ -394,7 +398,7 @@ public class WorkflowInstance { this.getTaskById(currentTaskId).setStartDate(DateConvert .isoParse(currentTaskStartDateTimeIsoStr)); } catch (ParseException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // fail silently besides this: it's just a setter } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java index f499061..020b489 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java @@ -154,7 +154,7 @@ public class XmlRpcWorkflowManager { return eventsVector; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting registered events from repository: Message: " + e.getMessage()); @@ -274,7 +274,7 @@ public class XmlRpcWorkflowManager { return workflowList; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting workflows for event: " + eventName + " from repository: Message: " + e.getMessage()); @@ -290,7 +290,7 @@ public class XmlRpcWorkflowManager { try { workflows = repo.getWorkflowsForEvent(eventName); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting workflows associated with event: " + eventName + ": Message: " + e.getMessage()); @@ -308,7 +308,7 @@ public class XmlRpcWorkflowManager { try { engine.startWorkflow(w, m); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new EngineException( "Engine exception when starting workflow: " + w.getName() + ": Message: " @@ -328,7 +328,7 @@ public class XmlRpcWorkflowManager { inst = engine.getInstanceRepository().getWorkflowInstanceById( wInstId); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error obtaining workflow instance with ID: [" + wInstId + "]: Message: " + e.getMessage()); @@ -381,7 +381,7 @@ public class XmlRpcWorkflowManager { workflowInsts = engine.getInstanceRepository() .getWorkflowInstancesByStatus(status); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instances by status: Message: [" + e.getMessage() + "]"); @@ -414,7 +414,7 @@ public class XmlRpcWorkflowManager { workflowInstances.add(workflowInstance); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new EngineException( "Exception getting workflow instances by statusfrom workflow engine: Message: " + e.getMessage()); @@ -433,7 +433,7 @@ public class XmlRpcWorkflowManager { workflowInsts = engine.getInstanceRepository() .getWorkflowInstances(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting workflow instances: Message: [" + e.getMessage() + "]"); @@ -468,7 +468,7 @@ public class XmlRpcWorkflowManager { } return workflowInstances; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new EngineException( "Exception getting workflow instances from workflow engine: Message: " + e.getMessage()); @@ -496,7 +496,7 @@ public class XmlRpcWorkflowManager { return workflows; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting workflows from repository: Message: " + e.getMessage()); @@ -513,7 +513,7 @@ public class XmlRpcWorkflowManager { WorkflowTask t = repo.getWorkflowTaskById(taskId); return XmlRpcStructFactory.getXmlRpcWorkflowTask(t); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting task by id: Message: " + e.getMessage()); @@ -526,7 +526,7 @@ public class XmlRpcWorkflowManager { WorkflowCondition c = repo.getWorkflowConditionById(conditionId); return XmlRpcStructFactory.getXmlRpcWorkflowCondition(c); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting condition by id: Message: " + e.getMessage()); @@ -539,7 +539,7 @@ public class XmlRpcWorkflowManager { Workflow workflow = repo.getWorkflowById(workflowId); return XmlRpcStructFactory.getXmlRpcWorkflow(workflow); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RepositoryException( "Exception getting workflow by id from the repository: Message: " + e.getMessage()); @@ -567,7 +567,7 @@ public class XmlRpcWorkflowManager { wInst = this.engine.getInstanceRepository() .getWorkflowInstanceById(wInstId); } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return false; } wInst.setCurrentTaskStartDateTimeIsoStr(startDateTimeIsoStr); @@ -581,7 +581,7 @@ public class XmlRpcWorkflowManager { wInst = this.engine.getInstanceRepository() .getWorkflowInstanceById(wInstId); } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return false; } wInst.setCurrentTaskEndDateTimeIsoStr(endDateTimeIsoStr); @@ -672,7 +672,7 @@ public class XmlRpcWorkflowManager { engine.getInstanceRepository().updateWorkflowInstance(wInst); return true; } catch (InstanceRepositoryException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return false; } } @@ -696,7 +696,7 @@ public class XmlRpcWorkflowManager { LOG.log(Level.WARNING, "Attempting to look up workflow: [" + wInst.getWorkflow() .getId() + "] in populate workflows. Message: " + e.getMessage()); - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -708,7 +708,7 @@ public class XmlRpcWorkflowManager { try { return repo.getWorkflowById(workflowId); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error getting workflow by its id: [" + workflowId + "]: Message: " + e.getMessage()); return new Workflow(); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java index 1e759de..c208ec8 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java @@ -19,6 +19,7 @@ package org.apache.oodt.cas.workflow.system; //APACHE imports + import org.apache.oodt.cas.cli.CmdLineUtility; import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.structs.Workflow; @@ -36,6 +37,7 @@ import java.net.URL; import java.util.Hashtable; import java.util.List; import java.util.Vector; +import java.util.logging.Level; import java.util.logging.Logger; //JDK imports @@ -144,7 +146,7 @@ public class XmlRpcWorkflowManagerClient { pageHash = (Hashtable) client.execute("workflowmgr.getPrevPage", argList); } catch (XmlRpcException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new Exception(e.getMessage()); } catch (IOException e) { throw new Exception(e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/util/CygwinScriptFile.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/CygwinScriptFile.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/CygwinScriptFile.java index 2427401..42ef36a 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/CygwinScriptFile.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/CygwinScriptFile.java @@ -26,6 +26,8 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @author riverma (Rishi Verma) @@ -38,7 +40,7 @@ import java.util.List; * */ public class CygwinScriptFile extends ScriptFile { - + private static Logger LOG = Logger.getLogger(CygwinScriptFile.class.getName()); /** * */ @@ -66,7 +68,7 @@ public class CygwinScriptFile extends ScriptFile { new File(filePath)))); pw.print(toString()); // Changed println to print for Cygwin compatibility } catch (IOException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new WorkflowException("Error writing script file!: " + e.getMessage()); } finally { try { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/util/GenericWorkflowObjectFactory.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/GenericWorkflowObjectFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/GenericWorkflowObjectFactory.java index cf7e1aa..48b5ce4 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/GenericWorkflowObjectFactory.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/GenericWorkflowObjectFactory.java @@ -127,17 +127,17 @@ public final class GenericWorkflowObjectFactory { factory = (WorkflowInstanceRepositoryFactory) clazz.newInstance(); return factory.createInstanceRepository(); } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "ClassNotFoundException when " + "loading workflow instance repository factory class " + serviceFactory + " Message: " + e.getMessage()); } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "InstantiationException when " + "loading workflow instance repository factory class " + serviceFactory + " Message: " + e.getMessage()); } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when loading " + "workflow instance repository factory class " + serviceFactory + " Message: " + e.getMessage()); @@ -171,18 +171,18 @@ public final class GenericWorkflowObjectFactory { return taskInstance; } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "ClassNotFound, Unable to locate task class: " + className + ": cannot instantiate!"); return null; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to instantiate task class: " + className + ": Reason: " + e.getMessage() + " !"); return null; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when instantiating task class: " + className + ": cannot instantiate!"); @@ -219,32 +219,32 @@ public final class GenericWorkflowObjectFactory { return taskInstance; } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "ClassNotFound, Unable to locate task class: " + className + ": cannot instantiate!"); return null; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to instantiate task class: " + className + ": Reason: " + e.getMessage() + " !"); return null; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when instantiating task class: " + className + ": cannot instantiate!"); return null; } catch (NoSuchMethodException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "NoSuchMethodException when instantiating task class: " + className + ": cannot instantiate!"); return null; } catch (InvocationTargetException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "InvocationTargetException when instantiating task class: " + className + ": cannot instantiate!"); @@ -278,18 +278,18 @@ public final class GenericWorkflowObjectFactory { .newInstance(); return conditionInstance; } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to locate condition class: " + className + ": cannot instantiate!"); return null; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to instantiate condition class: " + className + ": Reason: " + e.getMessage() + " !"); return null; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when instantiating condition class: " + className + ": cannot instantiate!"); @@ -322,18 +322,18 @@ public final class GenericWorkflowObjectFactory { .newInstance(); return workflow; } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to locate workflow class: " + className + ": cannot instantiate!"); return null; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to instantiate workflow class: " + className + ": Reason: " + e.getMessage() + " !"); return null; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when instantiating workflow class: " + className + ": cannot instantiate!"); @@ -351,18 +351,18 @@ public final class GenericWorkflowObjectFactory { return sorterClass.newInstance(); } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to locate workflow prioritizer class: " + className + ": cannot instantiate!"); return null; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to instantiate workflow prioritizer class: " + className + ": Reason: " + e.getMessage() + " !"); return null; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "IllegalAccessException when instantiating workflow prioritizer class: " + className + ": cannot instantiate!"); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/main/java/org/apache/oodt/cas/workflow/util/ScriptFile.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/ScriptFile.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/ScriptFile.java index e850b6a..0e123f1 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/ScriptFile.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/ScriptFile.java @@ -29,6 +29,8 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.List; import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @author mattmann @@ -41,7 +43,7 @@ import java.util.Vector; * */ public class ScriptFile { - + private static Logger LOG = Logger.getLogger(ScriptFile.class.getName()); private String commandShell = null; private List commands = null; @@ -115,7 +117,7 @@ public class ScriptFile { new File(filePath)))); pw.println(toString()); } catch (IOException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new WorkflowException("Error writing script file!: " + e.getMessage()); } finally { try { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/test/java/org/apache/oodt/cas/workflow/cli/UseMockClientCmdLineActionStore.java ---------------------------------------------------------------------- diff --git a/workflow/src/test/java/org/apache/oodt/cas/workflow/cli/UseMockClientCmdLineActionStore.java b/workflow/src/test/java/org/apache/oodt/cas/workflow/cli/UseMockClientCmdLineActionStore.java index c55cb5a..361f54d 100644 --- a/workflow/src/test/java/org/apache/oodt/cas/workflow/cli/UseMockClientCmdLineActionStore.java +++ b/workflow/src/test/java/org/apache/oodt/cas/workflow/cli/UseMockClientCmdLineActionStore.java @@ -17,15 +17,15 @@ package org.apache.oodt.cas.workflow.cli; //JDK imports -import java.util.Set; - -//OODT imports import org.apache.oodt.cas.cli.action.CmdLineAction; import org.apache.oodt.cas.cli.action.store.spring.SpringCmdLineActionStore; -import org.apache.oodt.cas.cli.exception.CmdLineActionStoreException; import org.apache.oodt.cas.workflow.cli.action.WorkflowCliAction; import org.apache.oodt.cas.workflow.system.MockXmlRpcWorkflowManagerClient; +import java.util.Set; + +//OODT imports + /** * A {@link SpringCmdLineActionStore} which sets {@link WorkflowCliAction}s * to use a {@link MockXmlRpcWorkflowManagerClient}. @@ -45,7 +45,7 @@ public class UseMockClientCmdLineActionStore extends SpringCmdLineActionStore { } } - public Set<CmdLineAction> loadSupportedActions() throws CmdLineActionStoreException { + public Set<CmdLineAction> loadSupportedActions() { Set<CmdLineAction> actions = super.loadSupportedActions(); for (CmdLineAction action : actions) { if (action instanceof WorkflowCliAction) { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/MockProcessorQueue.java ---------------------------------------------------------------------- diff --git a/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/MockProcessorQueue.java b/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/MockProcessorQueue.java index 87d28f4..c03360f 100644 --- a/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/MockProcessorQueue.java +++ b/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/MockProcessorQueue.java @@ -18,12 +18,15 @@ package org.apache.oodt.cas.workflow.engine; //JDK imports -import java.util.List; -import java.util.Vector; import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessor; import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessorQueue; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * * A mock {@link WorkflowProcessorQueue} object for use in testing. @@ -34,6 +37,8 @@ import org.apache.oodt.cas.workflow.engine.processor.WorkflowProcessorQueue; */ public class MockProcessorQueue extends WorkflowProcessorQueue { + private static Logger LOG = Logger.getLogger(MockProcessorQueue.class.getName()); + private QuerierAndRunnerUtils utils; private boolean consumed; @@ -61,7 +66,7 @@ public class MockProcessorQueue extends WorkflowProcessorQueue { this.consumed = true; } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/TestAsynchronousLocalEngineRunner.java ---------------------------------------------------------------------- diff --git a/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/TestAsynchronousLocalEngineRunner.java b/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/TestAsynchronousLocalEngineRunner.java index cd32455..35a3028 100644 --- a/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/TestAsynchronousLocalEngineRunner.java +++ b/workflow/src/test/java/org/apache/oodt/cas/workflow/engine/TestAsynchronousLocalEngineRunner.java @@ -18,16 +18,8 @@ package org.apache.oodt.cas.workflow.engine; //JDK imports -import java.io.BufferedReader; -import java.io.File; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -//APACHE imports import org.apache.commons.io.FileUtils; - -//OODT imports import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.engine.processor.TaskProcessor; import org.apache.oodt.cas.workflow.engine.runner.AsynchronousLocalEngineRunner; @@ -35,13 +27,24 @@ import org.apache.oodt.cas.workflow.structs.Priority; import org.apache.oodt.commons.date.DateUtils; import org.apache.oodt.commons.util.DateConvert; -//JODA imports import org.joda.time.DateTime; import org.joda.time.Seconds; -//Junit imports +import java.io.BufferedReader; +import java.io.File; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; + import junit.framework.TestCase; +//APACHE imports +//OODT imports +//JODA imports +//Junit imports + /** * * A test case for the {@link AsynchronousLocalEngineRunner}. @@ -51,7 +54,7 @@ import junit.framework.TestCase; * */ public class TestAsynchronousLocalEngineRunner extends TestCase { - + private static Logger LOG = Logger.getLogger(TestAsynchronousLocalEngineRunner.class.getName()); private AsynchronousLocalEngineRunner runner; protected File testDir; @@ -82,7 +85,7 @@ public class TestAsynchronousLocalEngineRunner extends TestCase { runner.execute(taskProcessor2); assertTrue(ranFast()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } } @@ -105,7 +108,7 @@ public class TestAsynchronousLocalEngineRunner extends TestCase { + ": seconds elapsed: [" + seconds.getSeconds() + "]"); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); ranFast = false; } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestExternScriptTaskInstance.java ---------------------------------------------------------------------- diff --git a/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestExternScriptTaskInstance.java b/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestExternScriptTaskInstance.java index 95d0365..a84acdc 100644 --- a/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestExternScriptTaskInstance.java +++ b/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestExternScriptTaskInstance.java @@ -19,17 +19,21 @@ package org.apache.oodt.cas.workflow.examples; //OODT imports + +import org.apache.commons.io.FileUtils; import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.structs.WorkflowTaskConfiguration; import org.apache.oodt.cas.workflow.structs.exceptions.RepositoryException; -//JDK imports import java.io.File; -import junit.framework.TestCase; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import junit.framework.TestCase; + +//JDK imports //APACHE imports -import org.apache.commons.io.FileUtils; /** * @author davoodi @@ -42,6 +46,7 @@ import org.apache.commons.io.FileUtils; */ public class TestExternScriptTaskInstance extends TestCase { + private static Logger LOG = Logger.getLogger(TestExternScriptTaskInstance.class.getName()); private static final String testScriptPath = new File( "./src/test/resources/myScript.sh").getAbsolutePath(); @@ -77,7 +82,7 @@ public class TestExternScriptTaskInstance extends TestCase { assertEquals(expectedStr.trim(), outputFileStr.trim()); } catch (IOException e) { // TODO Auto-generated catch block - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestFilterTask.java ---------------------------------------------------------------------- diff --git a/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestFilterTask.java b/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestFilterTask.java index 09d08a9..d1d60ce 100644 --- a/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestFilterTask.java +++ b/workflow/src/test/java/org/apache/oodt/cas/workflow/examples/TestFilterTask.java @@ -21,6 +21,9 @@ import org.apache.oodt.cas.metadata.Metadata; import org.apache.oodt.cas.workflow.structs.WorkflowTaskConfiguration; import org.apache.oodt.cas.workflow.structs.exceptions.WorkflowTaskInstanceException; +import java.util.logging.Level; +import java.util.logging.Logger; + import junit.framework.TestCase; /** @@ -29,6 +32,7 @@ import junit.framework.TestCase; */ public class TestFilterTask extends TestCase { + private static Logger LOG = Logger.getLogger(TestFilterTask.class.getName()); private FilterTask task; private Metadata dynMet; private WorkflowTaskConfiguration config; @@ -69,7 +73,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -82,7 +86,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -100,7 +104,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -113,7 +117,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -127,7 +131,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -139,7 +143,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet); @@ -154,7 +158,7 @@ public class TestFilterTask extends TestCase { try { task.run(dynMet, config); } catch (WorkflowTaskInstanceException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); fail(e.getMessage()); } assertNotNull(dynMet);
