1 package org.jmage.resource; 2 3 import org.jmage.Configurable; 4 import org.jmage.JmageException; 5 6 import java.net.URI; 7 import java.util.Properties; 8 9 /*** 10 * Interface for resource factories 11 */ 12 public interface ResourceFactory extends Configurable { 13 14 /*** 15 * Initialize the ResourceFactory with extra Properties needed 16 * @param properties 17 */ 18 public void configureRequestProperties(Properties properties); 19 20 /*** 21 * Determines whether a ResourceFactory can handle a resource for a given URI. 22 * 23 * @param resourceURI the URI of the resource. 24 * @return true | false 25 */ 26 public boolean canHandle(URI resourceURI); 27 28 /*** 29 * Creates a resource object to use from a given URI. 30 * 31 * @param resource 32 * @return the resource object. 33 * @throws ResourceException if the object cannot be found or an error occurs during creation. 34 */ 35 public abstract Object createFrom(URI resource) throws JmageException; 36 37 /*** 38 * Lifecycle method for removing per request properties 39 * @param properties 40 */ 41 public void removeRequestProperties(Properties properties); 42 }