1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.6.0_24) on Sat Jul 02 13:18:19 PDT 2011 -->
10 <META NAME="date" CONTENT="2011-07-02">
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
14 <SCRIPT type="text/javascript">
15 function windowTitle()
17 if (location.href.indexOf('is-external=true') == -1) {
18 parent.document.title="PythonVM";
27 <BODY BGCOLOR="white" onload="windowTitle();">
31 <!-- ========= START OF TOP NAVBAR ======= -->
32 <A NAME="navbar_top"><!-- --></A>
33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37 <A NAME="navbar_top_firstrow"><!-- --></A>
38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39 <TR ALIGN="center" VALIGN="top">
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/apache/jcc/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
41 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
49 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
55 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
56 <A HREF="../../../org/apache/jcc/PythonException.html" title="class in org.apache.jcc"><B>PREV CLASS</B></A>
57 NEXT CLASS</FONT></TD>
58 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
59 <A HREF="../../../index.html?org/apache/jcc/PythonVM.html" target="_top"><B>FRAMES</B></A>
60 <A HREF="PythonVM.html" target="_top"><B>NO FRAMES</B></A>
61 <SCRIPT type="text/javascript">
64 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
69 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
82 <A NAME="skip-navbar_top"></A>
83 <!-- ========= END OF TOP NAVBAR ========= -->
86 <!-- ======== START OF CLASS DATA ======== -->
94 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.apache.jcc.PythonVM</B>
98 <DT><PRE>public class <B>PythonVM</B><DT>extends java.lang.Object</DL>
105 <!-- =========== FIELD SUMMARY =========== -->
107 <A NAME="field_summary"><!-- --></A>
108 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
109 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
110 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
111 <B>Field Summary</B></FONT></TH>
113 <TR BGCOLOR="white" CLASS="TableRowColor">
114 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
115 <CODE>protected static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A></CODE></FONT></TD>
116 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#vm">vm</A></B></CODE>
119 </TD>
123 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
125 <A NAME="constructor_summary"><!-- --></A>
126 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
127 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
128 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
129 <B>Constructor Summary</B></FONT></TH>
131 <TR BGCOLOR="white" CLASS="TableRowColor">
132 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
133 <CODE>protected </CODE></FONT></TD>
134 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#PythonVM()">PythonVM</A></B>()</CODE>
137 </TD>
141 <!-- ========== METHOD SUMMARY =========== -->
143 <A NAME="method_summary"><!-- --></A>
144 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
145 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
146 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
147 <B>Method Summary</B></FONT></TH>
149 <TR BGCOLOR="white" CLASS="TableRowColor">
150 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
151 <CODE> int</CODE></FONT></TD>
152 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#acquireThreadState()">acquireThreadState</A></B>()</CODE>
155 Bump the Python thread state counter.</TD>
157 <TR BGCOLOR="white" CLASS="TableRowColor">
158 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
159 <CODE>static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A></CODE></FONT></TD>
160 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#get()">get</A></B>()</CODE>
163 Obtain the PythonVM instance, or null if the Python VM
164 has not yet been started.</TD>
166 <TR BGCOLOR="white" CLASS="TableRowColor">
167 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
168 <CODE>protected void</CODE></FONT></TD>
169 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#init(java.lang.String, java.lang.String[])">init</A></B>(java.lang.String programName,
170 java.lang.String[] args)</CODE>
173 </TD>
175 <TR BGCOLOR="white" CLASS="TableRowColor">
176 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
177 <CODE> java.lang.Object</CODE></FONT></TD>
178 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#instantiate(java.lang.String, java.lang.String)">instantiate</A></B>(java.lang.String moduleName,
179 java.lang.String className)</CODE>
182 Instantiate the specified Python class, and return the instance.</TD>
184 <TR BGCOLOR="white" CLASS="TableRowColor">
185 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
186 <CODE> int</CODE></FONT></TD>
187 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#releaseThreadState()">releaseThreadState</A></B>()</CODE>
190 Release the Python thread state counter.</TD>
192 <TR BGCOLOR="white" CLASS="TableRowColor">
193 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
194 <CODE>static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A></CODE></FONT></TD>
195 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#start(java.lang.String)">start</A></B>(java.lang.String programName)</CODE>
198 Start the embedded Python interpreter.</TD>
200 <TR BGCOLOR="white" CLASS="TableRowColor">
201 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
202 <CODE>static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A></CODE></FONT></TD>
203 <TD><CODE><B><A HREF="../../../org/apache/jcc/PythonVM.html#start(java.lang.String, java.lang.String[])">start</A></B>(java.lang.String programName,
204 java.lang.String[] args)</CODE>
207 Start the embedded Python interpreter.</TD>
210 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
211 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
212 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
213 <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
215 <TR BGCOLOR="white" CLASS="TableRowColor">
216 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
222 <!-- ============ FIELD DETAIL =========== -->
224 <A NAME="field_detail"><!-- --></A>
225 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
226 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
227 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
228 <B>Field Detail</B></FONT></TH>
232 <A NAME="vm"><!-- --></A><H3>
235 protected static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A> <B>vm</B></PRE>
241 <!-- ========= CONSTRUCTOR DETAIL ======== -->
243 <A NAME="constructor_detail"><!-- --></A>
244 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
245 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
246 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
247 <B>Constructor Detail</B></FONT></TH>
251 <A NAME="PythonVM()"><!-- --></A><H3>
254 protected <B>PythonVM</B>()</PRE>
258 <!-- ============ METHOD DETAIL ========== -->
260 <A NAME="method_detail"><!-- --></A>
261 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
262 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
263 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
264 <B>Method Detail</B></FONT></TH>
268 <A NAME="start(java.lang.String, java.lang.String[])"><!-- --></A><H3>
271 public static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A> <B>start</B>(java.lang.String programName,
272 java.lang.String[] args)</PRE>
274 <DD>Start the embedded Python interpreter. The specified
275 program name and args are set into the Python variable sys.argv.
276 This returns an instance of the Python VM; it may be called
277 multiple times, and will return the same VM instance each time.
280 <DT><B>Parameters:</B><DD><CODE>programName</CODE> - the name of the Python program, typically
281 /usr/bin/python. This is informational; the program is not
282 actually executed.<DD><CODE>args</CODE> - additional arguments to be put into sys.argv.
283 <DT><B>Returns:</B><DD>a singleton instance of PythonVM</DL>
288 <A NAME="start(java.lang.String)"><!-- --></A><H3>
291 public static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A> <B>start</B>(java.lang.String programName)</PRE>
293 <DD>Start the embedded Python interpreter. The specified
294 program name is set into the Python variable sys.argv[0].
295 This returns an instance of the Python VM; it may be called
296 multiple times, and will return the same VM instance each time.
299 <DT><B>Parameters:</B><DD><CODE>programName</CODE> - the name of the Python program, typically
300 /usr/bin/python. This is informational; the program is not
302 <DT><B>Returns:</B><DD>a singleton instance of PythonVM</DL>
307 <A NAME="get()"><!-- --></A><H3>
310 public static <A HREF="../../../org/apache/jcc/PythonVM.html" title="class in org.apache.jcc">PythonVM</A> <B>get</B>()</PRE>
312 <DD>Obtain the PythonVM instance, or null if the Python VM
313 has not yet been started.
317 <DT><B>Returns:</B><DD>a singleton instance of PythonVM, or null</DL>
322 <A NAME="init(java.lang.String, java.lang.String[])"><!-- --></A><H3>
325 protected void <B>init</B>(java.lang.String programName,
326 java.lang.String[] args)</PRE>
334 <A NAME="instantiate(java.lang.String, java.lang.String)"><!-- --></A><H3>
337 public java.lang.Object <B>instantiate</B>(java.lang.String moduleName,
338 java.lang.String className)
339 throws <A HREF="../../../org/apache/jcc/PythonException.html" title="class in org.apache.jcc">PythonException</A></PRE>
341 <DD>Instantiate the specified Python class, and return the instance.
344 <DT><B>Parameters:</B><DD><CODE>moduleName</CODE> - the Python module the class is defined in<DD><CODE>className</CODE> - the Python class to instantiate.
345 <DT><B>Returns:</B><DD>a handle on the Python instance.
347 <DD><CODE><A HREF="../../../org/apache/jcc/PythonException.html" title="class in org.apache.jcc">PythonException</A></CODE></DL>
352 <A NAME="acquireThreadState()"><!-- --></A><H3>
353 acquireThreadState</H3>
355 public int <B>acquireThreadState</B>()</PRE>
357 <DD>Bump the Python thread state counter. Every thread should
358 do this before calling into Python, to prevent the Python
359 thread state from being inadvertently collected (and causing loss
360 of thread-local variables)
364 <DT><B>Returns:</B><DD>the Python thread state counter. A return value less
365 than zero signals an error.</DL>
370 <A NAME="releaseThreadState()"><!-- --></A><H3>
371 releaseThreadState</H3>
373 public int <B>releaseThreadState</B>()</PRE>
375 <DD>Release the Python thread state counter. Every thread that has
376 called acquireThreadState() should call this before
381 <DT><B>Returns:</B><DD>the Python thread state counter. A return value less
382 than zero signals an error.</DL>
385 <!-- ========= END OF CLASS DATA ========= -->
389 <!-- ======= START OF BOTTOM NAVBAR ====== -->
390 <A NAME="navbar_bottom"><!-- --></A>
391 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
392 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
394 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
395 <A NAME="navbar_bottom_firstrow"><!-- --></A>
396 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
397 <TR ALIGN="center" VALIGN="top">
398 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/apache/jcc/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
399 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
400 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
401 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
402 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
403 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
407 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
413 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
414 <A HREF="../../../org/apache/jcc/PythonException.html" title="class in org.apache.jcc"><B>PREV CLASS</B></A>
415 NEXT CLASS</FONT></TD>
416 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
417 <A HREF="../../../index.html?org/apache/jcc/PythonVM.html" target="_top"><B>FRAMES</B></A>
418 <A HREF="PythonVM.html" target="_top"><B>NO FRAMES</B></A>
419 <SCRIPT type="text/javascript">
422 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
427 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
434 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
435 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
436 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
437 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
440 <A NAME="skip-navbar_bottom"></A>
441 <!-- ======== END OF BOTTOM NAVBAR ======= -->