NextApp Echo
App Container 1.0.5

nextapp.echoservlet.image
Class ImagePeer

java.lang.Object
  extended bynextapp.echoservlet.image.ImagePeer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AwtImagePeer, HttpImagePeer, ResourceImagePeer, StreamImagePeer

public abstract class ImagePeer
extends java.lang.Object
implements java.io.Serializable

A base class from which all image peers are derived.

See Also:
Serialized Form

Field Summary
private  nextapp.echo.ImageReference imageRef
          A reference to the represented ImageReference
private  int recency
          A value assigned by the ImageRepository to indicate how recently the image peer has been used.
 
Constructor Summary
ImagePeer()
          Default constructor.
 
Method Summary
abstract  Service getAncillaryService()
          Returns the ancillary service used for rendering this image on the client.
 nextapp.echo.ImageReference getImageReference()
          Returns the underlying image reference.
(package private)  int getRecency()
          Returns the recency value of this peer.
abstract  java.lang.String getUri(Connection conn)
          Returns the URI required to reference this image from a document rendered by the given Connection.
 void registered()
          Called to notify the image peer that it has been registered to an image.
 void setId(Id id)
          Sets the identifier for the ancillary service if one is required.
(package private)  void setImageReference(nextapp.echo.ImageReference imageRef)
          Initializes the image peer: this method must be called before any other methods.
(package private)  void setRecency(int recency)
          Sets the recency value of this peer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recency

private int recency
A value assigned by the ImageRepository to indicate how recently the image peer has been used.


imageRef

private nextapp.echo.ImageReference imageRef
A reference to the represented ImageReference

Constructor Detail

ImagePeer

public ImagePeer()
Default constructor.

Method Detail

getAncillaryService

public abstract Service getAncillaryService()
Returns the ancillary service used for rendering this image on the client. Returns null if no ancillary service is required.

Returns:
The ancillary service used for rendering this image on the client.

getImageReference

public nextapp.echo.ImageReference getImageReference()
Returns the underlying image reference.

Returns:
The underlying image reference.

getRecency

int getRecency()
Returns the recency value of this peer.

Returns:
The recency value of this peer.

getUri

public abstract java.lang.String getUri(Connection conn)
Returns the URI required to reference this image from a document rendered by the given Connection.

Parameters:
conn - The connection that is rendering the document that references the image.
Returns:
The URI of the image.

registered

public void registered()
Called to notify the image peer that it has been registered to an image. This method should be overridden when notification of registration is required.


setId

public void setId(Id id)
Sets the identifier for the ancillary service if one is required.

Parameters:
id - The identifier for the ancillary service.

setImageReference

void setImageReference(nextapp.echo.ImageReference imageRef)
Initializes the image peer: this method must be called before any other methods.

Parameters:
imageRef - The image that is represented by this ImagePeer.

setRecency

void setRecency(int recency)
Sets the recency value of this peer.

Parameters:
recency - The recency value.

NextApp Echo
App Container 1.0.5