/[projects]/dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/tasks/Task.java
ViewVC logotype

Diff of /dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/tasks/Task.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2918 by torben, Thu Feb 4 14:40:36 2016 UTC revision 2993 by torben, Tue Mar 29 19:49:38 2016 UTC
# Line 37  public abstract class Task implements Ru Line 37  public abstract class Task implements Ru
37          @Override          @Override
38          public final void run() {          public final void run() {
39                                    
40                    if (this.state == TaskState.STATE_ABORTED) {//if this task as cancelled while still in queue  
41                            return;
42                    }
43                    
44                    
45                    
46                  TaskLogger.getInstance().reset();                  TaskLogger.getInstance().reset();
47                                    
48                  TimingHelper timing = new TimingHelper();                  TimingHelper timing = new TimingHelper();
# Line 56  public abstract class Task implements Ru Line 62  public abstract class Task implements Ru
62                                                    
63                                                    
64                  } catch (Exception e) {                  } catch (Exception e) {
65                            logger.warning("Error during taskrun", e);
66                          this.errorMsg = e.getMessage();                          this.errorMsg = e.getMessage();
                         e.printStackTrace();  
67                          this.state = TaskState.STATE_ABORTED;                          this.state = TaskState.STATE_ABORTED;
68                  }                  }
69                                    
# Line 66  public abstract class Task implements Ru Line 72  public abstract class Task implements Ru
72                  logger.info("Done " + this.getDescription() + "   " + timing.getElapsed() + "ms");                  logger.info("Done " + this.getDescription() + "   " + timing.getElapsed() + "ms");
73                                    
74                  logMessages = TaskLogger.getInstance().getBuffer();                  logMessages = TaskLogger.getInstance().getBuffer();
75                    
76                    
77            
78                    
79          }          }
80                    
81          public final String getLog() {          public final String getLog() {
# Line 118  public abstract class Task implements Ru Line 128  public abstract class Task implements Ru
128          }          }
129                    
130          @Override          @Override
131          public final boolean equals(Object o) {          public int hashCode() {
132                    return this.id;
133            }
134            
135            @Override
136            public boolean equals(Object o) {
137                    if (! (o instanceof Task))
138                            return false;
139                    
140                  Task otherTask = (Task) o;                  Task otherTask = (Task) o;
141                                    
142                  return this.getId() == otherTask.getId();                  return this.getId() == otherTask.getId();

Legend:
Removed from v.2918  
changed lines
  Added in v.2993

  ViewVC Help
Powered by ViewVC 1.1.20