Changeset 353 for kraken-cron/src
- Timestamp:
- 10/17/09 16:31:47 (11 months ago)
- Location:
- kraken-cron/src/main/java/org/krakenapps/cron
- Files:
-
- 4 modified
-
CronScript.java (modified) (2 diffs)
-
CronService.java (modified) (1 diff)
-
impl/CronConfig.java (modified) (2 diffs)
-
impl/CronServiceImpl.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kraken-cron/src/main/java/org/krakenapps/cron/CronScript.java
r352 r353 90 90 } catch (NumberFormatException e) { 91 91 context.println("USAGE : SCHEDULE_ID"); 92 } catch (NoSuchElementException e) {92 } catch (NoSuchElementException e) { 93 93 context.println("cron script: no schedule of given id %d", Integer.parseInt(args[0])); 94 94 } … … 162 162 } 163 163 164 164 165 } -
kraken-cron/src/main/java/org/krakenapps/cron/CronService.java
r352 r353 10 10 */ 11 11 public interface CronService { 12 void registerSchedule(Schedule schedule); 12 13 int registerSchedule(Schedule schedule); 13 14 14 15 void unregisterSchedule(int i); -
kraken-cron/src/main/java/org/krakenapps/cron/impl/CronConfig.java
r352 r353 116 116 private int update(String expression) { 117 117 Statement st = null; 118 PreparedStatement pst = null; 118 119 int autoIncKeyFromApi = -1; 119 120 try { 120 121 connect(); 122 pst = connection.prepareStatement(expression); 123 pst.execute(); 121 124 st = connection.createStatement(); 122 st.executeUpdate(expression);123 125 ResultSet rs = st.executeQuery("CALL IDENTITY()"); 124 126 if (rs.next()) { … … 130 132 } catch (Exception e) { 131 133 logger.debug("CronConfig : exception raised during " + expression + ". IGNORED."); 134 e.printStackTrace(); 132 135 rollback(); 133 136 } finally { -
kraken-cron/src/main/java/org/krakenapps/cron/impl/CronServiceImpl.java
r352 r353 42 42 */ 43 43 @Override 44 public voidregisterSchedule(Schedule schedule) {44 public int registerSchedule(Schedule schedule) { 45 45 int id = config.addEntry(schedule); 46 46 this.map.put(id, schedule); 47 47 scheduler.put(id, schedule); 48 return id; 48 49 } 49 50
