|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.graphic.factory.GraphicFactory
public abstract class GraphicFactory
Base class for all Graphic factory classes. Instances of GraphicFactory subclasses can be registered with GraphicServer and used there to create Graphic instances from raw input streams. Because GraphicServer might be used in multi-threaded environments, it is very important that GraphicFactory subclasses handle state information with great care. In general, all state information used in the attemptCreate() method should either be local, or some other class (perhaps an inner class) should be used to manage it.
Constructor Summary | |
---|---|
GraphicFactory(GraphicServer4a server)
Constructor. |
Method Summary | |
---|---|
protected abstract Graphic4a |
attemptCreate(URL url,
BufferedInputStream bis)
Subclasses implement this method to try to create an appropriate Graphic instance. |
org.apache.commons.logging.Log |
getLogger()
Get the logger. |
GraphicServer4a |
getServer()
Returns the parent server. |
Graphic4a |
makeGraphic(URL url,
BufferedInputStream bis)
Factory method to create a Graphic instance from a given URL and a reusable input stream for that URL. |
int |
maxBytesToVerify()
Tells GraphicFactory how large to set the readlimit value
when marking the beginning of the stream, so that is can be reused. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphicFactory(GraphicServer4a server)
server
- The parent graphic server.Method Detail |
---|
public Graphic4a makeGraphic(URL url, BufferedInputStream bis) throws IOException
url
- The URL which contains the graphic content.bis
- The reusable input stream containing the bytes from url
.
IOException
- For IO errors.protected abstract Graphic4a attemptCreate(URL url, BufferedInputStream bis) throws IOException
url
- The URL which contains the graphic content.bis
- The reusable input stream containing the bytes from url
.
IOException
- For IO errors.public int maxBytesToVerify()
readlimit
value
when marking the beginning of the stream, so that is can be reused.
The default value is 1024. Subclasses that need to read more than this
amount when trying to create a Graphic instance should override this
method and return a higher amount. Otherwise, subsequent attempts to
use the stream will result in i/o errors.
public org.apache.commons.logging.Log getLogger()
public GraphicServer4a getServer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |