KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > limitagent > TimerLimitAgentSession


1 package org.enhydra.shark.limitagent;
2
3 import java.util.Map JavaDoc;
4
5 import org.enhydra.shark.Shark;
6 import org.enhydra.shark.api.internal.limitagent.LimitAgentSession;
7
8 /**
9  *
10  * @author <a HREF="mailto:jaz@ofbiz.org">Andy Zeneski</a>
11  * @since Mar 24, 2004
12  */

13 public class TimerLimitAgentSession implements LimitAgentSession {
14
15    protected String JavaDoc[][] attrs;
16    protected String JavaDoc processId;
17    protected String JavaDoc activityId;
18    protected Map JavaDoc context;
19    protected long time;
20
21    protected TimerLimitAgentSession(String JavaDoc procId, String JavaDoc actId, Map JavaDoc ctx, long limitTime) {
22       this.processId = procId;
23       this.activityId = actId;
24       this.context = ctx;
25       this.time = limitTime;
26    }
27
28    public String JavaDoc[][] getExtendedAttributesNameValuePairs() {
29       if (attrs==null) {
30          try {
31             if (activityId!=null) {
32                attrs=Shark.getInstance().getAdminInterface().getAdminMisc().getActivitiesExtendedAttributeNameValuePairs(processId, activityId);
33             } else {
34                attrs=Shark.getInstance().getAdminInterface().getAdminMisc().getProcessExtendedAttributeNameValuePairs(processId);
35             }
36          } catch (Exception JavaDoc ex) {
37             System.err.println("Failed to retrieve extended attribute name value pairs!");
38          }
39       }
40       return this.attrs;
41    }
42
43    public String JavaDoc getProcessId () {
44       return this.processId;
45    }
46
47    public String JavaDoc getActivityId () {
48       return this.activityId;
49    }
50
51    public Map JavaDoc getProcessContext() {
52       return this.context;
53    }
54
55    public long getLimitTime() {
56       return this.time;
57    }
58
59 }
60
61
Popular Tags