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