1 package org.jbpm.taskmgmt.exe; 2 3 import java.io.Serializable ; 4 import java.util.HashSet ; 5 import java.util.Set ; 6 7 public class PooledActor implements Serializable { 8 9 private static final long serialVersionUID = 1L; 10 11 long id = 0; 12 protected String actorId = null; 13 protected Set taskInstances = null; 14 protected SwimlaneInstance swimlaneInstance = null; 15 16 public static Set createPool(String [] actorIds) { 17 Set pooledActors = new HashSet (); 18 for (int i=0; i<actorIds.length; i++) { 19 pooledActors.add(new PooledActor(actorIds[i])); 20 } 21 return pooledActors; 22 } 23 24 public PooledActor() { 25 } 26 27 public PooledActor(String actorId) { 28 this.actorId = actorId; 29 } 30 31 public void addTaskInstance(TaskInstance taskInstance) { 32 if (taskInstances==null) taskInstances = new HashSet (); 33 taskInstances.add(taskInstance); 34 } 35 public Set getTaskInstances() { 36 return taskInstances; 37 } 38 public void removeTaskInstance(TaskInstance taskInstance) { 39 if (taskInstances!=null) { 40 taskInstances.remove(taskInstance); 41 } 42 } 43 44 public String getActorId() { 45 return actorId; 46 } 47 public void setActorId(String actorId) { 48 this.actorId = actorId; 49 } 50 public SwimlaneInstance getSwimlaneInstance() { 51 return swimlaneInstance; 52 } 53 public void setSwimlaneInstance(SwimlaneInstance swimlaneInstance) { 54 this.swimlaneInstance = swimlaneInstance; 55 } 56 public long getId() { 57 return id; 58 } 59 } 60 | Popular Tags |