Package org.refcodes.jobbus
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 anyComponent
, service or POJO.H
- The handle type used to reference a job.
- All Implemented Interfaces:
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>
- Direct Known Subclasses:
JobBusDirectoryImpl
public abstract class AbstractJobBusDirectory<CTX,H> extends AbstractJobBus<CTX,H> implements JobBusDirectory<CTX,H>
-
-
Constructor Summary
Constructors Constructor Description AbstractJobBusDirectory(CTX aContext, org.refcodes.component.HandleGenerator<H> aHandleGenerator)
Instantiates theAbstractJobBusDirectory
with the provided context and the providedHandleGenerator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<org.refcodes.command.Undoable<CTX,?,?>>
handleReferences()
Handle references.java.util.Set<H>
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 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
-
-
-
-
Constructor Detail
-
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 Detail
-
handleReferences
public java.util.Collection<org.refcodes.command.Undoable<CTX,?,?>> handleReferences()
Handle references.- Specified by:
handleReferences
in interfaceorg.refcodes.component.HandleDirectory<CTX,H>
- Overrides:
handleReferences
in classAbstractJobBus<CTX,H>
- Returns:
- the collection
-
-