Package org.jtrim2.ui.concurrent.query
Class GenericAsyncRendererFactory
java.lang.Object
org.jtrim2.ui.concurrent.query.GenericAsyncRendererFactory
- All Implemented Interfaces:
AsyncRendererFactory
An implementation of
AsyncRendererFactory which executes rendering
tasks in a TaskExecutor specified at construction time. That is,
the DataRenderer.startRendering(CancellationToken),
DataRenderer.render(CancellationToken, DataType)
and the DataRenderer.finishRendering(CancellationToken, AsyncReport)
methods will be executed in the context of the TaskExecutor.
As required by the AsyncRendererFactory interface,
AsyncRenderer created by GenericAsyncRendererFactory are
independent in a way that no two AsyncRenderer instances will
overwrite each other's rendering requests.
Thread safety
Instances of this class are safe to be accessed from multiple threads concurrently.Synchronization transparency
Instances of this class are not synchronization transparent.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGenericAsyncRendererFactory(TaskExecutor executor) Creates a newGenericAsyncRendererFactorywhich will execute rendering tasks on the specifiedTaskExecutor. -
Method Summary
Modifier and TypeMethodDescriptionCreates anAsyncRendererwhich is able to render a component.
-
Constructor Details
-
GenericAsyncRendererFactory
Creates a newGenericAsyncRendererFactorywhich will execute rendering tasks on the specifiedTaskExecutor.- Parameters:
executor- theTaskExecutorused to execute the submitted rendering tasks. This argument cannot benull.- Throws:
NullPointerException- thrown if the specified executor isnull
-
-
Method Details
-
createRenderer
Creates anAsyncRendererwhich is able to render a component.Note that it is not strictly required that this method return a new unique instance but to avoid independent
AsyncRendereroverwriting each other's rendering requests, it is usually necessary.- Specified by:
createRendererin interfaceAsyncRendererFactory- Returns:
- an
AsyncRendererwhich is able to render a component. This method never returnsnull.
-