public class DelegatedSimQueueOperation extends Object implements SimEntityOperation<SimEntityOperation,SimEntityOperation.Request,SimEntityOperation.Reply>
SimEntityOperation for composite queues that delegates the execution
of a specific operation on a (specific) composite queue to another operation on a (specific) sub-queue.
In theory, the use of this class is not restricted to composite queues. For instance, the queue and sub-queue could be the same object. This use, however, has not been tested.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimEntity.doOperation(double, Req),
AbstractSimEntity.registerDelegatedOperation(org.javades.jqueues.r5.entity.SimEntityOperation, org.javades.jqueues.r5.entity.SimEntityOperation),
Enc,
EncHSSimEntityOperation.Reply<O extends SimEntityOperation,Req extends SimEntityOperation.Request,Rep extends SimEntityOperation.Reply>, SimEntityOperation.Request<O extends SimEntityOperation,Req extends SimEntityOperation.Request>, SimEntityOperation.RequestE<O extends SimEntityOperation,Req extends SimEntityOperation.Request>, SimEntityOperation.Reset, SimEntityOperation.ResetReply, SimEntityOperation.ResetRequest, SimEntityOperation.Update, SimEntityOperation.UpdateReply, SimEntityOperation.UpdateRequest| Constructor and Description |
|---|
DelegatedSimQueueOperation(SimQueue queue,
SimQueue subQueue,
SimEntityOperation oDQueue,
AbstractSimQueueComposite.RealDelegateJobMapper jobMapper)
Creates a delegated
SimEntityOperation. |
| Modifier and Type | Method and Description |
|---|---|
SimEntityOperation.Reply |
doOperation(double time,
SimEntityOperation.Request request)
Performs the operation on the sub-queue.
|
String |
getName()
Returns "DelegatedOperation[operation on sub-queue]".
|
Class |
getOperationReplyClass()
Returns the class of the reply for the operation on the sub-queue.
|
Class |
getOperationRequestClass()
Returns the class of the request for the operation on the sub-queue.
|
public DelegatedSimQueueOperation(SimQueue queue, SimQueue subQueue, SimEntityOperation oDQueue, AbstractSimQueueComposite.RealDelegateJobMapper jobMapper)
SimEntityOperation.queue - The queue for which to delegate the given operation.subQueue - The delegate sub-queue (that will eventually execute the operation).oDQueue - The delegate operation on the sub-queue.jobMapper - An optional mapper between real and delegate jobs.public final String getName()
getName in interface SimEntityOperation<SimEntityOperation,SimEntityOperation.Request,SimEntityOperation.Reply>public final Class getOperationRequestClass()
getOperationRequestClass in interface SimEntityOperation<SimEntityOperation,SimEntityOperation.Request,SimEntityOperation.Reply>public final Class getOperationReplyClass()
getOperationReplyClass in interface SimEntityOperation<SimEntityOperation,SimEntityOperation.Request,SimEntityOperation.Reply>public SimEntityOperation.Reply doOperation(double time, SimEntityOperation.Request request)
A copy of the operation request is requested with sub-queue and delegate job as request parameters. This, however, is not fully supported for all request types.
doOperation in interface SimEntityOperation<SimEntityOperation,SimEntityOperation.Request,SimEntityOperation.Reply>time - The time at which to perform the request.request - The request, non-null.null.IllegalArgumentException - If the request is null or requires a job mapper that is absent.UnsupportedOperationException - If the request's parameters could not be changed into those required for the sub-queue.AbstractSimQueueComposite.RealDelegateJobMapperCopyright © 2018. All rights reserved.