| java.lang.Object com.sun.media.jai.rmi.SerializableRenderableImage
SerializableRenderableImage | final public class SerializableRenderableImage implements RenderableImage,Serializable(Code) | | A serializable wrapper class for classes which implement the
RenderableImage interface.
A SerializableRenderableImage provides a means to
serialize a RenderableImage . Transient fields are handled
using Serializer s registered with the
SerializerFactory . Since no data is associated with a
RenderableImage , SerializableRenderableImage
does not provide any renderable image data. The only way to access image
data from a SerializableRenderableImage is by calling any
one of the createDefaultRendering ,
createRendering , or createScaledRendering
methods. The resultant RenderedImage is created on the remote
host and provided via deep copy of the image data. If the request is
made on the local host, the image data are provided by forwarding
the request to the wrapped RenderableImage . Note that a single
SerializableRenderableImage object should be able to service
multiple remote hosts.
An example of the usage of this class is as follows:
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
public class SomeSerializableClass implements Serializable {
protected transient RenderableImage image;
// Fields omitted.
public SomeSerializableClass(RenderableImage image) {
this.image = image;
}
// Methods omitted.
// Serialization method.
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeObject(new SerializableRenderableImage(image));
}
// Deserialization method.
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
image = (RenderableImage)in.readObject();
}
}
See Also: java.awt.image.renderable.RenderableImage See Also: javax.media.jai.RenderableOp |
Method Summary | |
public RenderedImage | createDefaultRendering() Returns a RenderedImage which is the result of
calling createDefaultRendering on the wrapped
RenderableImage . | public RenderedImage | createRendering(RenderContext renderContext) | public RenderedImage | createScaledRendering(int w, int h, RenderingHints hints) | public void | dispose() Provides a hint that an image will no longer be accessed from a
reference in user space. | protected void | finalize() If a deep copy is not being used, unset the data server availability
flag and wait for the server thread to rejoin the current thread. | public float | getHeight() | public float | getMinX() | public float | getMinY() | public Object | getProperty(String name) | public String[] | getPropertyNames() | public Vector | getSources() If this SerializableRenderableImage has not been
serialized, this method returns a Vector containing
only the RenderableImage passed to the constructor; if
this image has been deserialized, it returns null . | public float | getWidth() | public boolean | isDynamic() |
SerializableRenderableImage | SerializableRenderableImage()(Code) | | The default constructor.
|
SerializableRenderableImage | public SerializableRenderableImage(RenderableImage source, OperationRegistry registry, String formatName, TileCodecParameterList encodingParam, TileCodecParameterList decodingParam)(Code) | | Constructs a SerializableRenderableImage wrapper for a
RenderableImage source. The image data of the rendering
will be serialized via a single deep copy. Tile encoding and
decoding may be effected via a TileEncoder and
TileDecoder specified by format name.
Parameters: source - The RenderableImage source. Parameters: registry - The OperationRegistry to use increating the TileEncoder . TheTileDecoder will of necessity becreated using the default OperationRegistry as the specified OperationRegistry is notserialized. If null the default registrywill be used. Parameters: formatName - The name of the format used to encode the data.If null simple tile serialization willbe performed either directly or by use of a "raw"TileCodec . Parameters: encodingParam - The parameters to be used for data encoding. Ifnull the default encodingTileCodecParameterList for thisformat will be used. Ignored ifformatName is null . Parameters: decodingParam - The parameters to be used for data decoding. Ifnull a complementaryTileCodecParameterList will bederived from encodingParam . Ignoredif formatName is null . exception: IllegalArgumentException - if source or formatName is null . exception: IllegalArgumentException - if encodingParam anddecodingParam do not have the same format name as thesupplied formatName . |
SerializableRenderableImage | public SerializableRenderableImage(RenderableImage source)(Code) | | Constructs a SerializableRenderableImage wrapper for a
RenderableImage source. Image data of the rendering of
the RenderableImage will be serialized via a single deep
copy. No TileCodec will be used, i.e., data will be
transmitted using the serialization protocol for Raster s.
Parameters: source - The RenderableImage source. exception: IllegalArgumentException - if source or formatName is null . |
createDefaultRendering | public RenderedImage createDefaultRendering()(Code) | | Returns a RenderedImage which is the result of
calling createDefaultRendering on the wrapped
RenderableImage .
|
createRendering | public RenderedImage createRendering(RenderContext renderContext)(Code) | | |
createScaledRendering | public RenderedImage createScaledRendering(int w, int h, RenderingHints hints)(Code) | | |
dispose | public void dispose()(Code) | | Provides a hint that an image will no longer be accessed from a
reference in user space. The results are equivalent to those
that occur when the program loses its last reference to this
image, the garbage collector discovers this, and finalize is
called. This can be used as a hint in situations where waiting
for garbage collection would be overly conservative, e.g., there
are a large number of socket connections which may be opened to
transmit tile data.
SerializableRenderableImage defines this method to
behave as follows:
- if the image is acting as a server, i.e., has never been
serialized and may be providing data to serialized
versions of itself, it makes itself unavailable to further
client requests and closes its socket;
- if the image is acting as a client, i.e., has been serialized
and may be requesting data from a remote, pre-serialization version
of itself, it sends a message to its remote self indicating that it
will no longer be making requests.
The results of referencing an image after a call to
dispose() are undefined.
|
finalize | protected void finalize() throws Throwable(Code) | | If a deep copy is not being used, unset the data server availability
flag and wait for the server thread to rejoin the current thread.
|
getHeight | public float getHeight()(Code) | | |
getMinX | public float getMinX()(Code) | | |
getMinY | public float getMinY()(Code) | | |
getSources | public Vector getSources()(Code) | | If this SerializableRenderableImage has not been
serialized, this method returns a Vector containing
only the RenderableImage passed to the constructor; if
this image has been deserialized, it returns null .
|
getWidth | public float getWidth()(Code) | | |
isDynamic | public boolean isDynamic()(Code) | | |
|
|