1. /*
  2. * @(#)AppletInitializer.java 1.8 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.beans;
  11. import java.applet.Applet;
  12. import java.beans.beancontext.BeanContext;
  13. /**
  14. * <p>
  15. * This interface is designed to work in collusion with java.beans.Beans.instantiate.
  16. * The interafce is intended to provide mechanism to allow the proper
  17. * initialization of JavaBeans that are also Applets, during their
  18. * instantiation by java.beans.Beans.instantiate().
  19. * </p>
  20. *
  21. * @see java.beans.Beans#instantiate
  22. *
  23. * @version 1.8, 02/02/00
  24. * @since 1.2
  25. *
  26. */
  27. public interface AppletInitializer {
  28. /**
  29. * <p>
  30. * If passed to the appropriate variant of java.beans.Beans.instantiate
  31. * this method will be called in order to associate the newly instantiated
  32. * Applet (JavaBean) with its AppletContext, AppletStub, and Container.
  33. * </p>
  34. * <p>
  35. * Conformant implementations shall:
  36. * <ol>
  37. * <li> Associate the newly instantiated Applet with the appropriate
  38. * AppletContext.
  39. *
  40. * <li> Instantiate an AppletStub() and associate that AppletStub with
  41. * the Applet via an invocation of setStub().
  42. *
  43. * <li> If BeanContext parameter is null, then it shall associate the
  44. * Applet with its appropriate Container by adding that Applet to its
  45. * Container via an invocation of add(). If the BeanContext parameter is
  46. * non-null, then it is the responsibility of the BeanContext to associate
  47. * the Applet with its Container during the subsequent invocation of its
  48. * addChildren() method.
  49. * </ol>
  50. * </p>
  51. *
  52. * @param The newly instantiated JavaBean
  53. * @param The BeanContext intended for this Applet, or null.
  54. */
  55. void initialize(Applet newAppletBean, BeanContext bCtxt);
  56. /**
  57. * <p>
  58. * Activate, and/or mark Applet active. Implementors of this interface
  59. * shall mark this Applet as active, and optionally invoke its start()
  60. * method.
  61. * </p>
  62. *
  63. * @param The newly instantiated JavaBean
  64. */
  65. void activate(Applet newApplet);
  66. }