View Javadoc

1   /***
2    * @(#)NamingService.java
3    * 
4    * JFoxSOAF, Service-Oriented Application Framework
5    * 
6    * Copyright(c) JFoxSOAF Team
7    * 
8    * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
9    * you may not use this file except in compliance with the License. 
10   * You may obtain a copy of the License at  
11   * 
12   * http://www.gnu.org/copyleft/lesser.html
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, 
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
17   * See the License for the specific language governing permissions and 
18   * limitations under the License. 
19   * 
20   * For more information, please visit:
21   * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
22   * http://www.huihoo.org/jfox/jfoxsoaf
23   */
24  
25  package org.huihoo.jfox.soaf.services.naming;
26  
27  import javax.naming.NamingException;
28  
29  /***
30   * <p>
31   * JNDI Service.
32   * </p>
33   * 
34   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
35   * @version $Revision:$ $Date:$
36   * @version Revision: 1.0
37   */
38  
39  public interface NamingService {
40  	
41  	/***
42  	 * Retrieves the named object.
43  	 * 
44  	 * @param name - the name of the object to look up
45  	 * @return object - the object bound to name
46  	 * @throws NamingException - if a naming exception is encountered
47  	 */
48  	public Object lookup(String name) throws NamingException;
49  	
50  	/***
51  	 * Binds a name to an object.
52  	 * 
53  	 * @param name - the name to bind; may not be empty
54  	 * @param obj - the object to bind; possibly null
55  	 * @throws NamingException if a naming exception is encountered
56  	 */
57  	public void bind(String name, Object obj) throws NamingException;
58  	
59  	/***
60  	 * Binds a name to an object, overwriting any existing binding.
61  	 * 
62  	 * @param name - the name to bind; may not be empty
63  	 * @param obj - the object to bind; possibly null
64  	 * @throws NamingException - if a naming exception is encountered
65  	 */
66  	public void rebind(String name, Object obj) throws NamingException;
67  	
68  	/***
69  	 * Unbinds the named object.
70  	 * 
71  	 * @param name - the name to unbind; may not be empty
72  	 * @throws NamingException - if a naming exception is encountered
73  	 */
74  	public void unbind(String name) throws NamingException;
75  
76  }