KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > protocol > JIDLLocalCRDImpl


1 /*
2  * @(#)JIDLLocalCRDImpl.java 1.15 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.protocol;
9
10 import javax.rmi.CORBA.Tie JavaDoc;
11
12 import org.omg.CORBA.portable.ServantObject JavaDoc;
13
14 import com.sun.corba.se.spi.orb.ORB ;
15
16 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
17 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ;
18
19 import com.sun.corba.se.spi.ior.IOR ;
20
21 import com.sun.corba.se.impl.protocol.LocalClientRequestDispatcherBase ;
22
23 import com.sun.corba.se.pept.broker.Broker;
24
25 public class JIDLLocalCRDImpl extends LocalClientRequestDispatcherBase
26 {
27     public JIDLLocalCRDImpl( ORB orb, int scid, IOR ior )
28     {
29     super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
30     }
31
32     protected ServantObject JavaDoc servant;
33
34     public ServantObject JavaDoc servant_preinvoke(org.omg.CORBA.Object JavaDoc self,
35                        String JavaDoc operation,
36                        Class JavaDoc expectedType)
37     {
38     if (!checkForCompatibleServant( servant, expectedType ))
39         return null ;
40
41     return servant;
42     }
43
44     public void servant_postinvoke( org.omg.CORBA.Object JavaDoc self,
45     ServantObject JavaDoc servant )
46     {
47     // NO-OP
48
}
49
50     // REVISIT - This is called from TOAImpl.
51
public void setServant( java.lang.Object JavaDoc servant )
52     {
53     if (servant != null && servant instanceof Tie JavaDoc) {
54         this.servant = new ServantObject JavaDoc();
55         this.servant.servant = ((Tie JavaDoc)servant).getTarget();
56     } else {
57         this.servant = null;
58     }
59     }
60
61     public void unexport() {
62     // DO NOT set the IOR to null. (Un)exporting is only concerns
63
// the servant not the IOR. If the ior is set to null then
64
// null pointer exceptions happen during an colocated invocation.
65
// It is better to let the invocation proceed and get OBJECT_NOT_EXIST
66
// from the server side.
67
//ior = null;
68
servant = null;
69     }
70 }
71
72 // End of file.
73
Popular Tags