KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > taskmgmt > exe > PooledActor


1 package org.jbpm.taskmgmt.exe;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.HashSet JavaDoc;
5 import java.util.Set JavaDoc;
6
7 public class PooledActor implements Serializable JavaDoc {
8
9   private static final long serialVersionUID = 1L;
10   
11   long id = 0;
12   protected String JavaDoc actorId = null;
13   protected Set JavaDoc taskInstances = null;
14   protected SwimlaneInstance swimlaneInstance = null;
15
16   public static Set JavaDoc createPool(String JavaDoc[] actorIds) {
17     Set JavaDoc pooledActors = new HashSet JavaDoc();
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 JavaDoc actorId) {
28     this.actorId = actorId;
29   }
30   
31   public void addTaskInstance(TaskInstance taskInstance) {
32     if (taskInstances==null) taskInstances = new HashSet JavaDoc();
33     taskInstances.add(taskInstance);
34   }
35   public Set JavaDoc 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 JavaDoc getActorId() {
45     return actorId;
46   }
47   public void setActorId(String JavaDoc 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