KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)InfoOnlyServantCacheLocalCRDImpl.java 1.14 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.oa.OAInvocationInfo ;
14
15 import com.sun.corba.se.spi.orb.ORB ;
16
17 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
18 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ;
19
20 import com.sun.corba.se.spi.ior.IOR;
21
22 public class InfoOnlyServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase
23 {
24     public InfoOnlyServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior )
25     {
26     super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
27     }
28
29     public ServantObject JavaDoc servant_preinvoke( org.omg.CORBA.Object JavaDoc self,
30     String JavaDoc operation, Class JavaDoc expectedType )
31     {
32     OAInvocationInfo cachedInfo = getCachedInfo() ;
33     if (!checkForCompatibleServant( cachedInfo, expectedType ))
34         return null ;
35
36     // Note that info is shared across multiple threads
37
// using the same subcontract, each of which may
38
// have its own operation. Therefore we need to copy it.
39
OAInvocationInfo info = new OAInvocationInfo(cachedInfo, operation) ;
40     orb.pushInvocationInfo( info ) ;
41
42     return info ;
43     }
44
45     public void servant_postinvoke(org.omg.CORBA.Object JavaDoc self,
46                                    ServantObject JavaDoc servantobj)
47     {
48     orb.popInvocationInfo() ;
49     }
50 }
51
Popular Tags