1. /*
  2. * @(#)ServerSubcontract.java 1.30 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.core;
  8. import com.sun.corba.se.internal.ior.ObjectKey;
  9. /**
  10. * Server subcontract adds behavior on the server-side -- specifically
  11. * on the dispatch path. A single server subcontract instance serves
  12. * many server objects.
  13. */
  14. public interface ServerSubcontract {
  15. /**
  16. * Create an object reference given a servant and/or user-key.
  17. *
  18. * @param key the user key part of the ORB key
  19. * @param servant the server object (may be null)
  20. */
  21. public Object createObjref(byte[] key, Object servant);
  22. /**
  23. * Create an object reference given an IOR.
  24. *
  25. * @param ior the ior to create an objref for.
  26. */
  27. public Object createObjref(IOR ior) throws Exception;
  28. /**
  29. * Destroy the object reference.
  30. */
  31. public void destroyObjref(Object objref);
  32. /**
  33. * Dispatch to the server object and return its
  34. * response.
  35. *
  36. * dispatch() should catch all exceptions and convert
  37. * them to a ServerResponse.
  38. *
  39. */
  40. public ServerResponse dispatch(ServerRequest request);
  41. /**
  42. * Handle a locate request.
  43. */
  44. public IOR locate(ObjectKey key);
  45. /**
  46. * Lookup and return the servant corresponding to the ior
  47. */
  48. public Object getServant(IOR ior);
  49. /**
  50. * Return a boolean indicating whether or not a servant is supported
  51. */
  52. public boolean isServantSupported();
  53. /**
  54. * Get the parallel client subcontract class
  55. */
  56. public Class getClientSubcontractClass();
  57. /**
  58. * Set the subcontract ID assigned by the ORB for this
  59. * class.
  60. */
  61. void setId(int id);
  62. int getId() ;
  63. /**
  64. * Set the ORB instance that created this SC
  65. */
  66. void setOrb(ORB orb);
  67. }