DJ - The delegate-job type.DQ - The queue-type for delegate jobs.J - The job type.Q - The queue type for jobs.public class EncXM<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM> extends AbstractEncapsulatorSimQueue<DJ,DQ,J,Q>
SimQueueComposite encapsulating a single SimQueue
with options to change the ways in which a job exits the queue.
This composite queue (precisely) mimics the SimQueue interface of the encapsulated queue,
including non-standard operations and notifications,
yet optionally maps e.g. a departure onto a drop or vice versa.
Support is provided for mapping (all) departures, drops and/or auto-revocations.
Note that mapping revocations is not supported,
since that would violate the SimQueue interface.
Refer to AbstractEncapsulatorSimQueue,
AbstractSimQueueComposite
and SimQueueComposite
for more details on encapsulated queues.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
EncXM.MappableExitMethod,
SimQueueComposite,
Enc,
AbstractSimQueue.drop(J, double),
AbstractSimQueue.autoRevoke(double, J),
AbstractSimQueue.depart(double, J)| Modifier and Type | Class and Description |
|---|---|
static class |
EncXM.MappableExitMethod
The mappable exit methods.
|
AbstractSimQueueComposite.RealDelegateJobMapper<J extends SimJob,DJ extends SimJob>AbstractSimEntity.Notifier, AbstractSimEntity.PreNotificationHookSimQueue.AutoRevocationPolicySimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyrealDelegateJobMappereventsScheduled, SANITYUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
EncXM(org.javades.jsimulation.r5.SimEventList eventList,
DQ queue,
EncXM.MappableExitMethod dropMapping,
EncXM.MappableExitMethod autoRevocationMapping,
EncXM.MappableExitMethod departureMapping,
DelegateSimJobFactory delegateSimJobFactory)
Creates an encapsulator queue with options to change the ways in which a job exits the queue,
given an event list and a queue.
|
| Modifier and Type | Method and Description |
|---|---|
EncXM.MappableExitMethod |
getAutoRevocationMapping()
Returns the mapping of auto-revocations on the encapsulated queue.
|
EncXM<DJ,DQ,J,Q> |
getCopySimQueue()
Returns a new
EncXM object on the same SimEventList
with a copy of the encapsulated queue, the same exit mappings, and the same delegate-job factory. |
EncXM.MappableExitMethod |
getDepartureMapping()
Returns the mapping of departures on the encapsulated queue.
|
EncXM.MappableExitMethod |
getDropMapping()
Returns the mapping of job drops on the encapsulated queue.
|
Object |
getQoS()
Calls super method (in order to make implementation final).
|
Class |
getQoSClass()
Calls super method (in order to make implementation final).
|
protected double |
getServiceTimeForJob(J job)
Calls super method (in order to make implementation final).
|
protected void |
insertJobInQueueUponArrival(J job,
double time)
Calls super method (in order to make implementation final).
|
protected void |
insertJobInQueueUponStart(J job,
double time)
Calls super method (in order to make implementation final).
|
boolean |
isStartArmed()
Calls super method (in order to make implementation final).
|
protected void |
processSubQueueNotifications(List<MultiSimQueueNotificationProcessor.Notification<DJ,DQ>> notifications)
Replaces applicable exit sub-notifications from the encapsulated queue,
and, subsequently, invokes the super method.
|
protected void |
queueAccessVacationDropSubClass(double time,
J job)
Calls super method (in order to make implementation final).
|
protected void |
removeJobFromQueueUponDeparture(J departingJob,
double time)
Calls super method (in order to make implementation final).
|
protected void |
removeJobFromQueueUponDrop(J job,
double time)
Calls super method (in order to make implementation final).
|
protected void |
removeJobFromQueueUponRevokation(J job,
double time,
boolean auto)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleAfterArrival(J job,
double time)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleAfterDeparture(J departedJob,
double time)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleAfterDrop(J job,
double time)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleAfterRevokation(J job,
double time,
boolean auto)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleAfterStart(J job,
double time)
Calls super method (in order to make implementation final).
|
protected void |
rescheduleForNewServerAccessCredits(double time)
Calls super method (in order to make implementation final).
|
protected void |
resetEntitySubClass()
Calls super method (in order to make implementation final).
|
protected void |
setServerAccessCreditsSubClass()
Calls super method (in order to make implementation final).
|
String |
toStringDefault()
Returns "EncXM(Dr->XMDrop,AR->XMAR,De->XMDep)[encapsulated queue]".
|
getEncapsulatedQueueaddRealJobLocal, getCopySimQueues, getCopySubSimQueues, getDelegateJob, getDelegateJobMild, getDelegateSimJobFactory, getIndex, getIndex, getQueue, getQueue, getQueues, getRealJob, getRealJob, getSimQueueSelector, isDelegateJob, isRealJob, notifyResetEntity, notifyStateChanged, notifyUpdate, removeJobsFromQueueLocal, resetSimQueueSelector, selectFirstQueue, selectNextQueue, setDelegateSimJobFactoryarrive, autoRevoke, cancelDepartureEvent, cancelDepartureEvent, depart, departureFromEventList, drop, getAutoRevocationPolicy, getDepartureEvents, getDepartureEvents, getFirstJob, getFirstJobInServiceArea, getFirstJobInWaitingArea, getJobs, getJobsInServiceArea, getJobsInWaitingArea, getNumberOfJobs, getNumberOfJobsInServiceArea, getNumberOfJobsInWaitingArea, getServerAccessCredits, hasJobs, hasJobsInServiceArea, hasJobsInWaitingArea, hasServerAcccessCredits, isJob, isJobInServiceArea, isJobInWaitingArea, isQueueAccessVacation, registerStdOutSimQueueListener, revoke, revoke, scheduleDepartureEvent, scheduleJobArrival, setAutoRevocationPolicy, setQueueAccessVacation, setServerAccessCredits, start, takeServerAccessCredit, triggerPotentialNewStartArmed, unregisterStdOutSimQueueListeneraddPendingNotification, addPendingNotification, clearAndUnlockPendingNotificationsIfLocked, delegateOperation, doAfterNotifications, doOperation, fireAndLockPendingNotifications, getEventList, getLastUpdateTime, getRegisteredDelegatedOperations, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, notifyEventListReset, registerDelegatedOperation, registerNotificationType, registerOperation, registerPreEventHook, registerPreNotificationHook, registerPreUpdateHook, registerSimEntityListener, registerStdOutSimEntityListener, removeDelegationForOperation, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, toString, unregisterSimEntityListener, unregisterStdOutSimEntityListener, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitarrive, getAutoRevocationPolicy, getJobs, getJobsInServiceArea, getJobsInWaitingArea, getNumberOfJobs, getNumberOfJobsInServiceArea, getNumberOfJobsInWaitingArea, getServerAccessCredits, isJob, isJobInServiceArea, isJobInWaitingArea, isQueueAccessVacation, revoke, revoke, setAutoRevocationPolicy, setQueueAccessVacation, setServerAccessCreditsdoAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, unregisterSimEntityListener, updatepublic EncXM(org.javades.jsimulation.r5.SimEventList eventList,
DQ queue,
EncXM.MappableExitMethod dropMapping,
EncXM.MappableExitMethod autoRevocationMapping,
EncXM.MappableExitMethod departureMapping,
DelegateSimJobFactory delegateSimJobFactory)
eventList - The event list to use.queue - The encapsulated queue.dropMapping - The exit method for drops; if null, drops are not mapped
(and thus result in the drop of the real job).autoRevocationMapping - The exit method for auto-revocations; if null, auto-revocations are not mapped
(and thus result in the auto-revocation of the real job).departureMapping - The exit method for departures; if null, departures are not mapped
(and thus result in the departure of the real job).delegateSimJobFactory - An optional factory for the delegate SimJobs.IllegalArgumentException - If the event list or the queue is null.DelegateSimJobFactory,
DefaultDelegateSimJobFactorypublic EncXM<DJ,DQ,J,Q> getCopySimQueue()
EncXM object on the same SimEventList
with a copy of the encapsulated queue, the same exit mappings, and the same delegate-job factory.EncXM object on the same SimEventList
with a copy of the encapsulated queue, the same exit mappings, and the same delegate-job factory.UnsupportedOperationException - If the encapsulated queue could not be copied through SimQueue.getCopySimQueue().AbstractSimEntity.getEventList(),
AbstractEncapsulatorSimQueue.getEncapsulatedQueue(),
getDropMapping(),
getAutoRevocationMapping(),
getDepartureMapping(),
AbstractSimQueueComposite.getDelegateSimJobFactory()public String toStringDefault()
The three exit-method mappings are shown as comma-separated list;
for drops, auto-revocations, and departures, respectively.
If however, an exit method is mapped onto itself,
the corresponding entry is left out.
So EncXM()[encQueue] == Enc[encQueue].
toStringDefault in interface SimEntitytoStringDefault in class AbstractSimQueue<J extends SimJob,Q extends EncXM>SimEntity.setName(java.lang.String),
Object.toString()public final Object getQoS()
public final Class getQoSClass()
public final EncXM.MappableExitMethod getDropMapping()
null.public final EncXM.MappableExitMethod getAutoRevocationMapping()
null.public final EncXM.MappableExitMethod getDepartureMapping()
null.protected final void resetEntitySubClass()
resetEntitySubClass in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>AbstractSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractSimQueue.rescheduleAfterRevokation(J, double, boolean),
SimEntity.resetEntity(),
SimQueueSelector.resetSimQueueSelector(),
SimQueue.setServerAccessCredits(double, int),
SimQueue.isStartArmed()protected final void queueAccessVacationDropSubClass(double time,
J job)
queueAccessVacationDropSubClass in class AbstractSimQueue<J extends SimJob,Q extends EncXM>time - The time the job was dropped, i.e., the current time.job - The dropped job.AbstractSimQueue.arrive(double, J),
AbstractSimQueue.setQueueAccessVacation(double, boolean)protected final void insertJobInQueueUponArrival(J job, double time)
insertJobInQueueUponArrival in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that arrived.time - The current time (i.e., arrival time of the job).AbstractSimQueueComposite.addRealJobLocal(J),
AbstractEncapsulatorSimQueue.rescheduleAfterArrival(J, double)protected final void rescheduleAfterArrival(J job, double time)
rescheduleAfterArrival in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that arrived (and is already present in AbstractSimQueue.getJobs()).time - The current time (i.e., the arrival time of the job).SimQueue.arrive(double, J),
AbstractEncapsulatorSimQueue.insertJobInQueueUponArrival(J, double)protected final void removeJobFromQueueUponDrop(J job, double time)
removeJobFromQueueUponDrop in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that is to be dropped.time - The current time (i.e., drop time of the job).AbstractSimQueue.drop(J, double),
AbstractEncapsulatorSimQueue.rescheduleAfterDrop(J, double),
AbstractEncapsulatorSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractSimQueueComposite.removeJobsFromQueueLocal(J, DJ),
AbstractSimQueueComposite.getDelegateJob(SimJob),
SimJob.getQueue()protected final void rescheduleAfterDrop(J job, double time)
rescheduleAfterDrop in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The jobs that was dropped.time - The current time (i.e., drop time of the job).AbstractEncapsulatorSimQueue.removeJobFromQueueUponDrop(J, double),
AbstractEncapsulatorSimQueue.rescheduleAfterRevokation(J, double, boolean)protected final void removeJobFromQueueUponRevokation(J job, double time, boolean auto)
removeJobFromQueueUponRevokation in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that is to be revoked.time - The current time (i.e., revocation time of the job).auto - Whether or not this applies to an auto-revocation.AbstractSimQueue.revoke(double, J, boolean),
AbstractSimQueue.autoRevoke(double, J),
SimJQEvent.Revocation,
AbstractEncapsulatorSimQueue.rescheduleAfterRevokation(J, double, boolean),
AbstractSimQueueComposite.getDelegateJob(SimJob),
SimJob.getQueue(),
AbstractSimQueueComposite.removeJobsFromQueueLocal(J, DJ)protected final void rescheduleAfterRevokation(J job, double time, boolean auto)
rescheduleAfterRevokation in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The jobs that was successfully revoked.time - The current time (i.e., revocation time of the job).auto - Whether or not this applies to an auto-revocation.SimJQEvent.Revocation,
AbstractEncapsulatorSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractEncapsulatorSimQueue.processSubQueueNotifications(java.util.List<org.javades.jqueues.r5.listener.MultiSimQueueNotificationProcessor.Notification<DJ, DQ>>)public final boolean isStartArmed()
isStartArmed in interface SimQueue<J extends SimJob,Q extends EncXM>isStartArmed in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>SimQueue.isStartArmed()protected final void setServerAccessCreditsSubClass()
setServerAccessCreditsSubClass in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>AbstractSimQueue.getServerAccessCredits(),
AbstractSimEntity.getLastUpdateTime(),
SimQueue.setServerAccessCredits(double, int),
AbstractEncapsulatorSimQueue.rescheduleForNewServerAccessCredits(double)protected final void rescheduleForNewServerAccessCredits(double time)
rescheduleForNewServerAccessCredits in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>time - The current time (i.e., the time at which new server-access credits became available).AbstractEncapsulatorSimQueue.setServerAccessCreditsSubClass()protected final void insertJobInQueueUponStart(J job, double time)
insertJobInQueueUponStart in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that starts.time - The current time (i.e., start time of the job).AbstractSimQueue.isJob(org.javades.jqueues.r5.entity.jq.job.SimJob),
AbstractSimQueue.isJobInServiceArea(org.javades.jqueues.r5.entity.jq.job.SimJob),
AbstractSimQueueComposite.getDelegateJob(J),
AbstractEncapsulatorSimQueue.rescheduleAfterStart(J, double)protected final void rescheduleAfterStart(J job, double time)
rescheduleAfterStart in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job that started (and is already present in AbstractSimQueue.getJobsInServiceArea().time - The current time (i.e., the start time of the job).AbstractSimQueue.isJob(org.javades.jqueues.r5.entity.jq.job.SimJob),
AbstractSimQueue.isJobInServiceArea(org.javades.jqueues.r5.entity.jq.job.SimJob),
AbstractSimQueueComposite.getDelegateJob(J),
AbstractEncapsulatorSimQueue.insertJobInQueueUponStart(J, double)protected final double getServiceTimeForJob(J job)
getServiceTimeForJob in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>job - The job, non-null.protected final void removeJobFromQueueUponDeparture(J departingJob, double time)
removeJobFromQueueUponDeparture in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>departingJob - The job that departs.time - The departure (current) time.AbstractSimQueue.depart(double, J),
AbstractEncapsulatorSimQueue.rescheduleAfterDeparture(J, double),
AbstractEncapsulatorSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractSimQueueComposite.removeJobsFromQueueLocal(J, DJ),
AbstractSimQueueComposite.getDelegateJob(SimJob),
SimJob.getQueue()protected final void rescheduleAfterDeparture(J departedJob, double time)
rescheduleAfterDeparture in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>departedJob - The departed job.time - The departure (current) time.AbstractEncapsulatorSimQueue.removeJobFromQueueUponDeparture(J, double),
AbstractEncapsulatorSimQueue.rescheduleAfterRevokation(J, double, boolean)protected final void processSubQueueNotifications(List<MultiSimQueueNotificationProcessor.Notification<DJ,DQ>> notifications)
processSubQueueNotifications in class AbstractEncapsulatorSimQueue<DJ extends SimJob,DQ extends SimQueue,J extends SimJob,Q extends EncXM>notifications - The sub-queue notifications, will be modified; empty upon return.getDropMapping(),
getAutoRevocationMapping(),
getDepartureMapping()Copyright © 2018. All rights reserved.