38 |
|
|
39 |
package org.omg.CosNaming; |
package org.omg.CosNaming; |
40 |
|
|
41 |
|
import gnu.CORBA.Minor; |
42 |
|
|
43 |
import org.omg.CORBA.Any; |
import org.omg.CORBA.Any; |
44 |
import org.omg.CORBA.BAD_OPERATION; |
import org.omg.CORBA.BAD_OPERATION; |
45 |
import org.omg.CORBA.BAD_PARAM; |
import org.omg.CORBA.BAD_PARAM; |
80 |
{ |
{ |
81 |
BAD_OPERATION bad = new BAD_OPERATION("Binding iterator expected"); |
BAD_OPERATION bad = new BAD_OPERATION("Binding iterator expected"); |
82 |
bad.initCause(ex); |
bad.initCause(ex); |
83 |
|
bad.minor = Minor.Any; |
84 |
throw bad; |
throw bad; |
85 |
} |
} |
86 |
} |
} |
124 |
return new _BindingIteratorStub(delegate); |
return new _BindingIteratorStub(delegate); |
125 |
} |
} |
126 |
} |
} |
127 |
|
|
128 |
|
/** |
129 |
|
* Narrow the given object to the BindingIterator. No type-checking is |
130 |
|
* performed to verify that the object actually supports the requested type. |
131 |
|
* The {@link BAD_OPERATION} will be thrown if unsupported operations are |
132 |
|
* invoked on the new returned reference, but no failure is expected at the |
133 |
|
* time of the unchecked_narrow. |
134 |
|
* |
135 |
|
* @param obj the object to cast. |
136 |
|
* |
137 |
|
* @return the casted binding iterator. |
138 |
|
* |
139 |
|
* @since 1.5 |
140 |
|
* |
141 |
|
* @see OMG issue 4158. |
142 |
|
*/ |
143 |
|
public static BindingIterator unchecked_narrow(org.omg.CORBA.Object obj) |
144 |
|
{ |
145 |
|
if (obj == null) |
146 |
|
return null; |
147 |
|
else if (obj instanceof BindingIterator) |
148 |
|
return (BindingIterator) obj; |
149 |
|
else |
150 |
|
{ |
151 |
|
// Do not call the _is_a(..). |
152 |
|
Delegate delegate = ((ObjectImpl) obj)._get_delegate(); |
153 |
|
return new _BindingIteratorStub(delegate); |
154 |
|
} |
155 |
|
} |
156 |
|
|
157 |
/** |
/** |
158 |
* Read the exception from the given CDR stream. |
* Read the exception from the given CDR stream. |