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("NamingContextExt expected"); |
BAD_OPERATION bad = new BAD_OPERATION("NamingContextExt expected"); |
82 |
bad.initCause(ex); |
bad.initCause(ex); |
83 |
|
bad.minor = Minor.Any; |
84 |
throw bad; |
throw bad; |
85 |
} |
} |
86 |
} |
} |
125 |
return new _NamingContextExtStub(delegate); |
return new _NamingContextExtStub(delegate); |
126 |
} |
} |
127 |
} |
} |
128 |
|
|
129 |
|
/** |
130 |
|
* Narrow the given object to the NamingContextExt. No type-checking is |
131 |
|
* performed to verify that the object actually supports the requested type. |
132 |
|
* The {@link BAD_OPERATION} will be thrown if unsupported operations are |
133 |
|
* invoked on the new returned reference, but no failure is expected at the |
134 |
|
* time of the unchecked_narrow. |
135 |
|
* |
136 |
|
* @param obj the object to cast. |
137 |
|
* |
138 |
|
* @return the casted NamingContextExt |
139 |
|
* |
140 |
|
* @since 1.5 |
141 |
|
* |
142 |
|
* @see OMG issue 4158. |
143 |
|
*/ |
144 |
|
public static NamingContextExt unchecked_narrow(org.omg.CORBA.Object obj) |
145 |
|
{ |
146 |
|
if (obj == null) |
147 |
|
return null; |
148 |
|
else if (obj instanceof NamingContextExt) |
149 |
|
return (NamingContextExt) obj; |
150 |
|
else |
151 |
|
{ |
152 |
|
// Do not call the _is_a(..). |
153 |
|
Delegate delegate = ((ObjectImpl) obj)._get_delegate(); |
154 |
|
return new _NamingContextExtStub(delegate); |
155 |
|
} |
156 |
|
} |
157 |
|
|
158 |
/** |
/** |
159 |
* Read the extended naming context from the given CDR input stream. |
* Read the extended naming context from the given CDR input stream. |