public interface WorkloadScheduleHandler
SimJQEvent types as extension to a DefaultWorkloadSchedule.
The DefaultWorkloadSchedule deals with the basic external SimQueue events:
queue-access vacations, arrivals, revocations, and server-access credits.
However, it fails with a WorkloadScheduleInvalidException if it finds events in its input that it does not know about.
The handler-extension mechanism through DefaultWorkloadSchedule.registerHandler(org.javades.jqueues.r5.util.predictor.workload.WorkloadScheduleHandler) allows
the registration of a handler, i.c., a WorkloadScheduleHandler, that manages
a specific subset of SimJQEvent types (classes).
An example of such an event is the SimQueueGateEvent for SimQueueWithGates.
The extension mechanism is particularly useful for such state extensions to a SimQueue with
accompanying SimJQEvents, especially for queues with multiple state extensions
because (1) the complexity of DefaultWorkloadSchedule makes it unattractive for inheritance, and
(2) the resulting subclasses would become increasingly complex given the fact that Java does not
fully support multiple inheritance of implementation.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
DefaultWorkloadSchedule,
SimQueuePredictor_GATE| Modifier and Type | Method and Description |
|---|---|
Map<Class<? extends SimJQEvent>,SimEntitySimpleEventType.Member> |
getEventMap()
Gets the set of
SimJQEvents of this handler, and the SimEntitySimpleEventType members onto which they
map. |
String |
getHandlerName()
Returns the name of the handler.
|
boolean |
needsScan()
Whether or not this object needs to scan the
DefaultWorkloadSchedule upon registration. |
Set<SimJQEvent> |
scan(DefaultWorkloadSchedule workloadSchedule)
Scans the host
DefaultWorkloadSchedule and builds internal data structures. |
String getHandlerName()
The handler name must be unique within the realm of the DefaultWorkloadSchedule at which this
handler registers. For SimQueue state extensions, the convention is to use
the interface name appended with "Handler", like, "SimQueueHandler" and "SimQueueWithGateHandler".
Map<Class<? extends SimJQEvent>,SimEntitySimpleEventType.Member> getEventMap()
SimJQEvents of this handler, and the SimEntitySimpleEventType members onto which they
map.
The key-set should contains unique SimJQEvents within the realm of the DefaultWorkloadSchedule
at which this handler registers.
Likewise, the values should be unique.
SimJQEvents of this handler, and the SimEntitySimpleEventType members onto which they
map.boolean needsScan()
DefaultWorkloadSchedule upon registration.DefaultWorkloadSchedule upon registration.DefaultWorkloadSchedule.registerHandler(org.javades.jqueues.r5.util.predictor.workload.WorkloadScheduleHandler),
scan(org.javades.jqueues.r5.util.predictor.workload.DefaultWorkloadSchedule)Set<SimJQEvent> scan(DefaultWorkloadSchedule workloadSchedule) throws WorkloadScheduleException
DefaultWorkloadSchedule and builds internal data structures.
Called by our host DefaultWorkloadSchedule only upon registration,
and if we ask for it needsScan().
workloadSchedule - The host at which we registered.SimJQEvents processed by this handler,
in a set with no particular member ordering; may be null or empty.WorkloadScheduleException - If the workload is invalid or ambiguous.DefaultWorkloadSchedule.registerHandler(org.javades.jqueues.r5.util.predictor.workload.WorkloadScheduleHandler),
scan(org.javades.jqueues.r5.util.predictor.workload.DefaultWorkloadSchedule)Copyright © 2018. All rights reserved.