Source Code Cross Referenced for ResolveResult.java in  » Apache-Harmony-Java-SE » javax-package » javax » naming » spi » 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.spi 
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.spi;
019:
020:        import javax.naming.Name;
021:        import javax.naming.InvalidNameException;
022:        import javax.naming.CompositeName;
023:
024:        /**
025:         * An instance of <code>ResolveResult</code> is produced when a name
026:         * resolution operation has completed. The instance must contain the object
027:         * associated with the successfully resolved name, and any remaining portion of
028:         * the name yet to be resolved. Where a <code>String</code> parameter is used
029:         * to specify a name, it should be considered to be a composite name.
030:         * <p>
031:         * Multithreaded access to a single <code>ResolveResult</code> instance is
032:         * only safe when client code locks the object first.
033:         * </p>
034:         */
035:        public class ResolveResult implements  java.io.Serializable {
036:
037:            static final long serialVersionUID = -4552108072002407559L;
038:
039:            /**
040:             * This field holds the object associated with the resolved name. It may be
041:             * null only when a subclass is constructed. It must be initialized to a
042:             * non-null value by constructors of this class.
043:             * 
044:             * @serial
045:             */
046:            protected Object resolvedObj;
047:
048:            /**
049:             * This field holds the portion of a resolved name that remains to be
050:             * resolved. It may be null only when a subclass is constructed. It must be
051:             * initialized to a non-null value by constructors of this class.
052:             * 
053:             * @serial
054:             */
055:            protected Name remainingName;
056:
057:            /**
058:             * This is the default constructor implicitly invoked by subclass
059:             * constructors. This constructor set both the resolved object and the
060:             * remaining name to null.
061:             */
062:            protected ResolveResult() {
063:                this .resolvedObj = null;
064:                this .remainingName = null;
065:            }
066:
067:            /**
068:             * This constructor creates a instance with the specified resolved object
069:             * and a specified remaining name of type <code>String</code>. The name
070:             * argument may not be null, but may be empty. The object argument may not
071:             * be null.
072:             * 
073:             * @param o
074:             *            may not be null
075:             * @param s
076:             *            may not be null, but may be empty
077:             */
078:            public ResolveResult(Object o, String s) {
079:                this .resolvedObj = o;
080:                try {
081:                    this .remainingName = new CompositeName(s);
082:                } catch (InvalidNameException e) {
083:                    this .remainingName = null;
084:                }
085:            }
086:
087:            /**
088:             * This constructor creates a instance with the specified resolved object
089:             * and a remaining name of type <code>Name</code>. The name argument may
090:             * not be null, but may be empty. The object argument may not be null.
091:             * 
092:             * @param o
093:             *            may not be null
094:             * @param n
095:             *            may not be null
096:             */
097:            public ResolveResult(Object o, Name n) {
098:                this .resolvedObj = o;
099:                if (null == n) {
100:                    this .remainingName = null;
101:                } else {
102:                    this .remainingName = (Name) n.clone();
103:                }
104:            }
105:
106:            /**
107:             * Extends the remaining name (remainingName) with a single specified name
108:             * component. The name argument may be null, but this leaves the remaining
109:             * name unmodified.
110:             * 
111:             * @param s
112:             *            the name component to be added to the remaining name. A null
113:             *            leaves the remaining name unmodified.
114:             */
115:            public void appendRemainingComponent(String s) {
116:                if (null != s) {
117:                    if (null == this .remainingName) {
118:                        this .remainingName = new CompositeName();
119:                    }
120:                    try {
121:                        remainingName.add(s);
122:                    } catch (InvalidNameException e) {
123:                        throw new Error(e.getMessage());
124:                    }
125:                }
126:            }
127:
128:            /**
129:             * Extends the remaining name (remainingName) with all components of the
130:             * specified name. The name argument may be null, but this leaves the
131:             * remaining name unmodified.
132:             * 
133:             * @param n
134:             *            the name to be added to the remaining name A null leaves the
135:             *            remaining name unmodified.
136:             */
137:            public void appendRemainingName(Name n) {
138:                if (null != n) {
139:                    if (null == this .remainingName) {
140:                        this .remainingName = (Name) n.clone();
141:                    } else {
142:                        try {
143:                            this .remainingName.addAll(n);
144:                        } catch (InvalidNameException e) {
145:                            throw new Error(e.getMessage());
146:                        }
147:                    }
148:                }
149:            }
150:
151:            /**
152:             * Returns any unresolved portion of the name that was resolved (the
153:             * remaining name). The returned <code>Name</code> may be empty, but may
154:             * not be null.
155:             * 
156:             * @return any unresolved portion of the name that was resolved (the
157:             *         remaining name).
158:             */
159:            public Name getRemainingName() {
160:                return this .remainingName;
161:            }
162:
163:            /**
164:             * Returns the non-null object that was resolved (resolved object).
165:             * 
166:             * @return the non-null object that was resolved (resolved object).
167:             */
168:            public Object getResolvedObj() {
169:                return this .resolvedObj;
170:            }
171:
172:            /**
173:             * Sets the remaining name (remainingName) to a copy of the specified
174:             * <code>Name</code> parameter may be empty, but not null.
175:             * 
176:             * @param n
177:             *            a name, may be empty, but no null
178:             */
179:            public void setRemainingName(Name n) {
180:                if (null == n) {
181:                    this .remainingName = null;
182:                } else {
183:                    this .remainingName = (Name) n.clone();
184:                }
185:            }
186:
187:            /**
188:             * Sets the resolved object (resolved object) to o which may not be null.
189:             * 
190:             * @param o
191:             *            an object, may not be null
192:             */
193:            public void setResolvedObj(Object o) {
194:                this.resolvedObj = o;
195:            }
196:
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.