Class AbstractJobBusDirectory<CTX,H>
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
ConstructorsConstructorDescriptionAbstractJobBusDirectory(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator) Instantiates theAbstractJobBusDirectorywith 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, waitForExecutionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.component.FlushHandle
flush, flushUnchecked, hasFlushMethods inherited from interface org.refcodes.component.HandleLookup
hasHandle, lookupHandle, removeHandleMethods inherited from interface org.refcodes.jobbus.JobBus
execute, execute, execute, getException, getResult, getResult, getResult, hasException, hasResult, isExecuted, waitForExecution, waitForExecutionMethods inherited from interface org.refcodes.component.ProgressHandle
getProgress, hasProgressMethods inherited from interface org.refcodes.component.ResetHandle
hasReset, reset
-
Constructor Details
-
AbstractJobBusDirectory
public AbstractJobBusDirectory(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator) Instantiates theAbstractJobBusDirectorywith 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 anyHandleGeneratoryou thing useful when creating handles. It is up to yourHandleGeneratorto generate unique handle objects. TheJobBusDirectoryactually uses aStringobjects 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 asHashMapdata structures.- Parameters:
aContext- The context which is passed to the job (Undoable) instances when being executed.aHandleGenerator- TheHandleGeneratorto be used when generating unique handle objects.
-
-
Method Details
-
handleReferences
Handle references.- Specified by:
handleReferencesin interfaceorg.refcodes.component.HandleDirectory<CTX,H> - Overrides:
handleReferencesin classAbstractJobBus<CTX,H> - Returns:
- the collection
-
handles
-