Class ServerQueueFactory<OBJ extends ServerQueue<T,QS>,T,QS extends QueueServer>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstrPrioritySQFactory
,LinearServerQFactory
ServerQueue
.
A server queue contains a task queue, but the 'release' mechanism is not enabled by default, so only a subset of the parameters used to configure task queues are provided. In addition, the queue servers need to be specified. As a result, the parameters that this factory provides are the following:
- "queueServer" - an instance of the subtype QS of QueueServer. For this case, one must use the "add" method instead of the "set" method as the entry will be added to a set of queue servers.
- "deletePolicy" - an enumeration QueueDeletePolicy describing
the 'delete' policy for the queue. The delete policy
determines what happens when the caller deletes a queue
whose length is nonzero. The values are as follows:
-
MUST_BE_EMPTY
- the queue must be empty and not processing any more elements before it can be deleted. -
WHEN_EMPTY
- the queue will not accept new entries after the delete() method is called, with the actual deletion postponed until the queue is empty. -
NEVER
- the queue may not be deleted.
WHEN_EMPTY
. -
In addition, a server queue inherits the parameters
timeline, timeline.time, timeline.traceSetMode, timeline.traceSets,
and traceSets provided by SimObjectFactory
.
Subclasses that are not abstract classes must implement the method
getQueueServerClass
.
Unless the parameter "queueServer" is hidden and thus not used,
subclasses will typically use the method
getQueueServers()
to obtain an array of
the queue servers that were configured. This array is needed by
the constructors of some subclasses.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.obnaming.NamedObjectFactory
NamedObjectFactory.ConfigException, NamedObjectFactory.IndexedSetter, NamedObjectFactory.ParmNameIterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all entries and restore to default values.Get the base class of the objects implementing the QueueServer interface for this factory.protected QS[]
Get the queue servers.protected void
initObject
(OBJ object) Initialize an object.protected int
Get the number of queue servers that have been configured.Methods inherited from class org.bzdev.devqsim.SimObjectFactory
addToTimelineRequest, addToTimelineResponse, getSimulation
Methods inherited from class org.bzdev.obnaming.NamedObjectFactory
add, add, add, add, add, add, add, add, addDocResourceBundle, addDocResourceBundle, addJDoc, addJDoc, addLabelResourceBundle, addLabelResourceBundle, addTipResourceBundle, addTipResourceBundle, arrayInit, canAdd3, clear, configure, configureSupported, containsParm, createObject, createObject, createObject, createObject, createObjects, createObjects, createObjects, createObjects, createObjects, createObjects, doAfterInits, endObjectCreation, getDoc, getFactoryClass, getGLB, getLabel, getLayoutResource, getListedFactories, getLUB, getNextName, getNextNameIndex, getObjectNamer, getParmKeyType, getParmPrefix, getRVMode, getTemplateKeyMap, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTip, getType, glbInRange, initParm, initParms, initParms, isClearOnly, isNamedObject, isRandomVariable, keyType, lubInRange, mustAdd, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newInstance, newInstance, newObject, parmNames, parmNameSet, parmPrefixes, remove, remove, remove, remove, remove, remove, remove, remove, removeParm, removeParms, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setDocAPIBase, setInterned, setLayoutResource, setLayoutResource, setNameRoot, setTarget, startObjectCreation, unset, unset, unset, unset, unset, unset, willIntern
-
Constructor Details
-
ServerQueueFactory
Constructor.- Parameters:
sim
- the simulation used to name objects.
-
-
Method Details
-
getQueueServerClass
Get the base class of the objects implementing the QueueServer interface for this factory.- Returns:
- the base class
-
numberOfQueueServers
protected int numberOfQueueServers()Get the number of queue servers that have been configured.- Returns:
- the number of queue servers
-
getQueueServers
Get the queue servers.- Returns:
- an array of queue servers
-
clear
public void clear()Description copied from class:NamedObjectFactory
Clear all entries and restore to default values. Note: each subclass that implements this method should callsuper.clear()
. Any subclass that defines parameters should call this method in order to restore the parameters to their default values. When an annotation processor is used for some parameters, those parameters can be restored to their default value by calling the parm manager's setDefaults method with the factory as its argument.- Overrides:
clear
in classSimObjectFactory<DefaultSimObjectFactory<OBJ extends ServerQueue<T,
QS>>, Simulation, OBJ extends ServerQueue<T, QS>>
-
initObject
Description copied from class:NamedObjectFactory
Initialize an object. This method will call the methods for the object necessary to initialize it based on how the factory was configured, and is called bycreateObject()
andcreateObjects
unless these methods are overridden. The default method does nothing. Subclasses that override this method to provide subclass-specific initializations must start with the statement "super.initObject(object);
".- Overrides:
initObject
in classSimObjectFactory<DefaultSimObjectFactory<OBJ extends ServerQueue<T,
QS>>, Simulation, OBJ extends ServerQueue<T, QS>> - Parameters:
object
- the object to initialize
-