CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation

com.tangosol.coherence.commonj
Class WorkManager.AbstractWork

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.AbstractInvocable
          extended by com.tangosol.coherence.commonj.WorkManager.AbstractWork
All Implemented Interfaces:
ExternalizableLite, Invocable, InvocableInOrder, PriorityTask, java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
WorkManager.ReleaseWork, WorkManager.RequestStatus, WorkManager.ScheduleWork, WorkManager.SendFeedback
Enclosing class:
WorkManager

protected abstract static class WorkManager.AbstractWork
extends AbstractInvocable
implements ExternalizableLite

Base class for Invocable tasks related to the WorkManager. Note, that aside of the ScheduleWork task all other tasks have to be scheduled immediately.


Field Summary
protected  long m_lWorkId
          The work id.
protected  int m_nMemberId
          The Work originator Member id.
 
Fields inherited from interface com.tangosol.net.PriorityTask
SCHEDULE_FIRST, SCHEDULE_IMMEDIATE, SCHEDULE_STANDARD, TIMEOUT_DEFAULT, TIMEOUT_NONE
 
Constructor Summary
WorkManager.AbstractWork()
          Default constructor (necessary for a lite serialization).
WorkManager.AbstractWork(long lWorkId, int nMemberId)
          Construct the AbstractWork to be executed on behalf of the specified member (a Work originator).
 
Method Summary
 Member getMember()
          Return a Work originator's Member object.
 int getMemberId()
          Return a Work originator's Member id.
 int getSchedulingPriority()
          Obtain this task's scheduling priority. Valid values are one of the SCHEDULE_* constants.
 long getWorkId()
          Return a Work id.
 void readExternal(java.io.DataInput in)
          Restore the contents of this object by loading the object's state from the passed DataInput object.
 void writeExternal(java.io.DataOutput out)
          Save the contents of this object by storing the object's state into the passed DataOutput object.
 
Methods inherited from class com.tangosol.net.AbstractInvocable
getExecutionTimeoutMillis, getRequestTimeoutMillis, getResult, getService, init, isRespondInOrder, runCanceled, setResult
 

Field Detail

m_lWorkId

protected long m_lWorkId
The work id.


m_nMemberId

protected int m_nMemberId
The Work originator Member id.

Constructor Detail

WorkManager.AbstractWork

public WorkManager.AbstractWork()
Default constructor (necessary for a lite serialization).


WorkManager.AbstractWork

public WorkManager.AbstractWork(long lWorkId,
                                int nMemberId)
Construct the AbstractWork to be executed on behalf of the specified member (a Work originator).

Method Detail

getSchedulingPriority

public int getSchedulingPriority()
Obtain this task's scheduling priority. Valid values are one of the SCHEDULE_* constants.

This implementation returns SCHEDULE_STANDARD.

Specified by:
getSchedulingPriority in interface PriorityTask
Overrides:
getSchedulingPriority in class AbstractInvocable
Returns:
this task's scheduling priority

getWorkId

public long getWorkId()
Return a Work id.

Returns:
a Work id

getMemberId

public int getMemberId()
Return a Work originator's Member id.

Returns:
a Member id

getMember

public Member getMember()
Return a Work originator's Member object.

Returns:
a Member object or null

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Restore the contents of this object by loading the object's state from the passed DataInput object.

Specified by:
readExternal in interface ExternalizableLite
Parameters:
in - the DataInput stream to read data from in order to restore the state of this object
Throws:
java.io.IOException - if an I/O exception occurs
java.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Save the contents of this object by storing the object's state into the passed DataOutput object.

Specified by:
writeExternal in interface ExternalizableLite
Parameters:
out - the DataOutput stream to write the state of this object to
Throws:
java.io.IOException - if an I/O exception occurs

CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation