java.lang.Object
org.refcodes.jobbus.AbstractJobBus<CTX,H>
org.refcodes.jobbus.AbstractJobBusDirectory<CTX,H>
- Type Parameters:
CTX
- The context type to use, can by any component, service or POJO.H
- The handle type used to reference a job.
- All Implemented Interfaces:
org.refcodes.component.FlushHandle<H>
,org.refcodes.component.HandleDirectory<H,
,org.refcodes.command.Undoable<CTX, ?, ?>> org.refcodes.component.HandleLookup<H,
,org.refcodes.command.Undoable<CTX, ?, ?>> org.refcodes.component.ProgressHandle<H>
,org.refcodes.component.ResetHandle<H>
,JobBus<CTX,
,H> JobBusDirectory<CTX,
H>
- Direct Known Subclasses:
SimpleJobBusDirectory
public abstract class AbstractJobBusDirectory<CTX,H>
extends AbstractJobBus<CTX,H>
implements JobBusDirectory<CTX,H>
-
Constructor Summary
ConstructorDescriptionAbstractJobBusDirectory
(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator) Instantiates theAbstractJobBusDirectory
with the provided context and the providedHandleGenerator
. -
Method Summary
Modifier and TypeMethodDescriptionCollection<org.refcodes.command.Undoable<CTX,
?, ?>> Handle references.handles()
Returns the set of handles managed by this implementation.Methods inherited from class org.refcodes.jobbus.AbstractJobBus
execute, execute, execute, flush, getException, getJob, getProgress, getResult, getResult, getResult, hasException, hasFlush, hasHandle, hasProgress, hasReset, hasResult, isExecuted, lookupHandle, removeHandle, reset, waitForExecution, waitForExecution
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.component.FlushHandle
flush, flushUnchecked, hasFlush
Methods inherited from interface org.refcodes.component.HandleLookup
hasHandle, lookupHandle, removeHandle
Methods inherited from interface org.refcodes.jobbus.JobBus
execute, execute, execute, getException, getResult, getResult, getResult, hasException, hasResult, isExecuted, waitForExecution, waitForExecution
Methods inherited from interface org.refcodes.component.ProgressHandle
getProgress, hasProgress
Methods inherited from interface org.refcodes.component.ResetHandle
hasReset, reset
-
Constructor Details
-
AbstractJobBusDirectory
public AbstractJobBusDirectory(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator) Instantiates theAbstractJobBusDirectory
with the provided context and the providedHandleGenerator
. 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 anyHandleGenerator
you thing useful when creating handles. It is up to yourHandleGenerator
to generate unique handle objects. TheJobBusDirectory
actually uses aString
objects generatingHandleGenerator
. Make sure your handles implement theObject.hashCode()
andObject.equals(Object)
methods as of their method contracts as them handles will be used in collections such asHashMap
data structures.- Parameters:
aContext
- The context which is passed to the job (Undoable
) instances when being executed.aHandleGenerator
- TheHandleGenerator
to be used when generating unique handle objects.
-
-
Method Details
-
handleReferences
Handle references.- Specified by:
handleReferences
in interfaceorg.refcodes.component.HandleDirectory<CTX,
H> - Overrides:
handleReferences
in classAbstractJobBus<CTX,
H> - Returns:
- the collection
-
handles
Returns the set of handles managed by this implementation.
-