KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > beans > AppletInitializer


1 /*
2  * @(#)AppletInitializer.java 1.12 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.beans;
9
10 import java.applet.Applet JavaDoc;
11
12 import java.beans.beancontext.BeanContext JavaDoc;
13
14 /**
15  * <p>
16  * This interface is designed to work in collusion with java.beans.Beans.instantiate.
17  * The interafce is intended to provide mechanism to allow the proper
18  * initialization of JavaBeans that are also Applets, during their
19  * instantiation by java.beans.Beans.instantiate().
20  * </p>
21  *
22  * @see java.beans.Beans#instantiate
23  *
24  * @version 1.12, 12/19/03
25  * @since 1.2
26  *
27  */

28
29
30 public interface AppletInitializer {
31
32     /**
33      * <p>
34      * If passed to the appropriate variant of java.beans.Beans.instantiate
35      * this method will be called in order to associate the newly instantiated
36      * Applet (JavaBean) with its AppletContext, AppletStub, and Container.
37      * </p>
38      * <p>
39      * Conformant implementations shall:
40      * <ol>
41      * <li> Associate the newly instantiated Applet with the appropriate
42      * AppletContext.
43      *
44      * <li> Instantiate an AppletStub() and associate that AppletStub with
45      * the Applet via an invocation of setStub().
46      *
47      * <li> If BeanContext parameter is null, then it shall associate the
48      * Applet with its appropriate Container by adding that Applet to its
49      * Container via an invocation of add(). If the BeanContext parameter is
50      * non-null, then it is the responsibility of the BeanContext to associate
51      * the Applet with its Container during the subsequent invocation of its
52      * addChildren() method.
53      * </ol>
54      * </p>
55      *
56      * @param newAppletBean The newly instantiated JavaBean
57      * @param bCtxt The BeanContext intended for this Applet, or
58      * null.
59      */

60
61     void initialize(Applet JavaDoc newAppletBean, BeanContext JavaDoc bCtxt);
62
63     /**
64      * <p>
65      * Activate, and/or mark Applet active. Implementors of this interface
66      * shall mark this Applet as active, and optionally invoke its start()
67      * method.
68      * </p>
69      *
70      * @param newApplet The newly instantiated JavaBean
71      */

72
73     void activate(Applet JavaDoc newApplet);
74 }
75
Popular Tags