wt.queue
Class ScheduleQueue

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.fc.Item
          extended bywt.queue.WtQueue
              extended bywt.queue.ScheduleQueue
All Implemented Interfaces:
AccessControlled, DisplayIdentification, DomainAdministered, Externalizable, NetFactor, ObjectMappable, Persistable, Serializable

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

Nested Class Summary
 
Nested classes inherited from class wt.queue.WtQueue
WtQueue.QueueCacheUpdater
 
Field Summary
private static String CLASSNAME
           
private static int EXEC_ENTRIES_COUNT
           
static long EXTERNALIZATION_VERSION_UID
           
private  int lateEntriesCount
           
private static long MIN_RESCHEDULE_INTERVAL
           
static String NEXT_PROCESS_TIME
          Label for the attribute.
private  Timestamp nextProcessTime
           
private static long NOTIFY_INTERVAL
           
protected static long OLD_FORMAT_VERSION_UID
           
private static WTProperties properties
           
private static Hashtable removeCompletedEntries
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static Hashtable stopProcessing
           
private static long SUSPEND_DURATION
           
private static boolean VERBOSE
           
private static boolean VERBOSE_EXEC_ENTRIES
           
private static boolean VERBOSE_EXEC_ENTRY
           
 
Fields inherited from class wt.queue.WtQueue
DELETE_WHEN_EMPTY, DELETING, ENABLED, EXCEPTION_RETRIES, EXECUTION_HOST, FAILURE_NOTIFICATION_EMAIL, INIT, LAST_NOTIFICATION_TIME, LAST_STATE_SET, NAME, QUEUE_STATE, REMOVE_FAILED_ENTIRES, RUNNING, STARTED, STARTING, STOPPED, STOPPING, SUSPEND_UNTIL, SUSPENDED, TOTAL_ENTRIES, VERBOSE_INDUSTRIALIZATION, WAITING_ENTRIES
 
Fields inherited from class wt.fc.Item
VERSION_40_UID, VERSION_51_UID
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
ScheduleQueue()
           
 
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.
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
 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.
 String getConceptualClassname()
          Deprecated.  
 int getLateEntriesCount()
           
 Timestamp getNextProcessTime()
          Gets the value of the attribute: NEXT_PROCESS_TIME.
 Date getNextWaitTime(long n)
           
 Class getQType()
           
 Integer getTotalEntryCount()
           
 Integer getWaitingEntryCount()
           
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
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.
 boolean lateEntries(long n)
           
static ScheduleQueue newScheduleQueue(String name)
          Constructs a queue given its name.
static ScheduleQueue newScheduleQueue(String name, String host)
          Constructs a queue given its name.
 QueryResult queueEntries(ScheduleQueue queue)
           
 QueryResult queueEntries(ScheduleQueue queue, long now)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(ScheduleQueue thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 boolean removeCompleted()
           
 void setExit(boolean ex)
           
 void setLateEntriesCount(int val)
           
 void setNextProcessTime(Timestamp a_NextProcessTime)
          Sets the value of the attribute: NEXT_PROCESS_TIME.
static void setStopProcessing(String queueName, boolean stop)
           
static boolean stopProcessing(String queueName)
           
 String toString()
          Returns a string representaion of the queue.
 void updateScheduleEntry(ScheduleQueueEntry entry, StatusInfo status, Timestamp t)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.queue.WtQueue
getCacheName, getExceptionRetries, getExecutionHost, getFailureNotificationEmail, getLastNotificationTime, getLastStateSet, getName, getQueueState, getSuspendDuration, getSuspendUntil, getTotalEntries, getWaitingEntries, insert, isDeleteWhenEmpty, isEnabled, isRemoveFailedEntires, isRunning, logQueueProblem, notifyQueueAdmin, queueSuspended, readVersion, refresh, rollbackDanglingTransaction, setDeleteWhenEmpty, setEnabled, setExceptionRetries, setExecutionHost, setFailureNotificationEmail, setLastNotificationTime, setLastStateSet, setName, setQueueState, setRemoveFailedEntires, setRunning, setSuspendDuration, setSuspendTime, setSuspendUntil, setTotalEntries, setWaitingEntries, update
 
Methods inherited from class wt.fc.Item
getDomainRef, initialize, isInheritedDomain, readVersion, setDomainRef, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getIdentity, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

NEXT_PROCESS_TIME

public static final String NEXT_PROCESS_TIME
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

nextProcessTime

private Timestamp nextProcessTime

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

VERBOSE_EXEC_ENTRIES

private static boolean VERBOSE_EXEC_ENTRIES

VERBOSE_EXEC_ENTRY

private static boolean VERBOSE_EXEC_ENTRY

EXEC_ENTRIES_COUNT

private static int EXEC_ENTRIES_COUNT

MIN_RESCHEDULE_INTERVAL

private static long MIN_RESCHEDULE_INTERVAL

lateEntriesCount

private int lateEntriesCount

NOTIFY_INTERVAL

private static long NOTIFY_INTERVAL

SUSPEND_DURATION

private static long SUSPEND_DURATION

stopProcessing

private static Hashtable stopProcessing

properties

private static WTProperties properties

removeCompletedEntries

private static Hashtable removeCompletedEntries
Constructor Detail

ScheduleQueue

public ScheduleQueue()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class WtQueue
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class WtQueue
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ScheduleQueue thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class WtQueue
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class WtQueue
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getNextProcessTime

public Timestamp getNextProcessTime()
Gets the value of the attribute: NEXT_PROCESS_TIME.

Supported API: false

Returns:
Timestamp

setNextProcessTime

public void setNextProcessTime(Timestamp a_NextProcessTime)
                        throws WTPropertyVetoException
Sets the value of the attribute: NEXT_PROCESS_TIME.

Supported API: false

Parameters:
a_NextProcessTime -
Throws:
WTPropertyVetoException

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

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class WtQueue
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class WtQueue
Returns:
int

setExit

public void setExit(boolean ex)

queueEntries

public QueryResult queueEntries(ScheduleQueue queue)
                         throws WTException
Throws:
WTException

queueEntries

public QueryResult queueEntries(ScheduleQueue queue,
                                long now)
                         throws WTException
Throws:
WTException

lateEntries

public boolean lateEntries(long n)
                    throws WTException
Throws:
WTException

getNextWaitTime

public Date getNextWaitTime(long n)
                     throws WTException
Throws:
WTException

updateScheduleEntry

public void updateScheduleEntry(ScheduleQueueEntry entry,
                                StatusInfo status,
                                Timestamp t)
                         throws WTException
Throws:
WTException

getLateEntriesCount

public int getLateEntriesCount()

setLateEntriesCount

public void setLateEntriesCount(int val)

removeCompleted

public boolean removeCompleted()

stopProcessing

public static boolean stopProcessing(String queueName)

setStopProcessing

public static void setStopProcessing(String queueName,
                                     boolean stop)

getQType

public Class getQType()
Specified by:
getQType in class WtQueue

getTotalEntryCount

public Integer getTotalEntryCount()
                           throws WTException
Throws:
WTException

getWaitingEntryCount

public Integer getWaitingEntryCount()
                             throws WTException
Throws:
WTException