ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/rzahateraspacemain.htm

114 lines
8.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Teraspace storage model native methods for Java" />
<meta name="abstract" content="The iSeries Java virtual machine (JVM) now supports the use of teraspace storage model native methods. The teraspace storage model provides a large process-local address environment for ILE programs. Using teraspace allows you to port native method code from other operating systems to i5/OS with little or no source code changes." />
<meta name="description" content="The iSeries Java virtual machine (JVM) now supports the use of teraspace storage model native methods. The teraspace storage model provides a large process-local address environment for ILE programs. Using teraspace allows you to port native method code from other operating systems to i5/OS with little or no source code changes." />
<meta name="DC.Relation" scheme="URI" content="othlang.htm" />
<meta name="DC.Relation" scheme="URI" content="jni.htm" />
<meta name="DC.Relation" scheme="URI" content="rzahapaseexmplsmain.htm" />
<meta name="DC.Relation" scheme="URI" content="ilejava.htm" />
<meta name="DC.Relation" scheme="URI" content="javalang.htm" />
<meta name="DC.Relation" scheme="URI" content="interpro.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzahateraspacemain" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Teraspace storage model native methods for Java</title>
</head>
<body id="rzahateraspacemain"><a name="rzahateraspacemain"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Teraspace storage model native methods for Java</h1>
<div><p>The iSeries™ Java™ virtual
machine (JVM) now supports the use of teraspace storage model native methods.
The teraspace storage model provides a large process-local address environment
for ILE programs. Using teraspace allows you to port native method code from
other operating systems to <span class="keyword">i5/OS™</span> with
little or no source code changes.</p>
<p>For details about programming with the teraspace storage model, see the
following information:</p>
<blockquote> <p><a href="../books/sc415606.pdf" target="_blank">Chapter
4 of ILE Concepts</a> </p>
<p><a href="../books/sc092712.pdf" target="_blank">Chapter 17 of WebSphere<sup>®</sup> Development Studio ILE C/C++
Programmer's Guide</a> </p>
</blockquote>
<p>The concept for Java native methods created for the teraspace
storage model is very similar to that of native methods that use single-level
storage. The JVM passes the teraspace native methods a pointer to the Java Native
Interface (JNI) environment that the methods can use to call JNI functions.</p>
<p>For teraspace storage model native methods, the JVM provides JNI function
implementations that utilize teraspace storage model and 8-byte pointers.</p>
<div class="section"><h4 class="sectiontitle">Creating teraspace native methods</h4><p>To successfully
create a teraspace storage model native method, your teraspace module creation
command needs to use the following options:</p>
<pre> TERASPACE(*YES) STGMDL(*TERASPACE) DTAMDL(*LLP64)</pre>
<p>The
following option (<samp class="codeph">*TSIFC</samp>), to use teraspace storage functions,
is optional:</p>
<pre> TERASPACE(*YES *TSIFC)</pre>
<div class="note"><span class="notetitle">Note:</span> If
you do not use <samp class="codeph">DTAMDL(*LLP64)</samp> when using teraspace storage
model Java native
methods, calling a native method throws a runtime exception.</div>
</div>
<div class="section"><h4 class="sectiontitle">Creating teraspace service programs that use native methods</h4><p>In
order to create a teraspace storage model service program, use the following
option on the Create Service Program (CRTSRVPGM) control language (CL) command:</p>
<pre> CRTSRVPGM STGMDL(*TERASPACE)</pre>
<p>In
addition, you should use the <samp class="codeph">ACTGRP(*CALLER)</samp> option, which
allows the JVM to activate all teraspace storage model native method service
programs into the same teraspace activation group. Using a teraspace activation
group this way can be important for native methods to efficiently handle
exceptions.</p>
<p>For additional details on program activation and activation
groups, see the following information:</p>
<blockquote> <p><a href="../books/sc415606.pdf" target="_blank">Chapter 3 of ILE Concepts</a> </p>
</blockquote>
</div>
<div class="section"><h4 class="sectiontitle">Using Java Invocation APIs with teraspace native
methods</h4><p>Use the Invocation API GetEnv function when the JNI environment
pointer does not match the storage model of the service program. The Invocation
API GetEnv function always returns the correct JNI environment pointer. For
more information, see the following pages:</p>
<blockquote> <p><a href="invocapi.htm">Java Invocation
API</a></p>
<p><a href="javaapi/guide/jni/jni-12.html" target="_blank">JNI Enhancements</a></p>
</blockquote>
<p>The JVM supports both
single-level and teraspace storage model native methods, but the two storage
models use different JNI environments. Because the two storage models use
different JNI environments, do not pass the JNI environment pointer as
a parameter between native methods in the two storage models.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="othlang.htm" title="With Java, you have multiple ways to call code that was written in languages other than Java.">Java with other programming languages</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rzahapaseexmplsmain.htm" title="The iSeries Java virtual machine (JVM) supports the use of native methods running in the i5/OS PASE environment. Prior to V5R2, the native iSeries JVM used only ILE native methods.">IBM i5/OS PASE native methods for Java</a></div>
<div><a href="ilejava.htm" title="The Java environment on an iSeries server is separate from the integrated language environment (ILE). Java is not an ILE language, and it cannot bind to ILE object modules to create programs or service programs on an iSeries server.">Comparison of Integrated Language Environment and Java</a></div>
<div><a href="javalang.htm" title="Use the java.lang.Runtime.exec method to call programs or commands from within your Java program. Using java.lang.Runtime.exec() method creates one or more additional thread-enabled jobs. The additional jobs process the command string that you pass on the method.">Use java.lang.Runtime.exec()</a></div>
<div><a href="interpro.htm" title="When communicating with programs that are running in another process, there are a number of options.">Interprocess communications</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="jni.htm" title="You should only use native methods in cases where pure Java cannot meet your programming needs.">Use the Java Native Interface for native methods</a></div>
</div>
</div>
</body>
</html>