KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > registry > mock > MockInitialContext


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: MockInitialContext.java 11:00:16 ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.registry.mock;
23
24 import java.util.Hashtable JavaDoc;
25 import java.util.Map JavaDoc;
26
27 import javax.naming.Binding JavaDoc;
28 import javax.naming.Context JavaDoc;
29 import javax.naming.InitialContext JavaDoc;
30 import javax.naming.Name JavaDoc;
31 import javax.naming.NameClassPair JavaDoc;
32 import javax.naming.NameParser JavaDoc;
33 import javax.naming.NamingException JavaDoc;
34
35 /**
36  *
37  * @author ddesjardins - eBMWebsourcing
38  */

39 public class MockInitialContext extends InitialContext JavaDoc {
40
41     private MockContext context;
42
43     public MockInitialContext() throws NamingException JavaDoc {
44         super();
45         context = new MockContext();
46     }
47
48     public Object JavaDoc addToEnvironment(String JavaDoc propName, Object JavaDoc propVal)
49         throws NamingException JavaDoc {
50         return context.addToEnvironment(propName, propVal);
51     }
52
53     public void bind(Name JavaDoc name, Object JavaDoc obj) throws NamingException JavaDoc {
54         context.bind(name, obj);
55     }
56
57     public void bind(String JavaDoc name, Object JavaDoc obj) throws NamingException JavaDoc {
58         context.bind(name, obj);
59     }
60
61     public void close() throws NamingException JavaDoc {
62         context.close();
63     }
64
65     public Name JavaDoc composeName(Name JavaDoc name, Name JavaDoc prefix) throws NamingException JavaDoc {
66         return context.composeName(name, prefix);
67     }
68
69     public String JavaDoc composeName(String JavaDoc name, String JavaDoc prefix)
70         throws NamingException JavaDoc {
71         return context.composeName(name, prefix);
72     }
73
74     public Context JavaDoc createSubcontext(Name JavaDoc name) throws NamingException JavaDoc {
75         return context.createSubcontext(name);
76     }
77
78     public Context JavaDoc createSubcontext(String JavaDoc name) throws NamingException JavaDoc {
79         return context.createSubcontext(name);
80     }
81
82     public void destroySubcontext(Name JavaDoc name) throws NamingException JavaDoc {
83         context.destroySubcontext(name);
84     }
85
86     public void destroySubcontext(String JavaDoc name) throws NamingException JavaDoc {
87         context.destroySubcontext(name);
88     }
89
90     public boolean equals(Object JavaDoc obj) {
91         return context.equals(obj);
92     }
93
94     public Map JavaDoc<String JavaDoc, Object JavaDoc> getBindings() {
95         return context.getBindings();
96     }
97
98     public Hashtable JavaDoc<?, ?> getEnvironment() throws NamingException JavaDoc {
99         return context.getEnvironment();
100     }
101
102     public String JavaDoc getNameInNamespace() throws NamingException JavaDoc {
103         return context.getNameInNamespace();
104     }
105
106     public NameParser JavaDoc getNameParser(Name JavaDoc name) throws NamingException JavaDoc {
107         return context.getNameParser(name);
108     }
109
110     public NameParser JavaDoc getNameParser(String JavaDoc name) throws NamingException JavaDoc {
111         return context.getNameParser(name);
112     }
113
114     public int hashCode() {
115         return context.hashCode();
116     }
117
118     public MockNamingEnumeration<NameClassPair JavaDoc> list(Name JavaDoc name)
119         throws NamingException JavaDoc {
120         return context.list(name);
121     }
122
123     public MockNamingEnumeration<NameClassPair JavaDoc> list(String JavaDoc name)
124         throws NamingException JavaDoc {
125         return context.list(name);
126     }
127
128     public MockNamingEnumeration<Binding JavaDoc> listBindings(Name JavaDoc name)
129         throws NamingException JavaDoc {
130         return context.listBindings(name);
131     }
132
133     public MockNamingEnumeration<Binding JavaDoc> listBindings(String JavaDoc name)
134         throws NamingException JavaDoc {
135         return context.listBindings(name);
136     }
137
138     public Object JavaDoc lookup(Name JavaDoc name) throws NamingException JavaDoc {
139         return context.lookup(name);
140     }
141
142     public Object JavaDoc lookup(String JavaDoc name) throws NamingException JavaDoc {
143         return context.lookup(name);
144     }
145
146     public Object JavaDoc lookupLink(Name JavaDoc name) throws NamingException JavaDoc {
147         return context.lookupLink(name);
148     }
149
150     public Object JavaDoc lookupLink(String JavaDoc name) throws NamingException JavaDoc {
151         return context.lookupLink(name);
152     }
153
154     public void rebind(Name JavaDoc name, Object JavaDoc obj) throws NamingException JavaDoc {
155         context.rebind(name, obj);
156     }
157
158     public void rebind(String JavaDoc name, Object JavaDoc obj) throws NamingException JavaDoc {
159         context.rebind(name, obj);
160     }
161
162     public Object JavaDoc removeFromEnvironment(String JavaDoc propName) throws NamingException JavaDoc {
163         return context.removeFromEnvironment(propName);
164     }
165
166     public void rename(Name JavaDoc oldName, Name JavaDoc newName) throws NamingException JavaDoc {
167         context.rename(oldName, newName);
168     }
169
170     public void rename(String JavaDoc oldName, String JavaDoc newName) throws NamingException JavaDoc {
171         context.rename(oldName, newName);
172     }
173
174     public void setBindings(Map JavaDoc<String JavaDoc, Object JavaDoc> bindings) {
175         context.setBindings(bindings);
176     }
177
178     public String JavaDoc toString() {
179         return context.toString();
180     }
181
182     public void unbind(Name JavaDoc name) throws NamingException JavaDoc {
183         context.unbind(name);
184     }
185
186     public void unbind(String JavaDoc name) throws NamingException JavaDoc {
187         context.unbind(name);
188     }
189
190 }
191
Popular Tags