|CONTENTS | PREV | NEXT|
A particular instance of an
ImageWriteris not required to support re-entrant (simultaneous) calls to its methods (with the exception of the
abortmethod that requests current read or writes to halt). However, it must be possible for multiple instances of the same plug-in class to operate simultaneously. For the sake of brevity, we will only discuss reader plug-ins below.
Supporting full re-entrancy would require that the reader bundle all of its state information (e.g., the current input source) into a separate state object, which would allow methods in progress to continue to work with the settings that were in effect at the time they began, while allowing a separate thread to modify the state to be used by the next operation.
Rather than forcing each
ImageReaderto keep track of its state in this way, it is simpler to require the application to instantiate multiple instances of the same
ImageReaderclass if it wishes to perform multithreaded processing. This means that the state of an
ImageReadermust be maintained using non-static instance variables only, which should not be a burden for plug-in developers.
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.