53 |
import org.omg.CORBA.BAD_OPERATION; |
import org.omg.CORBA.BAD_OPERATION; |
54 |
import org.omg.CORBA.BAD_PARAM; |
import org.omg.CORBA.BAD_PARAM; |
55 |
import org.omg.CORBA.OBJECT_NOT_EXIST; |
import org.omg.CORBA.OBJECT_NOT_EXIST; |
56 |
|
import org.omg.CORBA.ORB; |
57 |
import org.omg.CORBA.Policy; |
import org.omg.CORBA.Policy; |
58 |
import org.omg.CORBA.PolicyError; |
import org.omg.CORBA.PolicyError; |
59 |
import org.omg.CORBA.portable.ObjectImpl; |
import org.omg.CORBA.portable.ObjectImpl; |
60 |
import org.omg.PortableInterceptor.PolicyFactory; |
import org.omg.PortableInterceptor.PolicyFactory; |
61 |
import org.omg.PortableServer.POA; |
import org.omg.PortableServer.POA; |
62 |
|
import org.omg.PortableServer.Servant; |
63 |
|
import org.omg.PortableServer.POAManagerPackage.State; |
64 |
import org.omg.PortableServer.POAPackage.InvalidPolicy; |
import org.omg.PortableServer.POAPackage.InvalidPolicy; |
65 |
|
|
66 |
import java.applet.Applet; |
import java.applet.Applet; |
255 |
super.set_parameters(para, props); |
super.set_parameters(para, props); |
256 |
registerInterceptors(props, para); |
registerInterceptors(props, para); |
257 |
} |
} |
258 |
|
|
259 |
|
/** |
260 |
|
* This method is called by RMI-IIOP {@link javax.rmi.Tie#orb(ORB)}, passing |
261 |
|
* <code>this</code> as parameter. The ORB will try to connect that tie as |
262 |
|
* one of its objects, if it is not already connected. If the wrapper is an |
263 |
|
* instance of Servant this method also activates the root poa (if not already |
264 |
|
* active). |
265 |
|
*/ |
266 |
|
public void set_delegate(java.lang.Object wrapper) |
267 |
|
{ |
268 |
|
if (wrapper instanceof org.omg.CORBA.Object) |
269 |
|
{ |
270 |
|
org.omg.CORBA.Object object = (org.omg.CORBA.Object) wrapper; |
271 |
|
if (connected_objects.getKey(object) == null) |
272 |
|
connect(object); |
273 |
|
} |
274 |
|
else if (wrapper instanceof Servant) |
275 |
|
{ |
276 |
|
Servant s = (Servant) wrapper; |
277 |
|
if (rootPOA.findServant(s) == null) |
278 |
|
try |
279 |
|
{ |
280 |
|
rootPOA.servant_to_reference(s); |
281 |
|
if (rootPOA.the_POAManager().get_state().value() == State._HOLDING) |
282 |
|
rootPOA.the_POAManager().activate(); |
283 |
|
} |
284 |
|
catch (Exception e) |
285 |
|
{ |
286 |
|
BAD_OPERATION bad = new BAD_OPERATION("Unable to connect " |
287 |
|
+ wrapper + " to " + this); |
288 |
|
throw bad; |
289 |
|
} |
290 |
|
} |
291 |
|
} |
292 |
|
|
293 |
} |
} |