38 |
|
|
39 |
package org.omg.PortableServer; |
package org.omg.PortableServer; |
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.MARSHAL; |
import org.omg.CORBA.MARSHAL; |
110 |
catch (ClassCastException ex) |
catch (ClassCastException ex) |
111 |
{ |
{ |
112 |
BAD_OPERATION bad = new BAD_OPERATION(); |
BAD_OPERATION bad = new BAD_OPERATION(); |
113 |
|
bad.minor = Minor.ClassCast; |
114 |
bad.initCause(ex); |
bad.initCause(ex); |
115 |
throw bad; |
throw bad; |
116 |
} |
} |
117 |
} |
} |
118 |
|
|
119 |
|
/** |
120 |
|
* Narrow the given object to the ServantLocator. For the objects that are |
121 |
|
* always local, this operation does not differ from the ordinary |
122 |
|
* {@link #narrow} (ClassCastException will be thrown if narrowing something |
123 |
|
* different). |
124 |
|
* |
125 |
|
* @param obj the object to cast. |
126 |
|
* |
127 |
|
* @return the casted ServantLocator. |
128 |
|
* |
129 |
|
* @since 1.5 |
130 |
|
* |
131 |
|
* @see OMG issue 4158. |
132 |
|
*/ |
133 |
|
public static ServantLocator unchecked_narrow(org.omg.CORBA.Object obj) |
134 |
|
{ |
135 |
|
return narrow(obj); |
136 |
|
} |
137 |
|
|
138 |
/** |
/** |
139 |
* This should read the servant locator, but it cannot be transferred |
* This should read the servant locator, but it cannot be transferred |
147 |
*/ |
*/ |
148 |
public static ServantLocator read(InputStream input) |
public static ServantLocator read(InputStream input) |
149 |
{ |
{ |
150 |
throw new MARSHAL(); |
MARSHAL m = new MARSHAL("Inappropriate"); |
151 |
|
m.minor = Minor.Inappropriate; |
152 |
|
throw m; |
153 |
} |
} |
154 |
|
|
155 |
/** |
/** |
164 |
*/ |
*/ |
165 |
public static void write(OutputStream output, ServantLocator value) |
public static void write(OutputStream output, ServantLocator value) |
166 |
{ |
{ |
167 |
throw new MARSHAL(); |
MARSHAL m = new MARSHAL("Inappropriate"); |
168 |
|
m.minor = Minor.Inappropriate; |
169 |
|
throw m; |
170 |
} |
} |
171 |
} |
} |