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