KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)FullServantCacheLocalCRDImpl.java 1.20 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
9 package com.sun.corba.se.impl.protocol;
10
11 import org.omg.CORBA.portable.ServantObject JavaDoc ;
12
13 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
14 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ;
15
16 import com.sun.corba.se.spi.orb.ORB ;
17
18 import com.sun.corba.se.spi.oa.OAInvocationInfo ;
19 import com.sun.corba.se.spi.oa.OADestroyed ;
20
21 import com.sun.corba.se.spi.ior.IOR;
22
23 import com.sun.corba.se.spi.logging.CORBALogDomains;
24
25 import com.sun.corba.se.impl.logging.POASystemException ;
26
27 public class FullServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase
28 {
29     public FullServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior )
30     {
31     super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
32     }
33
34     public ServantObject JavaDoc servant_preinvoke( org.omg.CORBA.Object JavaDoc self,
35     String JavaDoc operation, Class JavaDoc expectedType )
36     {
37     OAInvocationInfo cachedInfo = getCachedInfo() ;
38     if (!checkForCompatibleServant( cachedInfo, expectedType ))
39         return null ;
40
41     // Note that info is shared across multiple threads
42
// using the same subcontract, each of which may
43
// have its own operation. Therefore we need to clone it.
44
OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
45     orb.pushInvocationInfo( info ) ;
46
47     try {
48         info.oa().enter() ;
49     } catch (OADestroyed pdes) {
50         throw wrapper.preinvokePoaDestroyed( pdes ) ;
51     }
52
53     return info ;
54     }
55
56     public void servant_postinvoke(org.omg.CORBA.Object JavaDoc self,
57                                    ServantObject JavaDoc servantobj)
58     {
59     OAInvocationInfo cachedInfo = getCachedInfo() ;
60     cachedInfo.oa().exit() ;
61     orb.popInvocationInfo() ;
62     }
63 }
64
Popular Tags