KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > core > PyProxy


1 // Copyright (c) Corporation for National Research Initiatives
2
package org.python.core;
3
4 /**
5  * Common methods for all generated proxy classes.
6  *
7  * Proxies classes are created whenever a python class inherit
8  * from a java class. Instances of such a python class consists
9  * of two objects
10  * <ul>
11  * <li>An instance of the proxy class. The _getPyInstance() will
12  * return a reference to the PyInstance.
13  * <li>An instance of PyInstance. The PyInstance.javaProxy contain
14  * a reference to the proxy class instance.
15  * </ul>
16  *
17  * All proxy classes, both dynamicly generated and staticly
18  * generated by jythonc implements this interface.
19  */

20
21 // This interface should be applicable to ANY class
22
// Choose names that are extremely unlikely to have conflicts
23
public interface PyProxy
24 {
25     /**
26      * Associate an PyInstance with this proxy instance.
27      * This is done during construction and initialization
28      * of the proxy instance.
29      */

30     abstract public void _setPyInstance(PyInstance proxy);
31
32     /**
33      * Return the associated PyInstance instance.
34      */

35     abstract public PyInstance _getPyInstance();
36
37     /**
38      * Associate an system state with this proxy instance.
39      * This is done during construction and initialization
40      * of the proxy instance.
41      */

42     abstract public void _setPySystemState(PySystemState ss);
43
44     /**
45      * Return the associated system state.
46      */

47     abstract public PySystemState _getPySystemState();
48
49     /**
50      * Initialize the proxy instance. If the proxy have not
51      * been initialized already, this call will call the
52      * python constructor with the auplied arguments.
53      * <p>
54      * In some situations is it necesary to call the __initProxy__
55      * method from the java superclass ctor before the ctor makes
56      * call to methods that is overriden in python.
57      * <p>
58      * In most sitation the __initProxy__ is called automticly
59      * by the jython runtime.
60      */

61     abstract public void __initProxy__(Object JavaDoc[] args);
62 }
63
Popular Tags