KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > api > EZBArchive


1 /**
2 * EasyBeans
3 * Copyright (C) 2006 Bull S.A.S.
4 * Contact: easybeans@objectweb.org
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 * USA
20 *
21 * --------------------------------------------------------------------------
22 * $Id: EZBArchive.java 952 2006-07-26 16:30:27Z sauthieg $
23 * --------------------------------------------------------------------------
24 */

25
26 package org.objectweb.easybeans.api;
27
28 import java.net.URL JavaDoc;
29 import java.util.Iterator JavaDoc;
30
31 /**
32 * Abstraction layer around EZB processed archive (Jar, Directories, Bundles, ...).
33 * @author Guillaume Sauthier
34 */

35 public interface EZBArchive {
36
37     /**
38      * @return a description of this archive. This name could be used in logger info.
39      */

40     String JavaDoc getName();
41
42    /**
43     * @return Returns the resource URL.
44     * @throws EZBArchiveException if method fails.
45     */

46    URL JavaDoc getURL() throws EZBArchiveException;
47
48    /**
49     * @param resourceName The resource name to be looked up.
50     * @return Returns the resource URL if the resource
51     * has been found. null otherwise.
52     * @throws EZBArchiveException if method fails.
53     */

54    URL JavaDoc getResource(String JavaDoc resourceName) throws EZBArchiveException;
55
56    /**
57     * @return Returns an Iterator of Resource's URL.
58     * @throws EZBArchiveException if method fails.
59     */

60    Iterator JavaDoc<URL JavaDoc> getResources() throws EZBArchiveException;
61
62    /**
63     * @param resourceName The resource name to be looked up.
64     * @return Returns an Iterator of matching resources.
65     * @throws EZBArchiveException if method fails.
66     */

67    Iterator JavaDoc<URL JavaDoc> getResources(String JavaDoc resourceName) throws EZBArchiveException;
68
69    /**
70     * Close the underlying Resource.
71     * @return Returns <code>true</code> if the close was
72     * succesful, <code>false</code> otherwise.
73     */

74    boolean close();
75 }
76
Popular Tags