View Javadoc

1   /*
2    * Copyright (C) The DNA Group. All rights reserved.
3    *
4    * This software is published under the terms of the DNA
5    * Software License version 1.1, a copy of which has been included
6    * with this distribution in the LICENSE.txt file.
7    */
8   package org.codehaus.dna;
9   
10  /***
11   * This is the interface via which component
12   * resources can be accessed via keys.
13   *
14   * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
15   */
16  public interface ResourceLocator
17  {
18      /***
19       * Return resource registered with specified key.
20       *
21       * @param key the key
22       * @return the resource
23       * @throws MissingResourceException if unable to locate
24       *         resource with specified key
25       */
26      Object lookup( String key )
27          throws MissingResourceException;
28  
29      /***
30       * Return true if a resource exists with specified key.
31       *
32       * @param key the key
33       * @return true if a resource exists with specified key.
34       */
35      boolean contains( String key );
36  }