[Red5commits] [658] lhubbard

luke@codegent.com luke at codegent.com
Sat Apr 8 19:20:04 EDT 2006


--


Timestamp: 04/09/06 07:11:39 (2 hours ago) 
Change: 658 
Author: lhubbard

Files (see diff or trac for details): 
java/server/trunk/src/org/red5/server/scheduling
java/server/trunk/src/org/red5/server/scheduling/ExampleBusinessObject.java
java/server/trunk/src/org/red5/server/scheduling/ExampleJob.java
java/server/trunk/src/org/red5/server/scheduling/QuartzTest.java


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/658

Index: /java/server/trunk/src/org/red5/server/scheduling/ExampleJob.java
===================================================================
--- /java/server/trunk/src/org/red5/server/scheduling/ExampleJob.java (revision 658)
+++ /java/server/trunk/src/org/red5/server/scheduling/ExampleJob.java (revision 658)
@@ -0,0 +1,52 @@
+package org.red5.server.scheduling;
+
+/*
+ * RED5 Open Source Flash Server - http://www.osflash.org/red5
+ * 
+ * Copyright © 2006 by respective authors. All rights reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it under the 
+ * terms of the GNU Lesser General Public License as published by the Free Software 
+ * Foundation; either version 2.1 of the License, or (at your option) any later 
+ * version. 
+ * 
+ * This library 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 Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License along 
+ * with this library; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (daccattato at gmail.com)
+ * @author Luke Hubbard, Codegent Ltd (luke at codegent.com)
+ */
+
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+/**
+ * ExampleJob
+ * This will be replaced by an actual service.  Just use this as 
+ * a template while implementing scheduled tasks
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (Dominick at gmail.com)
+ * @version 0.4
+ */
+public class ExampleJob extends QuartzJobBean {
+	private long lastExecutionDate;
+	
+	public void setLastExecutionDate(long lastExecutionDate) {
+		this.lastExecutionDate = lastExecutionDate;
+	}
+	
+	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
+		JobDataMap map = context.getJobDetail().getJobDataMap();
+		map.put("lastExecutionDate", System.currentTimeMillis());
+	}
+
+}
Index: /java/server/trunk/src/org/red5/server/scheduling/QuartzTest.java
===================================================================
--- /java/server/trunk/src/org/red5/server/scheduling/QuartzTest.java (revision 658)
+++ /java/server/trunk/src/org/red5/server/scheduling/QuartzTest.java (revision 658)
@@ -0,0 +1,53 @@
+package org.red5.server.scheduling;
+
+/*
+ * RED5 Open Source Flash Server - http://www.osflash.org/red5
+ * 
+ * Copyright © 2006 by respective authors. All rights reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it under the 
+ * terms of the GNU Lesser General Public License as published by the Free Software 
+ * Foundation; either version 2.1 of the License, or (at your option) any later 
+ * version. 
+ * 
+ * This library 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 Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License along 
+ * with this library; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (daccattato at gmail.com)
+ * @author Luke Hubbard, Codegent Ltd (luke at codegent.com)
+ */
+
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+/**
+ * QuartzTest
+ * This will be replaced by an actual service.  Just use this as 
+ * a template while implementing scheduled tasks
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (Dominick at gmail.com)
+ * @version 0.4
+ */
+public class QuartzTest {
+
+	private static String quartzConfigPath = "./conf/red5.xml";;
+	
+	public QuartzTest() {
+		System.out.println("in con");
+	}
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		//QuartzTest qt = new QuartzTest();
+		FileSystemXmlApplicationContext appCtx = new FileSystemXmlApplicationContext(quartzConfigPath);
+	}
+
+}
Index: /java/server/trunk/src/org/red5/server/scheduling/ExampleBusinessObject.java
===================================================================
--- /java/server/trunk/src/org/red5/server/scheduling/ExampleBusinessObject.java (revision 658)
+++ /java/server/trunk/src/org/red5/server/scheduling/ExampleBusinessObject.java (revision 658)
@@ -0,0 +1,52 @@
+package org.red5.server.scheduling;
+
+/*
+ * RED5 Open Source Flash Server - http://www.osflash.org/red5
+ * 
+ * Copyright © 2006 by respective authors. All rights reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it under the 
+ * terms of the GNU Lesser General Public License as published by the Free Software 
+ * Foundation; either version 2.1 of the License, or (at your option) any later 
+ * version. 
+ * 
+ * This library 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 Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License along 
+ * with this library; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (daccattato at gmail.com)
+ * @author Luke Hubbard, Codegent Ltd (luke at codegent.com)
+ */
+
+/**
+ * ExampleBusinessObject
+ * This will be replaced by an actual service.  Just use this as 
+ * a template while implementing scheduled tasks
+ * 
+ * @author The Red5 Project (red5 at osflash.org)
+ * @author Dominick Accattato (Dominick at gmail.com)
+ * @version 0.4
+ */
+
+public class ExampleBusinessObject {
+	private int counter = 0;
+	
+	public ExampleBusinessObject() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+	
+	/**
+	 * This is the method that get called on a specific schedule
+	 * @return void
+	 */
+	public void doSomething() {
+		//System.out.println("timer: " + counter++);
+	}
+
+}



More information about the Red5commits mailing list