1 /*
   2  * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.corba.se.spi.protocol;
  27 
  28 import org.omg.CORBA.portable.ServantObject;
  29 
  30 /**
  31  * @author Harold Carr
  32  */
  33 
  34 public interface LocalClientRequestDispatcher
  35 {
  36     public boolean useLocalInvocation(org.omg.CORBA.Object self);
  37 
  38     public boolean is_local(org.omg.CORBA.Object self);
  39 
  40     /**
  41      * Returns a Java reference to the servant which should be used for this
  42      * request. servant_preinvoke() is invoked by a local stub.
  43      * If a ServantObject object is returned, then its servant field
  44      * has been set to an object of the expected type (Note: the object may
  45      * or may not be the actual servant instance). The local stub may cast
  46      * the servant field to the expected type, and then invoke the operation
  47      * directly.
  48      *
  49      * @param self The object reference which delegated to this delegate.
  50      *
  51      * @param operation a string containing the operation name.
  52      * The operation name corresponds to the operation name as it would be
  53      * encoded in a GIOP request.
  54      *
  55      * @param expectedType a Class object representing the expected type of the servant.
  56      * The expected type is the Class object associated with the operations
  57      * class of the stub's interface (e.g. A stub for an interface Foo,
  58      * would pass the Class object for the FooOperations interface).
  59      *
  60      * @return a ServantObject object.
  61      * The method may return a null value if it does not wish to support
  62      * this optimization (e.g. due to security, transactions, etc).
  63      * The method must return null if the servant is not of the expected type.
  64      */
  65     public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
  66                                            String operation,
  67                                            Class expectedType);
  68 
  69     public void servant_postinvoke(org.omg.CORBA.Object self,
  70                                    ServantObject servant);
  71 }
  72 
  73 // End of file.