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. import java.rmi.*;
  7. /**
  8. * The EJBObject interface is extended by all enterprise Beans' remote
  9. * interfaces. An enterprise Bean's remote interface provides the remote
  10. * client view
  11. * of an EJB object. An enterprise Bean's remote interface defines
  12. * the business methods callable by a remote client.
  13. *
  14. * <p> The remote interface must
  15. * extend the javax.ejb.EJBObject interface, and define the enterprise Bean
  16. * specific business methods.
  17. *
  18. * <p> The enterprise Bean's remote interface is defined by the enterprise
  19. * Bean provider and implemented by the enterprise Bean container.
  20. */
  21. public interface EJBObject extends Remote {
  22. /**
  23. * Obtain the enterprise Bean's remote home interface. The remote home
  24. * interface defines the enterprise Bean's create, finder, remove,
  25. * and home business methods.
  26. *
  27. * @return A reference to the enterprise Bean's home interface.
  28. *
  29. * @exception RemoteException Thrown when the method failed due to a
  30. * system-level failure.
  31. */
  32. public EJBHome getEJBHome() throws RemoteException;
  33. /**
  34. * Obtain the primary key of the EJB object.
  35. *
  36. * <p> This method can be called on an entity bean. An attempt to invoke
  37. * this method on a session bean will result in RemoteException.
  38. *
  39. * @return The EJB object's primary key.
  40. */
  41. public Object getPrimaryKey() throws RemoteException;
  42. /**
  43. * Remove the EJB object.
  44. *
  45. * @exception RemoteException Thrown when the method failed due to a
  46. * system-level failure.
  47. *
  48. * @exception RemoveException The enterprise Bean or the container
  49. * does not allow destruction of the object.
  50. */
  51. public void remove() throws RemoteException, RemoveException;
  52. /**
  53. * Obtain a handle for the EJB object. The handle can be used at later
  54. * time to re-obtain a reference to the EJB object, possibly in a
  55. * different Java Virtual Machine.
  56. *
  57. * @return A handle for the EJB object.
  58. *
  59. * @exception RemoteException Thrown when the method failed due to a
  60. * system-level failure.
  61. */
  62. public Handle getHandle() throws RemoteException;
  63. /**
  64. * Test if a given EJB object is identical to the invoked EJB object.
  65. *
  66. * @param obj An object to test for identity with the invoked object.
  67. *
  68. * @return True if the given EJB object is identical to the invoked object,
  69. * false otherwise.
  70. *
  71. * @exception RemoteException Thrown when the method failed due to a
  72. * system-level failure.
  73. */
  74. boolean isIdentical(EJBObject obj) throws RemoteException;
  75. }