CTX
- The context type to use, can by any Component
, service
or POJO.H
- The handle type used to reference a job.org.refcodes.component.FlushHandle<CTX>
, org.refcodes.component.HandleDirectory<CTX,H>
, org.refcodes.component.HandleLookup<CTX,H>
, org.refcodes.component.ProgressHandle<CTX>
, org.refcodes.component.ResetHandle<CTX>
, JobBus<CTX,H>
, JobBusDirectory<CTX,H>
JobBusDirectoryImpl
public abstract class AbstractJobBusDirectory<CTX,H> extends AbstractJobBus<CTX,H> implements JobBusDirectory<CTX,H>
Constructor | Description |
---|---|
AbstractJobBusDirectory(CTX aContext,
org.refcodes.component.HandleGenerator<H> aHandleGenerator) |
Instantiates the
AbstractJobBusDirectory with the provided
context and the provided HandleGenerator . |
Modifier and Type | Method | Description |
---|---|---|
Collection<org.refcodes.command.Undoable<CTX,?,?>> |
handleReferences() |
Handle references.
|
Set<H> |
handles() |
Returns the set of handles managed by this implementation.
|
execute, execute, execute, flush, getException, getJob, getProgress, getResult, getResult, getResult, hasException, hasFlush, hasHandle, hasProgress, hasReset, hasResult, isExecuted, lookupHandle, removeHandle, reset, waitForExecution, waitForExecution
hasHandle, lookupHandle, removeHandle
execute, execute, execute, getException, getResult, getResult, getResult, hasException, hasResult, isExecuted, waitForExecution, waitForExecution
public AbstractJobBusDirectory(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator)
AbstractJobBusDirectory
with the provided
context and the provided HandleGenerator
. It is up to you which
context (service, Component
, POJO) you
want to provide to a job (Undoable
) when being executed.
Also you can provide any HandleGenerator
you thing useful when
creating handles. It is up to your HandleGenerator
to generate
unique handle objects. The JobBusDirectory
actually uses a
String
objects generating HandleGenerator
. Make sure your
handles implement the Object.hashCode()
and Object.equals(Object)
methods as of their method contracts as them handles will be used in
collections such as HashMap
data structures.aContext
- The context which is passed to the job (Undoable
)
instances when being executed.aHandleGenerator
- The HandleGenerator
to be used when
generating unique handle objects.public Collection<org.refcodes.command.Undoable<CTX,?,?>> handleReferences()
handleReferences
in interface org.refcodes.component.HandleDirectory<CTX,H>
handleReferences
in class AbstractJobBus<CTX,H>
Copyright © 2018. All rights reserved.