KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > jndi > InitialContextFactory


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17 package org.sape.carbon.services.jndi;
18
19 import java.util.Map JavaDoc;
20
21 import javax.naming.InitialContext JavaDoc;
22 import javax.naming.NamingException JavaDoc;
23 import javax.naming.directory.InitialDirContext JavaDoc;
24
25 import org.sape.carbon.core.component.FunctionalInterface;
26
27 /**
28  * <p>This service provides a consistent way for gaining access to a
29  * JNDI InitialContext. This service allows clients to get InitialContexts
30  * based solely on configuration, solely on parameters, or a mixture
31  * between the two with parameters taking precedence.</p>
32  *
33  * @see javax.naming.InitialContext
34  *
35  * Copyright 2003 Sapient
36  * @since carbon 2.1
37  * @author Douglas Voet, Jul 30, 2003
38  * @version $Revision: 1.2 $($Author: dvoet $ / $Date: 2003/10/30 19:28:56 $)
39  */

40 public interface InitialContextFactory extends FunctionalInterface {
41     
42     /**
43      * Gets a new InitialContext instance with evironment values that come
44      * from the service's configuration.
45      *
46      * @return a new InitalContext
47      * @throws NamingException
48      */

49     InitialContext JavaDoc getContext() throws NamingException JavaDoc;
50     
51     /**
52      * Gets a new InitialContext instance with evironment values that come
53      * from the service's configuration, but environment values can also
54      * be passed via the environment parameter to augment or override the
55      * values stored in configuration.
56      *
57      * @param environment values that augment and/or override the values
58      * stored in configuration
59      * @return a new InitialContext
60      * @throws NamingException
61      */

62     InitialContext JavaDoc getContext(Map JavaDoc environment) throws NamingException JavaDoc;
63     
64     /**
65      * Gets a new InitialContext with environment values given in the
66      * evironment parameter. The service's configuration is ignored.
67      *
68      * @param environment values used to construct the InitialContext
69      * @return a new InitialContext
70      * @throws NamingException
71      */

72     InitialContext JavaDoc getContextIgnoreConfig(Map JavaDoc environment)
73         throws NamingException JavaDoc;
74
75     /**
76      * Gets a new InitialDirContext instance with evironment values that come
77      * from the service's configuration.
78      *
79      * @return a new InitialDirContext
80      * @throws NamingException
81      */

82     InitialDirContext JavaDoc getDirContext() throws NamingException JavaDoc;
83     
84     /**
85      * Gets a new InitialDirContext instance with evironment values that come
86      * from the service's configuration, but environment values can also
87      * be passed via the environment parameter to augment or override the
88      * values stored in configuration.
89      *
90      * @param environment values that augment and/or override the values
91      * stored in configuration
92      * @return a new InitialDirContext
93      * @throws NamingException
94      */

95     InitialDirContext JavaDoc getDirContext(Map JavaDoc environment) throws NamingException JavaDoc;
96     
97     /**
98      * Gets a new InitialDirContext with environment values given in the
99      * evironment parameter. The service's configuration is ignored.
100      *
101      * @param environment values used to construct the InitialContext
102      * @return a new InitialDirContext
103      * @throws NamingException
104      */

105     InitialDirContext JavaDoc getDirContextIgnoreConfig(Map JavaDoc environment)
106         throws NamingException JavaDoc;
107 }
108
Popular Tags