Package gda.scan
Class MultithreadedScanDataPointPipeline
java.lang.Object
gda.scan.MultithreadedScanDataPointPipeline
- All Implemented Interfaces:
ScanDataPointPipeline
An implementation of
ScanDataPointPipeline that computes ScanDataPoints and broadcasts them using internally
managed threads.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Constructor Summary
ConstructorsConstructorDescriptionMultithreadedScanDataPointPipeline(ScanDataPointPublisher broadcaster, int positionCallableThreadPoolSize, int scanDataPointPipelineLength, String scanName) Creates a new MultithreadedScanDataPointPipeline and starts it up to accept points. -
Method Summary
Modifier and TypeMethodDescriptionvoidThrows exception if an exception occurred in the processing of the pipeline The main Scan thread can check this regularlyprotected ScanDataPointPublisherRetrieves the data writer from the pipeline.voidput(IScanDataPoint point) Computes ScanDataPoints and broadcasts them using internally managed threads.voidshutdown(boolean waitForProcessingCompletion) Politely shutdown the pipeline.
-
Constructor Details
-
MultithreadedScanDataPointPipeline
public MultithreadedScanDataPointPipeline(ScanDataPointPublisher broadcaster, int positionCallableThreadPoolSize, int scanDataPointPipelineLength, String scanName) Creates a new MultithreadedScanDataPointPipeline and starts it up to accept points.- Parameters:
broadcaster-positionCallableThreadPoolSize- the number of threads used to process CallablesscanDataPointPipelineLength- the number of points allowed in the Pipeline concurrently.
-
-
Method Details
-
put
Computes ScanDataPoints and broadcasts them using internally managed threads.- Specified by:
putin interfaceScanDataPointPipeline- Parameters:
point- scannablePositions or detectorData may contain Callables- Throws:
DeviceException
-
shutdown
Politely shutdown the pipeline. Blocks until processing is complete. Calls shutdownNow if there is any problem or if interrupted.- Specified by:
shutdownin interfaceScanDataPointPipeline- Throws:
DeviceExceptionException
-
getDataWriter
Description copied from interface:ScanDataPointPipelineRetrieves the data writer from the pipeline.- Specified by:
getDataWriterin interfaceScanDataPointPipeline- Returns:
- data writer
-
getBroadcaster
-
checkForException
Description copied from interface:ScanDataPointPipelineThrows exception if an exception occurred in the processing of the pipeline The main Scan thread can check this regularly- Specified by:
checkForExceptionin interfaceScanDataPointPipeline- Throws:
Exception
-