1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.ejb;
  6. /**
  7. * The EJBLocalObject interface must be extended by all enterprise Beans' local
  8. * interfaces. An enterprise Bean's local interface provides the local client
  9. * view of an EJB object. An enterprise Bean's local interface defines
  10. * the business methods callable by local clients.
  11. *
  12. * <p> The enterprise Bean's local interface is defined by the enterprise
  13. * Bean provider and implemented by the enterprise Bean container.
  14. */
  15. public interface EJBLocalObject {
  16. /**
  17. * Obtain the enterprise Bean's local home interface. The local home
  18. * interface defines the enterprise Bean's create, finder, remove,
  19. * and home business methods that are available to local clients.
  20. *
  21. * @return A reference to the enterprise Bean's local home interface.
  22. *
  23. * @exception EJBException Thrown when the method failed due to a
  24. * system-level failure.
  25. *
  26. */
  27. public EJBLocalHome getEJBLocalHome() throws EJBException;
  28. /**
  29. * Obtain the primary key of the EJB local object.
  30. *
  31. * <p> This method can be called on an entity bean.
  32. * An attempt to invoke this method on a session Bean will result in
  33. * an EJBException.
  34. *
  35. * @return The EJB local object's primary key.
  36. *
  37. * @exception EJBException Thrown when the method failed due to a
  38. * system-level failure.
  39. *
  40. */
  41. public Object getPrimaryKey() throws EJBException;
  42. /**
  43. * Remove the EJB local object.
  44. *
  45. * @exception RemoveException The enterprise Bean or the container
  46. * does not allow destruction of the object.
  47. *
  48. * @exception EJBException Thrown when the method failed due to a
  49. * system-level failure.
  50. *
  51. */
  52. public void remove() throws RemoveException, EJBException;
  53. /**
  54. * Test if a given EJB local object is identical to the invoked EJB
  55. * local object.
  56. *
  57. * @param obj An object to test for identity with the invoked object.
  58. *
  59. * @return True if the given EJB local object is identical to the
  60. * invoked object, false otherwise.
  61. *
  62. *
  63. * @exception EJBException Thrown when the method failed due to a
  64. * system-level failure.
  65. *
  66. */
  67. boolean isIdentical(EJBLocalObject obj) throws EJBException;
  68. }