1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_java_vm_attach">
<refmeta>
<refentrytitle>java_vm_attach</refentrytitle>
<refmiscinfo>jvmpl</refmiscinfo>
</refmeta>
<refnamediv>
<refname>java_vm_attach</refname>
<refpurpose></refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_java_vm_attach">
<funcprototype id="fprot_java_vm_attach">
<funcdef><function>java_vm_attach</function></funcdef>
<paramdef>in <parameter>classpath</parameter> varchar</paramdef>
<paramdef><optional>in <parameter>vm_options</parameter> any</optional></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_java_vm_attach">
<title>Description</title>
<para>Ensures that the current working thread is attached to the Java VM.
It operates as follows:</para>
<itemizedlist>
<listitem>if the Java VM is not created it creates it.</listitem>
<listitem>if the java VM is running, but the current working thread is
not attached as a Java VM thread it attaches it.</listitem>
<listitem>if none of the above it returns.</listitem>
</itemizedlist>
<para>The <function>java_vm_attach()</function> function is called implicitly
in each of the other VSEs, and also when allocating, copying or deleting a
Virtuoso/PL reference to a Java VM object values.</para>
<para>If the Java VM is already initialized and the classpath is supplied
it will throw a SQL error. If the Java VM is not initialized, but it is
required to execute a statement the server will implicitly call
<computeroutput>java_vm_attach (NULL);</computeroutput>. The Virtuoso Java
VM integration binary works with JDK 1.2 and later.</para>
</refsect1>
<refsect1 id="params_java_vm_attach">
<title>Parameters</title>
<refsect2><title>classpath</title>
<para>The classpath string to be supplied to the Java VM. If classpath is
NULL the server OS environment variable CLASSPATH will be used instead.</para>
</refsect2>
<refsect2><title>vm_options</title>
<para>A vector of name/value pairs for the Java VM initialization
parameters. The format and values of the parameters is described in
the JNI Enhancements Introduced in version 1.2 of the JavaTM 2 SDK document -
the description of JNI_CreateJavaVM Invocation API function.</para>
</refsect2>
</refsect1>
<refsect1 id="examples_java_vm_attach">
<title>Examples</title>
<example id="ex_java_vm_attach"><title>Initializing the Java VM</title>
<para>This example initializes the Java VM by supplying a classpath of:
<computeroutput>CLASSPATH=/usr/local/virtuoso/classes:/usr/local/jakarta-tomcat-3.3.1/lib/tomcat.jar</computeroutput>
and sets the <computeroutput>tomcat.home</computeroutput> Java system
property to <computeroutput>/usr/local/jakarta-tomcat-3.3.1</computeroutput>
It is the equivalent of executing JDK/JRE 1.2 unix java tool using:
<computeroutput>java -cp /usr/local/virtuoso/classes:/usr/local/jakarta-tomcat-3.3.1/lib/tomcat.jar
-Dtomcat.home=/usr/local/jakarta-tomcat-3.3.1</computeroutput></para>
<screen><![CDATA[
java_vm_attach ('/usr/local/virtuoso/classes:/usr/local/jakarta-tomcat-3.3.1/lib/tomcat.jar',
vector ('-Dtomcat.home=/usr/local/jakarta-tomcat-3.3.1, 0);
]]></screen>
</example>
</refsect1>
<refsect1 id="seealso_java_vm_attach">
<title>See Also</title>
<para><link linkend="fn_java_call_method"><function>java_call_method()</function></link></para>
<para><link linkend="fn_java_set_property"><function>java_set_property()</function></link></para>
<para><link linkend="fn_java_get_property"><function>java_get_property()</function></link></para>
<para><link linkend="fn_java_load_class"><function>java_load_class()</function></link></para>
<para><link linkend="fn_java_new_object"><function>java_new_object()</function></link></para>
<para><link linkend="fn_java_vm_detach"><function>java_vm_detach()</function></link></para>
</refsect1>
</refentry>
|