Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


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, PortableObject, 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, PortableObject

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.
 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 readExternal(PofReader in)
          Restore the contents of a user type instance by reading its state using the specified PofReader object.
 void writeExternal(java.io.DataOutput out)
          Save the contents of this object by storing the object's state into the passed DataOutput object.
 void writeExternal(PofWriter out)
          Save the contents of a POF user type instance by writing its state using the specified PofWriter object.

 

Methods inherited from class com.tangosol.net.AbstractInvocable
getExecutionTimeoutMillis, getRequestTimeoutMillis, getResult, getService, init, isRespondInOrder, runCanceled, setResult

 

Methods inherited from interface com.tangosol.net.Invocable
run

 

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).
Parameters:
lWorkId - the Work id
nMemberId - the tagret Member id

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

readExternal

public void readExternal(PofReader in)
                  throws java.io.IOException
Restore the contents of a user type instance by reading its state using the specified PofReader object.
Specified by:
readExternal in interface PortableObject
Parameters:
in - the PofReader from which to read the object's state
Throws:
java.io.IOException - if an I/O error occurs

writeExternal

public void writeExternal(PofWriter out)
                   throws java.io.IOException
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
Specified by:
writeExternal in interface PortableObject
Parameters:
out - the PofWriter to which to write the object's state
Throws:
java.io.IOException - if an I/O error occurs

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.