Source Code Cross Referenced for LinkException.java in  » Apache-Harmony-Java-SE » javax-package » javax » naming » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » javax package » javax.naming 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package javax.naming;
019:
020:        /**
021:         * Naming operations may throw a <code>LinkException</code> when attempting to
022:         * resolve links. Methods are provided to save diagnostic information about how
023:         * far link resolution has progressed.
024:         * <p>
025:         * Multithreaded access to a single <code>LinkException</code> instance is
026:         * only safe when client code uses appropriate synchronization and locking.
027:         * </p>
028:         */
029:        public class LinkException extends NamingException {
030:
031:            /*
032:             * This constant is used during deserialization to check the version which
033:             * created the serialized object.
034:             */
035:            private final static long serialVersionUID = -7967662604076777712L;
036:
037:            /**
038:             * Description of why the link could not be resolved.
039:             */
040:            protected String linkExplanation;
041:
042:            /**
043:             * Composite name containing the name which could not be resolved.
044:             */
045:            protected Name linkRemainingName;
046:
047:            /**
048:             * Composite name containing the name which was resolved.
049:             */
050:            protected Name linkResolvedName;
051:
052:            /**
053:             * Contains the object that linkResolvedName relates to.
054:             */
055:            protected Object linkResolvedObj;
056:
057:            /**
058:             * Constructs a <code>LinkException</code> instance with all data
059:             * initialized to null.
060:             */
061:            public LinkException() {
062:                super ();
063:            }
064:
065:            /**
066:             * Constructs a <code>LinkException</code> instance with the specified
067:             * message.
068:             * 
069:             * @param s
070:             *            The detail message for the exception. It may be null.
071:             */
072:            public LinkException(String s) {
073:                super (s);
074:            }
075:
076:            /**
077:             * Outputs the string representation of this <code>NamingException</code>
078:             * together with the details of the remaining name.
079:             * 
080:             * @return the string representation of this <code>NamingException</code>
081:             *         together with the details of the remaining name.
082:             */
083:            @Override
084:            public String toString() {
085:                return toStringImpl(false);
086:            }
087:
088:            private String toStringImpl(boolean b) {
089:                StringBuffer sb = new StringBuffer(super .toString());
090:                sb
091:                        .append("; the link remaining name is - '").append(linkRemainingName).append( //$NON-NLS-1$
092:                                "'"); //$NON-NLS-1$
093:                if (b && null != linkResolvedObj) {
094:                    sb.append("; the link resolved object is - '").append( //$NON-NLS-1$
095:                            linkResolvedObj).append("'"); //$NON-NLS-1$
096:                }
097:                return sb.toString();
098:            }
099:
100:            /**
101:             * Outputs the string representation of this <code>NamingException</code>
102:             * together with the details of the remaining name.
103:             * <p>
104:             * If boolean b is set to true then also outputs the resolved object.<br/>
105:             * If boolean b is set to false then the behavior is the same as
106:             * <code>toString()</code>.
107:             * 
108:             * @param b
109:             *            Indicates if the resolved object need to be outputted.
110:             * @return the string representation of this <code>NamingException</code>
111:             *         together with the details of the remaining name.
112:             */
113:            @Override
114:            public String toString(boolean b) {
115:                return toStringImpl(b);
116:            }
117:
118:            /**
119:             * Retrieves the value of the <code>linkExplanation</code> field.
120:             * 
121:             * @return the value of the <code>linkExplanation</code> field.
122:             */
123:            public String getLinkExplanation() {
124:                return linkExplanation;
125:            }
126:
127:            /**
128:             * Retrieves the value of the <code>linkRemainingName</code> field.
129:             * 
130:             * @return the value of the <code>linkRemainingName</code> field.
131:             */
132:            public Name getLinkRemainingName() {
133:                return linkRemainingName;
134:            }
135:
136:            /**
137:             * Retrieves the value of the <code>linkResolvedName</code> field.
138:             * 
139:             * @return the value of the <code>linkResolvedName</code> field.
140:             */
141:            public Name getLinkResolvedName() {
142:                return linkResolvedName;
143:            }
144:
145:            /**
146:             * Retrieves the value of the <code>linkResolvedObj</code> field.
147:             * 
148:             * @return the value of the <code>linkResolvedObj</code> field.
149:             */
150:            public Object getLinkResolvedObj() {
151:                return linkResolvedObj;
152:            }
153:
154:            /**
155:             * Sets the <code>linkExplanation</code> field to the specified value.
156:             * 
157:             * @param string
158:             *            the new <code>linkExplanation</code> value to be set.
159:             */
160:            public void setLinkExplanation(String string) {
161:                linkExplanation = string;
162:            }
163:
164:            /**
165:             * Sets the <code>linkRemainingName</code> to the specified name. It may
166:             * be null. The remaining name details must not change even if the original
167:             * <code>Name</code> itself changes.
168:             * 
169:             * @param name
170:             *            the new <code>linkRemainingName</code> value to be set. It
171:             *            may be null.
172:             */
173:            public void setLinkRemainingName(Name name) {
174:                linkRemainingName = null == name ? null : (Name) name.clone();
175:            }
176:
177:            /**
178:             * Sets the <code>linkResolvedName</code> to the specified name. This may
179:             * be null. The resolved name details must not change even if the original
180:             * <code>Name</code> itself changes.
181:             * 
182:             * @param name
183:             *            the new <code>linkResolvedName</code> value to be set.
184:             */
185:            public void setLinkResolvedName(Name name) {
186:                linkResolvedName = null == name ? null : (Name) name.clone();
187:            }
188:
189:            /**
190:             * Sets the <code>linkResolvedObj</code> field to object. This may be
191:             * null.
192:             * 
193:             * @param object
194:             *            the new <code>linkResolvedObj</code> value to be set.
195:             */
196:            public void setLinkResolvedObj(Object object) {
197:                linkResolvedObj = object;
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.