1. /*
  2. * @(#)ActivationInstantiator.java 1.11 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.rmi.activation;
  11. import java.rmi.MarshalledObject;
  12. import java.rmi.Remote;
  13. import java.rmi.RemoteException;
  14. /**
  15. * An <code>ActivationInstantiator</code> is responsible for creating
  16. * instances of "activatable" objects. A concrete subclass of
  17. * <code>ActivationGroup</code> implements the <code>newInstance</code>
  18. * method to handle creating objects within the group.
  19. *
  20. * @author Ann Wollrath
  21. * @version 1.11, 02/02/00
  22. * @see ActivationGroup
  23. * @since 1.2
  24. */
  25. public interface ActivationInstantiator extends Remote {
  26. /**
  27. * The activator calls an instantiator's <code>newInstance</code>
  28. * method in order to recreate in that group an object with the
  29. * activation identifier, <code>id</code>, and descriptor,
  30. * <code>desc</code>. The instantiator is responsible for: <ul>
  31. *
  32. * <li> determining the class for the object using the descriptor's
  33. * <code>getClassName</code> method,
  34. *
  35. * <li> loading the class from the code location obtained from the
  36. * descriptor (using the <code>getLocation</code> method),
  37. *
  38. * <li> creating an instance of the class by invoking the special
  39. * "activation" constructor of the object's class that takes two
  40. * arguments: the object's <code>ActivationID</code>, and the
  41. * <code>MarshalledObject</code> containing object specific
  42. * initialization data, and
  43. *
  44. * <li> returning a MarshalledObject containing the stub for the
  45. * remote object it created <p>
  46. *
  47. * @param id the object's activation identifier
  48. * @param desc the object's descriptor
  49. * @return a marshalled object containing the serialized
  50. * representation of remote object's stub
  51. * @exception ActivationException if object activation fails
  52. * @exception RemoteException if remote call fails
  53. * @since 1.2
  54. */
  55. public MarshalledObject newInstance(ActivationID id, ActivationDesc desc)
  56. throws ActivationException, RemoteException;
  57. }