KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > naming > ErrorContext


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.naming;
30
31 import com.caucho.log.Log;
32 import com.caucho.util.L10N;
33
34 import javax.naming.Context JavaDoc;
35 import javax.naming.Name JavaDoc;
36 import javax.naming.NameParser JavaDoc;
37 import javax.naming.NamingEnumeration JavaDoc;
38 import javax.naming.NamingException JavaDoc;
39 import java.util.Hashtable JavaDoc;
40 import java.util.logging.Logger JavaDoc;
41
42 /**
43  * Error context always throwing NamingExceptions.
44  */

45 public class ErrorContext implements Context JavaDoc {
46   protected static final Logger JavaDoc log = Log.open(ErrorContext.class);
47   protected static L10N L = new L10N(ErrorContext.class);
48
49   protected NamingException JavaDoc exception;
50
51   public ErrorContext(Throwable JavaDoc exn)
52   {
53     if (exn instanceof NamingException JavaDoc)
54       this.exception = (NamingException JavaDoc) exn;
55     else
56       this.exception = new NamingExceptionWrapper(exn);
57   }
58
59   /**
60    * Looks up an object using its full string name. The path is searched
61    * recursively. <code>parseFirst</code> returns the first segment. The
62    */

63   public Object JavaDoc lookup(String JavaDoc name)
64     throws NamingException JavaDoc
65   {
66     throw exception;
67   }
68
69   /**
70    * Looks up an object with the given parsed JNDI name.
71    */

72   public Object JavaDoc lookup(Name JavaDoc name)
73     throws NamingException JavaDoc
74   {
75     throw exception;
76   }
77
78   public Object JavaDoc lookupLink(String JavaDoc name)
79     throws NamingException JavaDoc
80   {
81     throw exception;
82   }
83
84   public Object JavaDoc lookupLink(Name JavaDoc name)
85     throws NamingException JavaDoc
86   {
87     throw exception;
88   }
89
90   public void bind(String JavaDoc name, Object JavaDoc obj)
91     throws NamingException JavaDoc
92   {
93     throw exception;
94   }
95   
96   public void bind(Name JavaDoc name, Object JavaDoc obj)
97     throws NamingException JavaDoc
98   {
99     throw exception;
100   }
101
102   public void rebind(String JavaDoc name, Object JavaDoc obj)
103     throws NamingException JavaDoc
104   {
105     throw exception;
106   }
107   
108   public void rebind(Name JavaDoc name, Object JavaDoc obj)
109     throws NamingException JavaDoc
110   {
111     throw exception;
112   }
113
114   public void unbind(String JavaDoc name)
115     throws NamingException JavaDoc
116   {
117     throw exception;
118   }
119   
120   public void unbind(Name JavaDoc name)
121     throws NamingException JavaDoc
122   {
123     throw exception;
124   }
125
126   public void rename(String JavaDoc oldName, String JavaDoc newName)
127     throws NamingException JavaDoc
128   {
129     throw exception;
130   }
131
132   public void rename(Name JavaDoc oldName, Name JavaDoc newName)
133     throws NamingException JavaDoc
134   {
135     throw exception;
136   }
137
138   public NamingEnumeration JavaDoc list(String JavaDoc name)
139     throws NamingException JavaDoc
140   {
141     throw exception;
142   }
143
144   public NamingEnumeration JavaDoc list(Name JavaDoc name)
145     throws NamingException JavaDoc
146   {
147     throw exception;
148   }
149
150   public NamingEnumeration JavaDoc listBindings(String JavaDoc name)
151     throws NamingException JavaDoc
152   {
153     throw exception;
154   }
155
156   public NamingEnumeration JavaDoc listBindings(Name JavaDoc name)
157     throws NamingException JavaDoc
158   {
159     throw exception;
160   }
161
162   public Context JavaDoc createSubcontext(String JavaDoc name)
163     throws NamingException JavaDoc
164   {
165     throw exception;
166   }
167
168   public Context JavaDoc createSubcontext(Name JavaDoc name)
169     throws NamingException JavaDoc
170   {
171     throw exception;
172   }
173
174   public void destroySubcontext(String JavaDoc name)
175     throws NamingException JavaDoc
176   {
177     throw exception;
178   }
179   
180   public void destroySubcontext(Name JavaDoc name)
181     throws NamingException JavaDoc
182   {
183     throw exception;
184   }
185
186   public NameParser JavaDoc getNameParser(String JavaDoc name)
187     throws NamingException JavaDoc
188   {
189     throw exception;
190   }
191
192   public NameParser JavaDoc getNameParser(Name JavaDoc name)
193     throws NamingException JavaDoc
194   {
195     throw exception;
196   }
197
198   public String JavaDoc composeName(String JavaDoc prefix, String JavaDoc suffix)
199     throws NamingException JavaDoc
200   {
201     throw exception;
202   }
203
204   public Name JavaDoc composeName(Name JavaDoc prefix, Name JavaDoc suffix)
205     throws NamingException JavaDoc
206   {
207     throw exception;
208   }
209
210   public String JavaDoc getNameInNamespace()
211     throws NamingException JavaDoc
212   {
213     throw exception;
214   }
215
216   public Object JavaDoc addToEnvironment(String JavaDoc prop, Object JavaDoc value)
217     throws NamingException JavaDoc
218   {
219     throw exception;
220   }
221
222   public Object JavaDoc removeFromEnvironment(String JavaDoc prop)
223     throws NamingException JavaDoc
224   {
225     throw exception;
226   }
227
228   public Hashtable JavaDoc getEnvironment()
229     throws NamingException JavaDoc
230   {
231     throw exception;
232   }
233
234   /**
235    * Close is indended to free any transient data, like a cached
236    * socket. It does not affect the JNDI tree.
237    */

238   public void close()
239     throws NamingException JavaDoc
240   {
241     throw exception;
242   }
243 }
244
Popular Tags