org.jmage.resource
Class DefaultResourceManager

java.lang.Object
  extended by org.jmage.resource.DefaultResourceManager
All Implemented Interfaces:
Configurable, RequestHandler, ResourceManager

public class DefaultResourceManager
extends java.lang.Object
implements ResourceManager

ResourceManager is a facade for all ResourceFactories.


Field Summary
protected  java.util.List resourceFactories
           
 
Constructor Summary
protected DefaultResourceManager()
           
  DefaultResourceManager(java.util.List resourceFactories)
          Creates a ResourceManager for an array of given ResourceFactories
 
Method Summary
 void configure(ApplicationContext context)
           
 java.lang.Object createFrom(ImageRequest request)
          Creates a resource object to use from a given URI.
 java.lang.Object createFrom(java.net.URI resourceURI)
          Creates a resource object to use from a given URI.
 void handle(ImageRequest request)
          Creates the PlanarImage from a URI resource and sets it on the ImageRequest
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resourceFactories

protected java.util.List resourceFactories
Constructor Detail

DefaultResourceManager

protected DefaultResourceManager()

DefaultResourceManager

public DefaultResourceManager(java.util.List resourceFactories)
Creates a ResourceManager for an array of given ResourceFactories

Parameters:
resourceFactories -
Method Detail

configure

public void configure(ApplicationContext context)
Specified by:
configure in interface Configurable

handle

public void handle(ImageRequest request)
            throws JmageException
Creates the PlanarImage from a URI resource and sets it on the ImageRequest

Specified by:
handle in interface RequestHandler
Parameters:
request - the image request
Throws:
ResourceException
JmageException

createFrom

public java.lang.Object createFrom(ImageRequest request)
                            throws JmageException
Creates a resource object to use from a given URI.

Specified by:
createFrom in interface ResourceManager
Parameters:
request -
Returns:
the local resource object.
Throws:
ResourceException - if the resource could not be found, or not be handled by any of the configured ResourceFactory objects.
JmageException

createFrom

public java.lang.Object createFrom(java.net.URI resourceURI)
                            throws JmageException
Creates a resource object to use from a given URI.

Specified by:
createFrom in interface ResourceManager
Parameters:
resourceURI -
Returns:
the local resource object.
Throws:
ResourceException - if the resource could not be found, or not be handled by any of the configured ResourceFactory objects.
JmageException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2008 Sourceforge. All Rights Reserved.