Show / Hide Table of Contents

Class AbstractPriorityTask

An abstract base for IPriorityTask implementations.

Inheritance
object
AbstractPriorityTask
PriorityAggregator
PriorityFilter
PriorityProcessor
Implements
IPriorityTask
IPortableObject
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.Net
Assembly: Coherence.dll
Syntax
public abstract class AbstractPriorityTask : IPriorityTask, IPortableObject
Remarks

It implements all IPriorityTask interface methods and is intended to be extended for concrete uses.

Properties

ExecutionTimeoutMillis

The maximum amount of time this task is allowed to run before the corresponding service will attempt to stop it.

Declaration
public virtual long ExecutionTimeoutMillis { get; set; }
Property Value
Type Description
long

The execution timeout value in millisecods or one of the special PriorityTaskTimeout values.

Remarks

The value of Default indicates a default timeout value configured for the corresponding service; the value of 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 RunCanceled(bool) method will be called.

RequestTimeoutMillis

The maximum amount of time a calling thread is willing to wait for a result of the request execution.

Declaration
public virtual long RequestTimeoutMillis { get; set; }
Property Value
Type Description
long

The request timeout value in milliseconds or one of the special PriorityTaskTimeout values.

Remarks

The request time is measured on the client side as the time elapsed from the moment a request is sent for execution to the corresponding server node(s) and includes:

  • the time it takes to deliver the request to the executing node(s);
  • the interval between the time the task is received and placed into a service queue until the execution starts;
  • the task execution time;
  • the time it takes to deliver a result back to the client.

The value of Default indicates a default timeout value configured for the corresponding service; the value of 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 ExecutionTimeoutMillis value.

If the specified amount of time elapsed and the client has not received any response from the server, a RequestTimeoutException will be thrown to the caller.

SchedulingPriority

This task's scheduling priority.

Declaration
public virtual PriorityTaskScheduling SchedulingPriority { get; set; }
Property Value
Type Description
PriorityTaskScheduling

One of the PriorityTaskScheduling constants.

Methods

ReadExternal(IPofReader)

Restore the contents of a user type instance by reading its state using the specified IPofReader object.

Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader from which to read the object's state.

Remarks

The AbstractPriorityTask implementation reserves property indexes 0 - 9.

Exceptions
Type Condition
IOException

If an I/O error occurs.

RunCanceled(bool)

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.

Declaration
public virtual void RunCanceled(bool isAbandoned)
Parameters
Type Name Description
bool isAbandoned

true if the task has timed-out, but all attempts to interrupt it were unsuccesful in stopping the execution; otherwise the task was never started.

Remarks

Since this method is usually called on a service thread, implementors must exercise extreme caution since any delay introduced by the implementation will cause a delay of the corresponding service.

WriteExternal(IPofWriter)

Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.

Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to which to write the object's state.

Remarks

The AbstractPriorityTask implementation reserves property indexes 0 - 9.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Implements

IPriorityTask
IPortableObject
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.