1. /*
  2. * @(#)LocalClientRequestDispatcher.java 1.6 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. package com.sun.corba.se.spi.protocol;
  8. import org.omg.CORBA.portable.ServantObject;
  9. /**
  10. * @author Harold Carr
  11. */
  12. public interface LocalClientRequestDispatcher
  13. {
  14. public boolean useLocalInvocation(org.omg.CORBA.Object self);
  15. public boolean is_local(org.omg.CORBA.Object self);
  16. /**
  17. * Returns a Java reference to the servant which should be used for this
  18. * request. servant_preinvoke() is invoked by a local stub.
  19. * If a ServantObject object is returned, then its servant field
  20. * has been set to an object of the expected type (Note: the object may
  21. * or may not be the actual servant instance). The local stub may cast
  22. * the servant field to the expected type, and then invoke the operation
  23. * directly.
  24. *
  25. * @param self The object reference which delegated to this delegate.
  26. *
  27. * @param operation a string containing the operation name.
  28. * The operation name corresponds to the operation name as it would be
  29. * encoded in a GIOP request.
  30. *
  31. * @param expectedType a Class object representing the expected type of the servant.
  32. * The expected type is the Class object associated with the operations
  33. * class of the stub's interface (e.g. A stub for an interface Foo,
  34. * would pass the Class object for the FooOperations interface).
  35. *
  36. * @return a ServantObject object.
  37. * The method may return a null value if it does not wish to support
  38. * this optimization (e.g. due to security, transactions, etc).
  39. * The method must return null if the servant is not of the expected type.
  40. */
  41. public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
  42. String operation,
  43. Class expectedType);
  44. public void servant_postinvoke(org.omg.CORBA.Object self,
  45. ServantObject servant);
  46. }
  47. // End of file.