wt.queue
Class ScheduleQueue

java.lang.Object
  extended by wt.fc.WTObject
      extended by wt.fc.Item
          extended by wt.queue.WtQueue
              extended by wt.queue.ScheduleQueue
All Implemented Interfaces:
Externalizable, Serializable, AccessControlled, wt.access.PolicyAccessControlled, wt.access.SecurityLabeled, wt.admin.DomainAdministered, NetFactor, ObjectMappable, Persistable, DisplayIdentification

public class ScheduleQueue
extends WtQueue
implements Externalizable

Use the newScheduleQueue static factory method(s), not the ScheduleQueue constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Method Summary
 ScheduleQueueEntry addEntry(WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time)
          Creates a new QueueEntry object corresponding to a processing request.
 void addMultiEntry(WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Collection collection, Timestamp[] sched_time)
          Create and commit multiple Queue entires from a Collection.
 boolean contains(ScheduleQueueEntry entry)
          Returns whether or not an entry belongs to the queue.
 void execEntries()
          Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.
 ScheduleQueueEntry execEntry(ScheduleQueueEntry entry)
          Executes a the queue entry passed as argument.
protected  void initialize(String name)
          Supports initialization, following construction of an instance.
protected  void initialize(String name, String host)
          Supports initialization, following construction of an instance.
static ScheduleQueue newScheduleQueue(String name)
          Constructs a queue given its name.
static ScheduleQueue newScheduleQueue(String name, String host)
          Constructs a queue given its name.
 String toString()
          Returns a string representaion of the queue.
 
Methods inherited from class wt.fc.WTObject
getDisplayIdentifier, getDisplayIdentity, getDisplayType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newScheduleQueue

public static ScheduleQueue newScheduleQueue(String name)
                                      throws WTException
Constructs a queue given its name.

Supported API: true

Parameters:
name -
Returns:
ScheduleQueue
Throws:
WTException

initialize

protected void initialize(String name)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
name -
Throws:
WTException

addEntry

public ScheduleQueueEntry addEntry(WTPrincipal princ,
                                   String t_method,
                                   String t_class,
                                   Class[] arg_types,
                                   Object[] args,
                                   Timestamp sched_time)
                            throws WTException
Creates a new QueueEntry object corresponding to a processing request.

Supported API: true

Parameters:
princ -
t_method -
t_class -
arg_types -
args -
sched_time -
Returns:
ScheduleQueueEntry
Throws:
WTException

execEntry

public ScheduleQueueEntry execEntry(ScheduleQueueEntry entry)
                             throws WTException
Executes a the queue entry passed as argument.

Supported API: true

Parameters:
entry -
Returns:
ScheduleQueueEntry
Throws:
WTException

contains

public boolean contains(ScheduleQueueEntry entry)
                 throws WTException
Returns whether or not an entry belongs to the queue.

Supported API: true

Parameters:
entry -
Returns:
boolean
Throws:
WTException

execEntries

public void execEntries()
                 throws WTException
Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.

Supported API: true

Overrides:
execEntries in class WtQueue
Throws:
WTException

toString

public String toString()
Returns a string representaion of the queue.

Supported API: true

Overrides:
toString in class WtQueue
Returns:
String

newScheduleQueue

public static ScheduleQueue newScheduleQueue(String name,
                                             String host)
                                      throws WTException
Constructs a queue given its name.

Supported API: true

Parameters:
name -
host -
Returns:
ScheduleQueue
Throws:
WTException

initialize

protected void initialize(String name,
                          String host)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
name -
host -
Throws:
WTException

addMultiEntry

public void addMultiEntry(WTPrincipal princ,
                          String t_method,
                          String t_class,
                          Class[] arg_types,
                          Collection collection,
                          Timestamp[] sched_time)
                   throws WTException
Create and commit multiple Queue entires from a Collection. All entries are batch commited. The arg_types is used to define the type of arguments and number of entries to be created from the Collection. The collection itself will contain one or more sets of these arguments. This method will iterate through the collection creating multiple queue entires each containing the number and type of arguments specified in arg_types. If the number of values in the collection is not evenly divisiable by the number of types (in arg_types) a WTException will be thrown. An array of Timestamp(s) is provides such that each entry may be scheduled at a different time

Supported API: true

Parameters:
princ -
t_method -
t_class -
arg_types -
collection -
sched_time -
Throws:
WTException