KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > clazzy > loader > Loader


1 package org.sapia.clazzy.loader;
2
3 import java.net.URL JavaDoc;
4
5 /**
6  * This interface specifies resource loading behavior. Classloader implementations
7  * can use such implementations for loading bytes corresponding to given classes.
8  *
9  * @author Yanick Duchesne
10  *
11  * <dl>
12  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public interface Loader {
18   
19   /**
20    * Loads a the bytes of the specified resources and returns them.
21    * @param resourceName
22    * @return an array of <code>byte</code>s, or <code>null</code> if no resource could
23    * be found for the given name, or if the bytes could not be loaded for some reason.
24    */

25   public byte[] loadBytes(String JavaDoc resourceName);
26   
27   /**
28    * @param resourceName the name of a resource.
29    * @return the <code>URL</code> corresponding to the given resource.
30    */

31   public URL JavaDoc getURL(String JavaDoc resourceName);
32   
33   /**
34    * Releases all resources that this instance holds.
35    */

36   public void close();
37
38 }
39
Popular Tags