1 package org.sapia.soto; 2 3 import org.sapia.soto.util.Resource; 4 import org.sapia.soto.util.ResourceHandler; 5 import org.sapia.soto.util.ResourceHandlerChain; 6 7 import java.io.IOException; 8 import java.io.InputStream; 9 10 11 /** 12 * An instance of this interface provides an indirect hook into the container. 13 * 14 * @author Yanick Duchesne 15 * <dl> 16 * <dt><b>Copyright:</b><dd>Copyright © 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt> 17 * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the 18 * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt> 19 * </dl> 20 */ 21 public interface Env { 22 /** 23 * @see SotoContainer#lookup(String) 24 */ 25 public Object lookup(String serviceId) throws NotFoundException; 26 27 /** 28 * @see SotoContainer#getResourceHandlers() 29 */ 30 public ResourceHandlerChain getResourceHandlers(); 31 32 /** 33 * @see SotoContainer#getResourceHandlerFor(String) 34 */ 35 public ResourceHandler getResourceHandlerFor(String protocol); 36 37 /** 38 * Resolves the resource corresponding to the given URI. 39 * The path can have a protocol/scheme. 40 * 41 * @param uri a URI. 42 * @return the <code>InputStream</code> corresponding to the given resource path. 43 */ 44 public InputStream resolveStream(String uri) throws IOException; 45 46 /** 47 * Resolves the resource corresponding to the given URI. 48 * The path can have a protocol/scheme. 49 * 50 * @param uri a URI. 51 * @return the <code>Resource</code> corresponding to the given uri. 52 */ 53 public Resource resolveResource(String uri) throws IOException; 54 } 55