[libinline-java-perl] 74/398: *** empty log message ***
Jonas Smedegaard
dr at jones.dk
Thu Feb 26 11:42:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.55
in repository libinline-java-perl.
commit fb87f7763037b60e8f2bb36c22c7fa23ba24dc90
Author: patrick <>
Date: Fri Apr 20 19:58:41 2001 +0000
*** empty log message ***
---
Java.pod | 42 ++++++++++++++++++++++--------------------
Java/Array.pm | 18 ++++++++++++++++++
Java/Makefile.PL | 12 +++++++-----
README | 56 +++++++++++---------------------------------------------
t/05_arrays.t | 7 ++++++-
5 files changed, 64 insertions(+), 71 deletions(-)
diff --git a/Java.pod b/Java.pod
index 874a24f..3c602bc 100644
--- a/Java.pod
+++ b/Java.pod
@@ -118,10 +118,14 @@ behavior of C<Inline::Java>:
choices and the sugnature chosen.
Ex: WARN_METHOD_SELECT => 1
- USE_JNI:
- Enables the JNI (Java Native Interface) mode instead of the default
- client/server mode. This mode is still experimental.
- Ex: USE_JNI => 1
+ JNI:
+ Toggles the execution mode. The default is to use the client/server
+ mode. To use the JNI extension (you must have built it at install
+ time though. See README and README.JNI for more information), set
+ JNI to 1.
+ Note: This can also be set globally by setting the PERL_INLINE_JAVA_JNI
+ environment variable to 1.
+ Ex: JNI => 1
=head1 CLASSES AND OBJECTS
@@ -397,25 +401,23 @@ Java array reference obtained from elsewhere, you don't even need to cast:
$obj->{o} = $obj->{a} ;
-=head1 JNI (JAVA NATIVE INTERFACE)
+=head1 JNI vs CLIENT/SERVER MODES
-Starting in version 0.20, there has been some support for the JNI
-(Java Native Interface). This enables C<Inline::Java> to load the
-Java virtual machine as a shared object instead of running it as a
-stand-alone server. This brings a dramatic improvement in performance.
+Starting in version 0.20, it is possible to use the JNI (Java Native
+Interface) extension. This enables C<Inline::Java> to load the Java virtual
+machine as a shared object instead of running it as a stand-alone server.
+This brings a dramatic improvement in performance.
-To enable the JNI mode, you first must compile the JNI extension when
-you install the c<Inline::Java> module. See README for more information.
+However, the JNI extension is not available on all platforms (see README and
+README.JNI for more information). For that reason, if you have built the
+JNI extension, you must enable it explicitely by doing one of the following:
-Once you have built the JNI extension, you can enable the JNI mode
-by doing one of the following:
+ - set the JNI configuration option to 1
+ - set the PERL_INLINE_JAVA_JNI environment variable to 1
- - set the USE_JNI configuration option to any true value
- - set the PERL_INLINE_JAVA_USE_JNI environment variable to any true value
-
-Once JNI mode is enabled, your scripts will use create the Java virtual
-machine in their own memory space (using a shared object), instead of
-forking and running the Java virtual machine as a server.
+Note: C<Inline::Java> only creates one virtual machine instance. Therefore
+you can't use JNI for some sections and client/server for others. The first
+section determines the execution mode.
=head1 SUPPORTED PLATFORMS
@@ -423,7 +425,7 @@ This is an ALPHA release of Inline::Java. Further testing and
expanded support for other operating systems and platforms will be a
focus for future releases. It has been tested on:
- - Solaris 2.5.1 + Perl 5.6 + Java SDK 1.2.1
+ - Solaris 2.5.1 + Perl 5.6 + Java SDK 1.2.2
- Solaris 2.8 + Perl 5.6 + Java SDK 1.3.0
- Windows 2000 + Perl 5.6 + Java SDK 1.3.0
- Windows 95 + Perl 5.6 + Java SDK 1.2.2 (fix required in Makefile)
diff --git a/Java/Array.pm b/Java/Array.pm
index 9205c0f..8a7daf9 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -259,6 +259,24 @@ sub DELETE {
}
+sub EXTEND {
+ my $this = shift ;
+ my $count = shift ;
+
+ croak "Operation EXTEND not supported on Java array" ;
+}
+
+
+sub SPLICE {
+ my $this = shift ;
+ my $offset = shift ;
+ my $length = shift ;
+ my @LIST = @_ ;
+
+ croak "Operation SPLICE not supported on Java array" ;
+}
+
+
sub DESTROY {
my $this = shift ;
}
diff --git a/Java/Makefile.PL b/Java/Makefile.PL
index f3cc954..8056cf2 100644
--- a/Java/Makefile.PL
+++ b/Java/Makefile.PL
@@ -9,6 +9,7 @@ if (! defined($main::JNI_BUILD)){
$main::JNI_BUILD = 0 ;
}
+
my $JNI_BUILD = $main::JNI_BUILD ;
@@ -68,13 +69,14 @@ else{
}
-ExtUtils::MakeMaker::WriteMakefile(
+WriteMakefile(
NAME => 'Inline::Java::JNI',
VERSION_FROM => 'JNI.pm',
- INC => join(" ",
- "-I$java_include",
- "-I$java_include_os"
- ),
+ INC => (! $JNI_BUILD ? undef :
+ join(" ",
+ "-I$java_include",
+ "-I$java_include_os"
+ )),
LIBS => (! $JNI_BUILD ? undef :
[
"-L$java_lib -ljvm"
diff --git a/README b/README
index c0fffef..e341667 100644
--- a/README
+++ b/README
@@ -20,52 +20,17 @@ When run, this complete program prints:
Just Another Inline Hacker
+
-------------------------------------------------------------------------------
JNI (JAVA NATIVE INTERFACE) EXTENSION:
-When you do 'perl Makefile.PL', Makefile.PL will ask you if you want to
-build the JNI extension.
-
-The JNI extension that allows you to load the Java virtual machine as a
-shared object instead of running it as a separate process. Building the JNI
-extension does not force you to use it, it simply gives you that option.
-
-To use it, you must use the USE_JNI config option or the
-PERL_INLINE_JAVA_USE_JNI environment variable.
-
-The JNI extension has been built and tested on:
-- Solaris 2.5.1
-- Windows 2000
-- Windows 95
-
-Depending on your platform, the build is more or less complex:
-
-MSWin32:
-- Follow the instructions provided by Makefile.PL. Don't forget to add to
- your PATH the directory where jvm.dll is located.
-
-Solaris:
-- In order to get the JNI extension running on Solaris, you will
- most probably need to recompile Perl. At the end of the Perl
- configuration, you will be asked if you want to edit the config.sh
- file. Say 'yes' and look for the following lines:
-
- libs='...'
- Change this to:
- libs='-lthread ...'
-
- usemymalloc='...'
- Change this to:
- usemymalloc='n'
+Inline::Java now provides a JNI extension that allows you to load the Java
+virtual machine as shared object instead of running it as a separate process.
+This extension works without problems on MSWin32 systems, but requires
+rebuilding Perl on Solaris (and possibly in Linux as well) because of
+threading issues.
-- Then finish building Perl as usual.
-- Note: On my setup, 'make test' failed one test: pragma/warnings #179.
- But when I followed the instructions:
- ### Since most tests were successful, you have a good chance to
- ### get information with better granularity by running
- ### ./perl harness
- ### in directory ./t.
- all tests where successful.
+See README.JNI for more information on building the JNI extension.
-------------------------------------------------------------------------------
@@ -99,8 +64,8 @@ or in the PERL_INLINE_JAVA_BIN environment variable. 'make test' will remind you
if you don't do this.
Note 3: If you have built the JNI extension and want the test suite to use
-it, set the PERL_INLINE_JAVA_USE_JNI environment variable to a true value
-before running 'make test'.
+it, you will need to set the PERL_INLINE_JAVA_JNI environment variable to 1
+BEFORE running 'make test'.
-------------------------------------------------------------------------------
@@ -116,8 +81,9 @@ Inline::Java version 0.20 includes:
member variables.
+ Type casting is now available to force the selection of specific
method signatures.
-+ Optional JNI (Java Native Interface) extension improves performance
++ Optional JNI (Java Native Interface) extension improves performance and stability
dramatically.
++ Increased stability on Win32.
Inline::Java version 0.01 includes:
+ All classes and their public methods are exported to Perl, relative
diff --git a/t/05_arrays.t b/t/05_arrays.t
index 83fb70f..c505017 100644
--- a/t/05_arrays.t
+++ b/t/05_arrays.t
@@ -9,7 +9,7 @@ use Inline(
) ;
BEGIN {
- plan(tests => 36) ;
+ plan(tests => 40) ;
}
@@ -91,6 +91,11 @@ ok($t->_Object(["3", "3456", "cat"])->[2], 'cat') ;
eval {$t->_int(["3", [], "cat"])} ; ok($@, qr/Java array contains mixed types/) ;
eval {$t->_StringString([["3"], "string"])} ; ok($@, qr/Java array contains mixed types/) ;
+# Invalid operations on arrays.
+eval {@{$b} = ()} ; ok($@, qr/Operation CLEAR/) ;
+eval {pop @{$b}} ; ok($@, qr/Operation POP/) ;
+eval {shift @{$b}} ; ok($@, qr/Operation SHIFT/) ;
+eval {splice(@{$b}, 0, 1)} ; ok($@, qr/Operation SPLICE/) ;
__END__
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git
More information about the Pkg-perl-cvs-commits
mailing list