|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gigaspaces.grid.master.Task
public class Task
Base class for Entries that conform the task pattern. A worker will repeatedly take an object from the space, invoke its execute method, and post the result (response) back to the space.
Field Summary | |
---|---|
Identity |
id
|
java.lang.Long |
submittedTime
|
Constructor Summary | |
---|---|
Task()
|
|
Task(Identity id)
Create new task with specified Identity. |
Method Summary | |
---|---|
net.jini.core.entry.Entry |
execute()
Execute whatever task the entry requires. |
net.jini.core.entry.Entry |
execute(java.util.Map map)
Execute whatever task the entry requires. |
Identity |
getIdentity()
Get the universally unique identifier for this task. |
java.lang.Long |
getMaxExecutionTime()
After this time the task is aborted and returned to the space since the worker has either crashed, or hung, or whatever The default is for ten minutes. |
java.lang.Long |
getResponseLeaseTime()
The lease time that will be requested for any response from execute . |
long |
getSubmittedTime()
Get the submitted time |
void |
setIdentity(Identity id)
Specify an universally unique identifier for the particular defined task. |
void |
setSubmittedTime(long time)
Set the submitted time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Identity id
public java.lang.Long submittedTime
Constructor Detail |
---|
public Task()
public Task(Identity id)
Method Detail |
---|
public net.jini.core.entry.Entry execute()
java.lang.RuntimeException
- if this method is not implementedpublic net.jini.core.entry.Entry execute(java.util.Map map)
map
- - Used as a temporary cache such that Task entries may put and
get attributes into the cache between one entry's use of execute and another of a
related entry. Weak references are stored, so execute must be able to execute
properly if the holder doesn't have a value for the key.
java.lang.RuntimeException
- if this method is not implementedpublic java.lang.Long getResponseLeaseTime()
execute
.
The default is for ten minutes.
public java.lang.Long getMaxExecutionTime()
public void setIdentity(Identity id)
id
- The Identity for th Taskpublic Identity getIdentity()
public long getSubmittedTime()
public void setSubmittedTime(long time)
time
- The time (in milliseconds) this Task was submitted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |