Thread: [Jcrontab-developers] Job Schedulers and WAS v6
Brought to you by:
iolalla
From: anderson.padi <and...@ts...> - 2011-03-04 10:03:12
|
Hi Jcrontab-developers I'm creating a project that will be able to upload,download and cleanup. I've created the classes(upload,download,cleanUp & Servlet) but now I need to replace the Servlet(to avoid triggering from Url) with a Scheduler that can be triggered on webSphere App Server as the project will be deployed on WAS and be triggered by starting and stopping the application. Please help, i'm getting stuck on the way. Best Regards |
From: israel o. <io...@gm...> - 2011-03-04 11:17:17
|
Hi, You can start Jcrontab in the init method of the servlet and in the get and post do nothing, and there you have it., The first point in the FAQ applies to WAS. http://jcrontab.sourceforge.net/FAQ.shtml Cheers. El 04/03/2011 10:37, anderson.padi escribió: > > Hi Jcrontab-developers > > I'm creating a project that will be able to upload,download and cleanup. > I've created the classes(upload,download,cleanUp& Servlet) but now I need to > replace the Servlet(to avoid triggering from Url) with a Scheduler that can be > triggered on webSphere App Server as the project will be deployed on WAS and > be triggered by starting and stopping the application. > > Please help, i'm getting stuck on the way. > > > Best Regards > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Jcrontab-developers mailing list > Jcr...@li... > https://lists.sourceforge.net/lists/listinfo/jcrontab-developers |
From: anderson.padi <and...@ts...> - 2011-03-07 08:50:37
|
Hi Jcrontab-developers I have an issue that I thought it was sorted but I found out later that it wasn't, I have include the Jcrontab-2.0-RC0 jar but there's nowhere in the code where it is involved, what I need is to schedule my application to trigger one of the classes to either upload,cleanUp & or download atleast 3 times a day. Below is my Servlet class and I also have a helperServlet. You assistance will be much appreciated. Servlet.java package com.tsc.DynamicDocuments; import java.io.IOException; import java.util.Date; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.tsc.constants.DocumentManagerConstants; import com.tsc.DynamicDocuments.CleanUp; import com.tsc.DynamicDocuments.Download; import com.tsc.DynamicDocuments.Upload; /** * Servlet implementation class for Servlet: DynamicDocumentManagementServlet * */ public class TscServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { /** * */ private static final long serialVersionUID = 1L; /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#HttpServlet() */ public TscServlet() { super(); } /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } public void init(ServletConfig config) throws ServletException{ super.init(config); String actionType = config.getInitParameter("actionType"); if (actionType != null && actionType.trim().length() > 0) { try { synchronized (this) { System.out.println("Type is " + actionType); System.out.println("Begin at " + new Date()); if (actionType.equalsIgnoreCase(DocumentManagerConstants.TYPE_UPLOAD)) { Upload upload = new Upload(); upload.doUpload(); } else if (actionType.equalsIgnoreCase(DocumentManagerConstants.TYPE_DOWNLOAD)) { Download download = new Download(); download.doDownload(); } else if (actionType.equalsIgnoreCase(DocumentManagerConstants.TYPE_CLEAN_UP)) { CleanUp cleanUp = new CleanUp(); cleanUp.doCleanUp(); } else { System.out.println("The requested parameter " + actionType + " is invalid "); } System.out.println("Ended at " + new Date()); } } catch (Exception e) { System.out.println("Error : " + e.getMessage()); } } else { System.out.println("The type of action is no provied"); } } } Kind Regards |