| java.lang.Object javax.media.jai.PlanarImage javax.media.jai.remote.PlanarImageServerProxy
All known Subclasses: com.sun.media.jai.rmi.RMIServerProxy,
PlanarImageServerProxy | abstract public class PlanarImageServerProxy extends PlanarImage implements RemoteRenderedImage(Code) | | A subclass of PlanarImage which represents an image on a
remote server machine. This class is also an implementation of the
RemoteRenderedImage interface. This class allows processing
to occur on the remote server machine.
Conceptually this class is like a No-op, all it provides is a mechanism
allowing the processing to occur on a server. Note that this class does
not mandate that the client-server communication rely on any particular
wire protocol or communication protocol. A subclass can choose any wire
or communication protocol to communicate with its server. This is
accomplished by having the subclass implement the methods declared to
be abstract in this class. All functionality in this class is then
implemented in terms of these abstract methods.
Network errors (detected via throws of
RemoteImagingException ) are dealt with through the use of
retry intervals and retries. Retries refers to the maximum number of
times a remote operation will be retried. The retry interval refers to
the amount of time in milliseconds between two consecutive retries. If
errors are encountered at each retry and the number of specified retries
has been exhausted, a RemoteImagingException will be thrown.
Time outs (When the amount of time taken to get a response or
the result of an operation from the remote machine exceeds a limit) are
not dealt with, and must be taken care of by the network
imaging protocol implementation. The implementation must be responsible
for monitoring time outs, but on encountering one can deal with it by
throwing a RemoteImagingException , which will then be dealt
with using retries and retry intervals.
The resultant image layout is computed and provided by the concrete
subclass by implementing the abstract method getImageLayout .
All the accessor methods dealing with the layout variables namely
getMinX() , getMinY() , getWidth() ,
getHeight() , getMaxX() , getMaxY() ,
getTileWidth() , getTileHeight() ,
getTileGridXOffset() , getTileGridYOffset() ,
getColorModel() and getSampleModel() are
implemented in terms of the getImageLayout() method. The
implementation of these methods uses retries and retry intervals to
deal with Network errors, such that the subclass implementing
getImageLayout() does not need to worry about Network errors
except to signal them by throwing a RemoteImagingException .
The same applies to the other abstract methods implemented by sub-classes
namely getRemoteProperty() ,
getRemotePropertyNames() and computeTile() .
The getTile method (abstract in this class' superclass),
is implemented in terms of the computeTile method. It provides
the additional functionality of caching the tiles on the client, as well
as that of dealing with Network errors as mentioned above.
See Also: RemoteImagingException since: JAI 1.1 |
Constructor Summary | |
public | PlanarImageServerProxy(String serverName, String protocolName, String operationName, ParameterBlock paramBlock, RenderingHints hints) Constructs a PlanarImageServerProxy using the specified
name of the server to perform the specified operation on, using the
sources and parameters specified by the supplied
ParameterBlock and supplied RenderingHints . |
Method Summary | |
abstract public Raster | computeTile(int tileX, int tileY) Returns tile (tileX, tileY) as computed on the remote server machine.
Note that tileX and tileY are indices into the tile array, not pixel
locations. | protected void | finalize() Uncaches all the tiles when this image is garbage collected. | public ColorModel | getColorModel() Overrides the method in PlanarImage to return the
ColorModel of the remote image. | public int | getHeight() Overrides the method in PlanarImage to return the height
of the remote image. | abstract public ImageLayout | getImageLayout() Get the layout of the image. | public int | getMaxX() Overrides the method in PlanarImage to return the X
coordinate of the column immediately to the right of the rightmost
column of the remote image. | public int | getMaxY() Overrides the method in PlanarImage to return the Y
coordinate of the row immediately below the bottom row of the
remote image. | public int | getMinX() Overrides the method in PlanarImage to return the X
coordinate of the leftmost column of the remote image. | public int | getMinY() Overrides the method in PlanarImage to return the Y
coordinate of the uppermost row of the remote image. | public NegotiableCapability | getNegotiatedValue(String category) Returns the results of the negotiation process for the given category. | public synchronized NegotiableCapabilitySet | getNegotiatedValues() Returns the results of the negotiation process. | public NegotiableCapabilitySet | getNegotiationPreferences() Returns the current negotiation preferences or null, if none were
set previously. | public int | getNumRetries() Returns the number of retries. | public String | getOperationName() Returns the operation name as a String . | public ParameterBlock | getParameterBlock() Returns the ParameterBlock that specifies the
sources and parameters for the operation to be performed by
this PlanarImageServerProxy . | public Object | getProperty(String name) Gets a property from the property set of this image. | public String[] | getPropertyNames() Returns a list of property names that are recognized by this image
or null if none are recognized. | public String | getProtocolName() Returns the String that identifies the remote imaging
protocol. | abstract public Object | getRemoteProperty(String name) Returns a property from the property set generated on the remote
server machine. | abstract public String[] | getRemotePropertyNames() Returns a list of names recognized by the getRemoteProperty
method. | public RenderingHints | getRenderingHints() Returns the RenderingHints associated with the
operation to be performed by this PlanarImageServerProxy . | public int | getRetryInterval() Returns the amount of time between retries in milliseconds. | public SampleModel | getSampleModel() Overrides the method in PlanarImage to return the
SampleModel of the remote image. | public String | getServerName() Returns the String that identifies the server. | public Raster | getTile(int tileX, int tileY) Returns the tile (tileX, tileY). | public TileCache | getTileCache() Returns the tile cache object of this image by reference. | public Object | getTileCacheMetric() Returns the tileCacheMetric instance variable by reference. | public int | getTileGridXOffset() Overrides the method in PlanarImage to return the X
coordinate of the upper-left pixel of tile (0, 0) remotely. | public int | getTileGridYOffset() Overrides the method in PlanarImage to return the Y
coordinate of the upper-left pixel of tile (0, 0) remotely. | public int | getTileHeight() Overrides the method in PlanarImage to return the height
of a tile remotely. | public int | getTileWidth() Overrides the method in PlanarImage to return the width
of a tile remotely. | public int | getWidth() Overrides the method in PlanarImage to return the width
of the remote image. | abstract public Rectangle | mapDestRect(Rectangle destRect, int sourceIndex) Returns a conservative estimate of the region of a specified
source that is required in order to compute the pixels of a
given destination rectangle. | abstract public Rectangle | mapSourceRect(Rectangle sourceRect, int sourceIndex) Returns a conservative estimate of the destination region that
can potentially be affected by the pixels of a rectangle of a
given source. | void | sendExceptionToListener(Exception e) | public void | setNegotiationPreferences(NegotiableCapabilitySet preferences) Sets the preferences to be used in the client-server
communication. | public void | setNumRetries(int numRetries) Sets the number of retries. | public void | setRetryInterval(int retryInterval) Sets the amount of time between retries in milliseconds. | public void | setTileCache(TileCache cache) Sets the tile cache object of this image. |
cache | protected transient TileCache cache(Code) | | A reference to a centralized TileCache object.
|
negotiated | protected NegotiableCapabilitySet negotiated(Code) | | The set of properties agreed upon after the negotiation process
between the client and the server has been completed.
|
numRetries | protected int numRetries(Code) | | The number of retries.
|
operationName | protected String operationName(Code) | | The name of the operation to be performed remotely.
|
protocolName | protected String protocolName(Code) | | The name of the protocol to be used for remote communication.
|
retryInterval | protected int retryInterval(Code) | | Time in milliseconds between retries.
|
serverName | protected String serverName(Code) | | The String representing the remote server machine.
|
tileCacheMetric | protected Object tileCacheMetric(Code) | | Metric used to produce an ordered list of tiles. This determines
which tiles are removed from the cache first if a memory control
operation is required.
|
PlanarImageServerProxy | public PlanarImageServerProxy(String serverName, String protocolName, String operationName, ParameterBlock paramBlock, RenderingHints hints)(Code) | | Constructs a PlanarImageServerProxy using the specified
name of the server to perform the specified operation on, using the
sources and parameters specified by the supplied
ParameterBlock and supplied RenderingHints .
If hints relating to the OperationRegistry ,
TileCache , retry interval, number of retries,
tile caching metric or negotiation preferences are included in the
specified RenderingHints object, they will be honored.
An IllegalArgumentException may
be thrown by the protocol specific classes at a later point, if
null is provided as the serverName argument and null is not
considered a valid server name by the specified protocol.
Parameters: serverName - The String identifying the remoteserver machine. Parameters: protocolName - The name of the remote imaging protocol. Parameters: operationName - The name of the operation. Parameters: paramBlock - The source(s) and/or parameter(s) for the operation. Parameters: hints - The hints for the operation. throws: IllegalArgumentException - if operationName is null. |
computeTile | abstract public Raster computeTile(int tileX, int tileY) throws RemoteImagingException(Code) | | Returns tile (tileX, tileY) as computed on the remote server machine.
Note that tileX and tileY are indices into the tile array, not pixel
locations. The Raster that is returned is a copy.
Network errors encountered should be signalled by throwing a
RemoteImagingException .
Subclasses must implement this method to return a
non-null value for all tile indices between
getMinTile{X,Y} and getMaxTile{X,Y} ,
inclusive. Tile indices outside of this region should result
in a return value of null .
Parameters: tileX - the X index of the requested tile in the tile array. Parameters: tileY - the Y index of the requested tile in the tile array. throws: RemoteImagingException - if an error condition during remoteimage processing occurs |
finalize | protected void finalize() throws Throwable(Code) | | Uncaches all the tiles when this image is garbage collected.
|
getColorModel | public ColorModel getColorModel()(Code) | | Overrides the method in PlanarImage to return the
ColorModel of the remote image.
|
getHeight | public int getHeight()(Code) | | Overrides the method in PlanarImage to return the height
of the remote image.
|
getImageLayout | abstract public ImageLayout getImageLayout() throws RemoteImagingException(Code) | | Get the layout of the image. This could be implemented by either
asking the server to specify the layout, or have the client compute
the image layout. The ImageLayout object returned must
have all its fields initialized, else an Error will be
thrown. Network errors encountered should be signalled
by throwing a RemoteImagingException .
throws: RemoteImagingException - if an error condition during remoteimage processing occurs throws: Error - if all the fields in the ImageLayout are not initialized. |
getMaxX | public int getMaxX()(Code) | | Overrides the method in PlanarImage to return the X
coordinate of the column immediately to the right of the rightmost
column of the remote image.
|
getMaxY | public int getMaxY()(Code) | | Overrides the method in PlanarImage to return the Y
coordinate of the row immediately below the bottom row of the
remote image.
|
getMinX | public int getMinX()(Code) | | Overrides the method in PlanarImage to return the X
coordinate of the leftmost column of the remote image.
|
getMinY | public int getMinY()(Code) | | Overrides the method in PlanarImage to return the Y
coordinate of the uppermost row of the remote image.
|
getNegotiatedValue | public NegotiableCapability getNegotiatedValue(String category) throws RemoteImagingException(Code) | | Returns the results of the negotiation process for the given category.
This will return null if no negotiation preferences were set, and
no negotiation was performed, or if the negotiation failed.
Parameters: category - The category to return the negotiated results for. throws: IllegalArgumentException - if category is null. |
getNegotiatedValues | public synchronized NegotiableCapabilitySet getNegotiatedValues() throws RemoteImagingException(Code) | | Returns the results of the negotiation process. This will return null
if no negotiation preferences were set, and no negotiation was
performed, or if the negotiation failed.
|
getNegotiationPreferences | public NegotiableCapabilitySet getNegotiationPreferences()(Code) | | Returns the current negotiation preferences or null, if none were
set previously.
|
getNumRetries | public int getNumRetries()(Code) | | Returns the number of retries.
|
getOperationName | public String getOperationName()(Code) | | Returns the operation name as a String .
|
getParameterBlock | public ParameterBlock getParameterBlock()(Code) | | Returns the ParameterBlock that specifies the
sources and parameters for the operation to be performed by
this PlanarImageServerProxy .
|
getProperty | public Object getProperty(String name)(Code) | | Gets a property from the property set of this image. If the
property name is not recognized,
java.awt.Image.UndefinedProperty will be returned.
The property to be returned is first looked for in the set of
locally cached properties. If not found, the
getRemoteProperty method is called to retrieve the
property. Network errors that might be encountered during the
getRemoteProperty call are dealt with by retries and
retry intervals.
Parameters: name - the name of the property to get, as a String . a reference to the property Object , or the valuejava.awt.Image.UndefinedProperty . throws: RemoteImagingException - if the limit of retries is exceeded. |
getPropertyNames | public String[] getPropertyNames()(Code) | | Returns a list of property names that are recognized by this image
or null if none are recognized. The list of recognized
property names consists of the locally cached property names
(retrieved via super.getPropertyNames ) as well as
those that might be generated by the operations performed on the
remote server machine (retrieved via
getRemotePropertyNames ). Network errors that might be
encountered during the getRemotePropertyNames method
are dealt with by retries and retry intervals.
an array of String s containing validproperty names. throws: RemoteImagingException - if the limit of retries is exceeded. |
getProtocolName | public String getProtocolName()(Code) | | Returns the String that identifies the remote imaging
protocol.
|
getRemoteProperty | abstract public Object getRemoteProperty(String name) throws RemoteImagingException(Code) | | Returns a property from the property set generated on the remote
server machine. Network errors encountered should be signalled
by throwing a RemoteImagingException . If the property
name is not recognized, java.awt.Image.UndefinedProperty will be
returned.
throws: RemoteImagingException - if an error condition during remoteimage processing occurs throws: IllegalArgumentException - if name is null. |
getRemotePropertyNames | abstract public String[] getRemotePropertyNames() throws RemoteImagingException(Code) | | Returns a list of names recognized by the getRemoteProperty
method. Network errors encountered should be signalled by
throwing a RemoteImagingException .
throws: RemoteImagingException - if an error condition during remoteimage processing occurs |
getRenderingHints | public RenderingHints getRenderingHints()(Code) | | Returns the RenderingHints associated with the
operation to be performed by this PlanarImageServerProxy .
|
getRetryInterval | public int getRetryInterval()(Code) | | Returns the amount of time between retries in milliseconds.
|
getSampleModel | public SampleModel getSampleModel()(Code) | | Overrides the method in PlanarImage to return the
SampleModel of the remote image.
|
getServerName | public String getServerName()(Code) | | Returns the String that identifies the server.
|
getTile | public Raster getTile(int tileX, int tileY)(Code) | | Returns the tile (tileX, tileY). Note the tileX and tileY are indices
into the tile array and not pixel positions. This method is
implemented in terms of the computeTile method. This
method deals with Network errors (recognized as
RemoteImagingExceptions ) through retries and retry
intervals. This method also performs caching of tiles, so that
an already computed tile does not need to be re-computed.
Parameters: tileX - the X index of the tile. Parameters: tileY - the Y index of the tile. throws: RemoteImagingException - if limit of retries is exceeded. |
getTileCache | public TileCache getTileCache()(Code) | | Returns the tile cache object of this image by reference.
If this image does not have a tile cache, this method returns
null .
|
getTileCacheMetric | public Object getTileCacheMetric()(Code) | | Returns the tileCacheMetric instance variable by reference.
|
getTileGridXOffset | public int getTileGridXOffset()(Code) | | Overrides the method in PlanarImage to return the X
coordinate of the upper-left pixel of tile (0, 0) remotely.
|
getTileGridYOffset | public int getTileGridYOffset()(Code) | | Overrides the method in PlanarImage to return the Y
coordinate of the upper-left pixel of tile (0, 0) remotely.
|
getTileHeight | public int getTileHeight()(Code) | | Overrides the method in PlanarImage to return the height
of a tile remotely.
|
getTileWidth | public int getTileWidth()(Code) | | Overrides the method in PlanarImage to return the width
of a tile remotely.
|
getWidth | public int getWidth()(Code) | | Overrides the method in PlanarImage to return the width
of the remote image.
|
mapDestRect | abstract public Rectangle mapDestRect(Rectangle destRect, int sourceIndex) throws RemoteImagingException(Code) | | Returns a conservative estimate of the region of a specified
source that is required in order to compute the pixels of a
given destination rectangle. Either the server or the client can
compute the source region to implement this method. Network errors
encountered should be signalled by throwing a
RemoteImagingException .
Parameters: destRect - The Rectangle in destination coordinates. Parameters: sourceIndex - The index of the source image. A Rectangle indicating the required source region. throws: IllegalArgumentException - If the source index isnegative or greater than that of the last source. throws: IllegalArgumentException - If destRect isnull . |
mapSourceRect | abstract public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex) throws RemoteImagingException(Code) | | Returns a conservative estimate of the destination region that
can potentially be affected by the pixels of a rectangle of a
given source. This can be implemented by either asking the server
to compute the destination region, or by having the client compute
the destination region. Network errors encountered should be
signalled by throwing a RemoteImagingException .
Parameters: sourceRect - The Rectangle in source coordinates. Parameters: sourceIndex - The index of the source image. A Rectangle indicating the potentiallyaffected destination region, or null ifthe region is unknown. throws: IllegalArgumentException - If the source index isnegative or greater than that of the last source. throws: IllegalArgumentException - If sourceRect isnull . |
setNegotiationPreferences | public void setNegotiationPreferences(NegotiableCapabilitySet preferences)(Code) | | Sets the preferences to be used in the client-server
communication. These preferences are utilized in the negotiation
process. Note that preferences for more than one category can be
specified using this method. Also each preference can be a list
of values in decreasing order of preference, each value specified
as a NegotiableCapability . The
NegotiableCapability first (for a particular category)
in this list is given highest priority in the negotiation process
(for that category).
It may be noted that this method allows for multiple negotiation
cycles. Everytime this method is called, new preferences are
specified for the negotiation, which takes place anew to produce
a new set of negotiated resultant values to be used in the
remote communication. If the subclass wants to ignore the
negotiation preferences newly set, this method can be overridden to
do so.
Parameters: preferences - The preferences to be used in the negotiationprocess. |
setNumRetries | public void setNumRetries(int numRetries)(Code) | | Sets the number of retries.
Parameters: numRetries - The number of times an operation should be retriedin case of a network error. throws: IllegalArgumentException - if numRetries is negative. |
setRetryInterval | public void setRetryInterval(int retryInterval)(Code) | | Sets the amount of time between retries in milliseconds.
Parameters: retryInterval - The amount of time (in milliseconds) to waitbetween retries. throws: IllegalArgumentException - if retryInterval is negative. |
setTileCache | public void setTileCache(TileCache cache)(Code) | | Sets the tile cache object of this image. A null
input indicates that this image should have no tile cache and
subsequently computed tiles will not be cached.
The existing cache object is informed to release all the
currently cached tiles of this image.
Parameters: cache - A cache object to be used for caching this image'stiles, or null if no tile caching is desired. |
Methods inherited from javax.media.jai.PlanarImage | public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int XToTileX(int x)(Code)(Java Doc) public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int YToTileY(int y)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean addSink(Object sink)(Code)(Java Doc) protected void addSink(PlanarImage sink)(Code)(Java Doc) protected void addSource(Object source)(Code)(Java Doc) public synchronized void addTileComputationListener(TileComputationListener listener)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) public WritableRaster copyData()(Code)(Java Doc) public WritableRaster copyData(WritableRaster raster)(Code)(Java Doc) public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)(Java Doc) public static ColorModel createColorModel(SampleModel sm)(Code)(Java Doc) public PlanarImage createSnapshot()(Code)(Java Doc) final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)(Java Doc) public BufferedImage getAsBufferedImage()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Raster getData()(Code)(Java Doc) public Raster getData(Rectangle region)(Code)(Java Doc) public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)(Java Doc) public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Object getImageID()(Code)(Java Doc) public int getMaxTileX()(Code)(Java Doc) public int getMaxTileY()(Code)(Java Doc) public int getMaxX()(Code)(Java Doc) public int getMaxY()(Code)(Java Doc) public int getMinTileX()(Code)(Java Doc) public int getMinTileY()(Code)(Java Doc) public int getMinX()(Code)(Java Doc) public int getMinY()(Code)(Java Doc) public int getNumBands()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public int getNumXTiles()(Code)(Java Doc) public int getNumYTiles()(Code)(Java Doc) protected Hashtable getProperties()(Code)(Java Doc) public Object getProperty(String name)(Code)(Java Doc) public Class getPropertyClass(String name)(Code)(Java Doc) public String[] getPropertyNames()(Code)(Java Doc) public String[] getPropertyNames(String prefix)(Code)(Java Doc) public SampleModel getSampleModel()(Code)(Java Doc) public Vector getSinks()(Code)(Java Doc) public PlanarImage getSource(int index)(Code)(Java Doc) public PlanarImage getSourceImage(int index)(Code)(Java Doc) public Object getSourceObject(int index)(Code)(Java Doc) public Vector getSources()(Code)(Java Doc) public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)(Java Doc) abstract public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileComputationListener[] getTileComputationListeners()(Code)(Java Doc) public TileFactory getTileFactory()(Code)(Java Doc) public int getTileGridXOffset()(Code)(Java Doc) public int getTileGridYOffset()(Code)(Java Doc) public int getTileHeight()(Code)(Java Doc) public Point[] getTileIndices(Rectangle region)(Code)(Java Doc) public Rectangle getTileRect(int tileX, int tileY)(Code)(Java Doc) public int getTileWidth()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public Raster[] getTiles()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public boolean overlapsMultipleTiles(Rectangle rect)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) public void removeProperty(String name)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean removeSink(Object sink)(Code)(Java Doc) protected boolean removeSink(PlanarImage sink)(Code)(Java Doc) public void removeSinks()(Code)(Java Doc) protected boolean removeSource(Object source)(Code)(Java Doc) protected void removeSources()(Code)(Java Doc) public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)(Java Doc) protected void setImageLayout(ImageLayout layout)(Code)(Java Doc) protected void setProperties(Hashtable properties)(Code)(Java Doc) public void setProperty(String name, Object value)(Code)(Java Doc) protected void setSource(Object source, int index)(Code)(Java Doc) protected void setSources(List sourceList)(Code)(Java Doc) public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int tileXToX(int tx)(Code)(Java Doc) public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int tileYToY(int ty)(Code)(Java Doc) public String toString()(Code)(Java Doc) public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)(Java Doc)
|
|
|