00001 package net.threebit.utils.sosc;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 import java.io.*;
00023 import java.sql.*;
00024 import java.util.*;
00025
00032 public abstract class Job {
00033
00035 private String description = "No Description";
00036
00038 private Map args1 = new HashMap();
00039
00041 private Map args2 = new HashMap();
00042
00044 private int id = 0;
00045
00049 public Job () { }
00050
00056 public Job (int id, String description, Map args1, Map args2) {
00057 this.id = id;
00058 this.description = description;
00059 this.args1 = args1;
00060 this.args2 = args2;
00061 }
00062
00066 public int getId() {
00067 return id;
00068 }
00069
00075 public final void addToJobQueue(String queue, String description, Map args1) throws Exception {
00076 JobTool.getInstance().addJob(queue,description,"java",this.getClass().getName(), args1);
00077 }
00078
00084 public void log (String text) throws Exception {
00085 JobTool.getInstance().log(id, text);
00086 }
00087
00091 public abstract void execute() throws Exception;
00092
00093 }