java.lang.Object
org.bzdev.obnaming.NamedObjectFactory<F,Simulation,SimObject,OBJ>
org.bzdev.devqsim.SimObjectFactory<DefaultSimObjectFactory<OBJ>,Simulation,OBJ>
org.bzdev.devqsim.DefaultSimObjectFactory<OBJ>
org.bzdev.devqsim.ServerQueueFactory<OBJ,PriorityTaskQueue.PriorityParam,QS>
org.bzdev.devqsim.AbstrPrioritySQFactory<PriorityServerQueue<QS>,QS>
org.bzdev.devqsim.PrioritySQFactory<QS>
- All Implemented Interfaces:
Cloneable
public abstract class PrioritySQFactory<QS extends QueueServer>
extends AbstrPrioritySQFactory<PriorityServerQueue<QS>,QS>
Abstract Factory for priority server queues with the type of the
queue server unspecified.
Subclasses that are not abstract should set the type parameter QS
and implement the method
getQueueServerClass
This can be done using an anonymous class. For use in a scriptable
application, a class should be defined and the fully qualified class
name listed in the file org.bzdev.obnaming.NamedObjectFactory in the
META-INF/services directory of the application's JAR file.
Parameters that are inherited include the following:
- "timeline" - an integer-keyed set of values that define
changes in the object's configuration. Subclasses may provide
additional parameters. The default parameters are:
- "timeline.time" - the time at which timeline parameters are to change. This parameter must be provided if a timeline entry exists. The units are those used by the double-precision time unit for the simulation (for animations, this is generally seconds).
- "timeline.traceSetMode" - indicates how the parameter
"timeline.traceSets" is interpreted. the values are
enumeration constants of type
TraceSetMode
and are used as follows:-
KEEP
- keep the existing trace sets, adding additional ones specified by the parameter "timeline.traceSets". -
REMOVE
- remove the trace sets specified by the parameter "timeline.traceSets". -
REPLACE
- remove all existing trace sets and replace those with the ones specified by the timeline.traceSets parameter.
-
- "timeline.traceSets" - a parameter representing a set of TraceSet objects (the three-argument 'add' method is used to add entries).
- "traceSets" - a set of TraceSets a SimObject will use for tracing. One should use the add and remove factory methods as this parameter refers to a set of values.
- "queueServer" - an instance of a 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 table.
- "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
. -
Subclasses that are not abstract classes must implement the method
getQueueServerClass
.
For example,
would create a factory for priority server queues whose servers' class is Foo.public class FooPrioritySQFactory extends PrioritySQFactory<Foo> { Class<Foo> getQueueServerClass() {returns Foo.class;} public FooPrioritySQFactory(Simulation sim) { super(sim); } }
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.obnaming.NamedObjectFactory
NamedObjectFactory.ConfigException, NamedObjectFactory.IndexedSetter, NamedObjectFactory.ParmNameIterator
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.bzdev.devqsim.ServerQueueFactory
clear, getQueueServerClass, getQueueServers, initObject, numberOfQueueServers
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, 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
-
PrioritySQFactory
Constructor.- Parameters:
sim
- the simulation used to name objects.
-
-
Method Details
-
newObject
Description copied from class:NamedObjectFactory
Construct a new object. The object will not be initialized. This method is called bycreateObject()
andcreateObjects
unless these methods are overridden. Subclasses should callwillIntern()
to determine if the object will interned or not, andgetObjectNamer()
to find the object namer. Some subclasses (e.g., org.devqsim.SimObjectFactory) provide a method that will return the object namer cast to the type needed by constructors. In the case of SimObjectFactory, this method is named getSimulation(). For a subclass of SimObjectFactory to create a new object of typeFoo
,newObject
will execute the expression
or an equivalent expression, wherenew Foo(getSimulation(), name, willIntern())
name
is the argument passed tonewObject
.- Specified by:
newObject
in classNamedObjectFactory<DefaultSimObjectFactory<PriorityServerQueue<QS extends QueueServer>>,
Simulation, SimObject, PriorityServerQueue<QS extends QueueServer>> - Parameters:
name
- the name of the object to be created- Returns:
- the new object
- See Also:
-