|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.net.AbstractPriorityTask
public abstract class AbstractPriorityTask
An abstract base for PriorityTask implementations. It implements all PriorityTask interface methods and is intended to be extended for concrete uses.
Field Summary |
---|
Fields inherited from interface com.tangosol.net.PriorityTask |
---|
SCHEDULE_FIRST, SCHEDULE_IMMEDIATE, SCHEDULE_STANDARD, TIMEOUT_DEFAULT, TIMEOUT_NONE |
Constructor Summary | |
---|---|
AbstractPriorityTask()
|
Method Summary | |
---|---|
long |
getExecutionTimeoutMillis()
Obtain the maximum amount of time this task is allowed to run before the corresponding service will attempt to stop it. |
long |
getRequestTimeoutMillis()
Obtain the maximum amount of time a calling thread is willing to wait for a result of the request execution. |
int |
getSchedulingPriority()
Obtain this task's scheduling priority. |
void |
readExternal(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 |
runCanceled(boolean fAbandoned)
This method will be called if and only if all attempts to interrupt this task were unsuccesful in stopping the execution or if the execution was canceled before it had a chance to run at all. |
void |
setExecutionTimeoutMillis(long lTimeout)
Specify the maximum amount of time this task is allowed to run before the corresponding service will attempt to stop it. |
void |
setRequestTimeoutMillis(long lTimeout)
Specify the maximum amount of time a calling thread is willing to wait for a result of the request execution. |
void |
setSchedulingPriority(int iPriority)
Specify this task's scheduling priority. |
void |
writeExternal(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.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString |
Constructor Detail |
---|
public AbstractPriorityTask()
Method Detail |
---|
public int getSchedulingPriority()
getSchedulingPriority
in interface PriorityTask
public long getExecutionTimeoutMillis()
TIMEOUT_DEFAULT
indicates a default
timeout value configured for the corresponding service; the value of
TIMEOUT_NONE
indicates that this task can execute
indefinitely.
If, by the time the specified amount of time passed, the task has not
finished, the service will attempt to stop the execution by using the
Thread.interrupt()
method. In the case that interrupting the
thread does not result in the task's termination, the
PriorityTask.runCanceled(boolean)
method will be called.
getExecutionTimeoutMillis
in interface PriorityTask
public long getRequestTimeoutMillis()
TIMEOUT_DEFAULT
indicates a default
timeout value configured for the corresponding service; the value of
TIMEOUT_NONE
indicates that the client thread is
willing to wait indefinitely until the task execution completes or is
canceled by the service due to a task execution timeout specified by the
PriorityTask.getExecutionTimeoutMillis()
value.
If the specified amount of time elapsed and the client has not received
any response from the server, an RequestTimeoutException
will
be thrown to the caller.
getRequestTimeoutMillis
in interface PriorityTask
public void runCanceled(boolean fAbandoned)
This implementation is a no-op.
runCanceled
in interface PriorityTask
fAbandoned
- true if the task has timed-out, but all attempts to
interrupt it were unsuccesful in stopping the execution;
otherwise the task was never startedpublic void setSchedulingPriority(int iPriority)
iPriority
- this task's scheduling prioritypublic void setExecutionTimeoutMillis(long lTimeout)
lTimeout
- the task timeout value in millisecondspublic void setRequestTimeoutMillis(long lTimeout)
lTimeout
- the request timeout value in millisecondspublic void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore
the state of this object
IOException
- if an I/O exception occurs
NotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object to
IOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
The AbstractPriorityTask implementation reserves property indexes 0 - 9.
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's state
IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
The AbstractPriorityTask implementation reserves property indexes 0 - 9.
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's state
IOException
- if an I/O error occurs
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |