1 25 26 29 package net.killingar.forum.actions.task; 30 31 public class Volunteer extends ActionTaskSupport 32 { 33 35 private long task = -1; 37 38 40 public void setTask(long inTask) { task = inTask; } 42 43 public long getTask() { return task; } 45 46 protected String doExecute() 48 { 49 try 50 { 51 if (task == -1 || taskMgr.getTask(task) == null) 52 { 53 addErrorMessage("no or invalid task specified"); 54 return ERROR; 55 } 56 57 taskMgr.volunteer(task); 58 } 59 catch (Exception e) 60 { 61 e.printStackTrace(); 62 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 63 return ERROR; 64 } 65 66 return SUCCESS; 67 } 68 } 69 | Popular Tags |