[libinline-java-perl] 315/398: ok

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:18 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 6fc0e5654a7217327bd3da7fb6a12461bc263fb2
Author: patrick_leb <>
Date:   Tue Apr 20 18:00:08 2004 +0000

    ok
---
 CHANGES                                      |    3 +-
 Java.pm                                      |    2 +-
 Java.pod                                     | 1857 +++++++++++++-------------
 Java/Array.pm                                |    2 +-
 Java/Callback.pm                             |    2 +-
 Java/Class.pm                                |    2 +-
 Java/JNI.pm                                  |    2 +-
 Java/JVM.pm                                  |    2 +-
 Java/Makefile.PL                             |    6 +-
 Java/Object.pm                               |    2 +-
 Java/PerlInterpreter/Makefile.PL             |    5 +-
 Java/PerlInterpreter/PerlInterpreter.pod     |  171 +--
 Java/PerlInterpreter/t/02_perl_interpreter.t |    2 +
 Java/PerlNatives/PerlNatives.pm              |    2 +-
 Java/PerlNatives/PerlNatives.pod             |  225 ++--
 Java/Portable.pm                             |    6 +-
 Java/Protocol.pm                             |    2 +-
 META.yml                                     |    2 +-
 README                                       |    1 +
 t/pod_test.pl                                |   67 +-
 t/swing_callback.pl                          |    3 +-
 21 files changed, 1225 insertions(+), 1141 deletions(-)

diff --git a/CHANGES b/CHANGES
index 18cee1e..a31c178 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,8 +2,9 @@ Revision history for Perl extension Inline::Java
 ------------------------------------------------
 0.48  
     - Added PerlInterpreter: require/eval Perl code directly from Java
-	- Renamed PerlNatives stuff
+    - Renamed PerlNatives stuff
     - Split and updated documentation
+    - Applied JNI memory leak patch by Jeff Janes
 
 0.47  Sat Feb 14 10:00:00 EST 2004
     - Fixed bugs in portability code and added HPUX, AIX and Solaris specifics
diff --git a/Java.pm b/Java.pm
index 161d89b..c3bac5c 100644
--- a/Java.pm
+++ b/Java.pm
@@ -8,7 +8,7 @@ package Inline::Java ;
 use strict ;
 require 5.006 ;
 
-$Inline::Java::VERSION = '0.48_01' ;
+$Inline::Java::VERSION = '0.48_90' ;
 
 
 # DEBUG is set via the DEBUG config
diff --git a/Java.pod b/Java.pod
index f6ffe04..4593306 100644
--- a/Java.pod
+++ b/Java.pod
@@ -1,901 +1,966 @@
-=head1 NAME
-
-Inline::Java - Write Perl classes in Java.
-
-=head1 SYNOPSIS
-
-=for comment
-
-   use Inline Java => <<'END_OF_JAVA_CODE' ;
-      class Pod_alu {
-         public Pod_alu(){
-         }
-
-         public int add(int i, int j){
-            return i + j ;
-         }
-
-         public int subtract(int i, int j){
-            return i - j ;
-         }
-      }
-   END_OF_JAVA_CODE
-
-   my $alu = new Pod_alu() ;
-   print($alu->add(9, 16) . "\n") ; # prints 25
-   print($alu->subtract(9, 16) . "\n") ; # prints -7
-
-=for comment
-
-
-=head1 DESCRIPTION
-
-The C<Inline::Java> module allows you to put Java source code
-directly "inline" in a Perl script or module. A Java compiler
-is launched and the Java code is compiled. Then Perl asks the
-Java classes what public methods have been defined. These classes
-and methods are available to the Perl program as if they had been
-written in Perl.
-
-The process of interrogating the Java classes for public methods
-occurs the first time you run your Java code. The namespace is
-cached, and subsequent calls use the cached version.
-   Z<>
-
-
-=head1 USING THE Inline::Java MODULE
-
-C<Inline::Java> is driven by fundamentally the same idea as other
-C<Inline> language modules, like C<Inline::C> or C<Inline::CPP>.
-Because Java is both compiled and interpreted, the method of getting
-your code is different, but overall, using C<Inline::Java> is very similar
-to any other C<Inline> language module.
-
-This section will explain the different ways to C<use> Inline::Java.
-For more details on C<Inline>, see 'perldoc Inline'.
-
-B<Basic Usage>
-
-The most basic form for using C<Inline::Java> is:
-
-   use Inline Java => 'Java source code' ;
-
-Of course, you can use Perl's "here document" style of quoting to make
-the code slightly easier to read:
-
-   use Inline Java => <<'END';
-
-      Java source code goes here.
-
-   END
-
-The source code can also be specified as a filename, a subroutine
-reference (sub routine should return source code), or an array
-reference (array contains lines of source code). This information
-is detailed in 'perldoc Inline'.
-
-In order for C<Inline::Java> to function properly, it needs to know
-where to find a Java 2 SDK on your machine. This is done using one
-of the following techniques:
-
-   - set the J2SDK configuration option to the correct directory
-   - set the PERL_INLINE_JAVA_J2SDK environment variable to the
-     correct directory
-
-If none of these are specified, C<Inline::Java> will use the Java
-2 SDK that was specified a install time (see below).
-
-
-=head1 DEFAULT JAVA 2 SDK
-
-When C<Inline::Java> was installed, the path to the Java 2 SDK that was
-used was stored in a file called default_j2sdk.pl that resides with
-the C<Inline::Java> module. You can find this file by using the following
-command:
-
-    % perl -MInline::Java=j2sdk
-
-If you wish to permanently change the default Java 2 SDK that is used
-by C<Inline::Java>, edit this file and change the value found there.
-If you wish use a different Java 2 SDK temporarily, see the J2SDK
-configuration option described below.
-
-
-=head1 CONFIGURATION OPTIONS
-
-There are a number of configuration options that dictate the
-behavior of C<Inline::Java>:
-
-   J2SDK:
-      Specifies the path to your Java 2 SDK.
-	  Ex: J2SDK => '/my/java/2/sdk/path'
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls
-      make use of the same JVM.
-
-   PORT:
-      Specifies the starting port number for the server. If many
-      C<Inline::Java> blocks are declared, the port number is
-      incremented each time.
-      Default is 0 (next available port number).
-      Default for SHARED_JVM mode is 7890.
-      Ex: PORT => 4567
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls
-      make use of the same JVM.
-
-   STARTUP_DELAY:
-      Specifies the maximum number of seconds that the Perl script
-      will try to connect to the Java server. In other this is the
-      delay that Perl gives to the Java server to start.
-      Default is 15 seconds.
-      Ex: STARTUP_DELAY => 20
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls
-      make use of the same JVM.
-
-   CLASSPATH:
-      Adds the specified CLASSPATH. This CLASSPATH will only be available
-      threw the use classloader. To set the CLASSPATH globally, use the 
-      CLASSPATH environment variable.
-      Ex: CLASSPATH => '/my/other/java/classses'
-
-   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. 
-      Ex: JNI => 1
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls 
-      make use of the same JVM.
-
-   EXTRA_JAVA_ARGS:
-   EXTRA_JAVAC_ARGS:
-      Specify extra command line parameters to be passed to, respectively,  
-      the JVM and the Java compiler. Use with caution as some options may 
-      alter normal C<Inline::Java> behavior.
-      Ex: EXTRA_JAVA_ARGS => '-Xmx96m'
-      Note: EXTRA_JAVA_ARGS only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls 
-      make use of the same JVM.
-
-   EMBEDDED_JNI:
-      Same as JNI, except C<Inline::Java> expects the JVM to already be
-      loaded and to have loaded the Perl interpreter that is running the
-      script. This is an advanced feature that should only be need in
-      very specific circumstances.
-      Ex: EMBEDDED_JNI => 1
-      Note: The EMBEDDED_JNI option sets the JNI option.
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls 
-      make use of the same JVM.
-
-   SHARED_JVM:
-      This mode enables mutiple processes to share the same JVM. It was 
-      created mainly in order to be able to use C<Inline::Java> under 
-      mod_perl. 
-      Ex: SHARED_JVM => 1
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls 
-      make use of the same JVM.
-
-   PRIVATE:
-      In SHARED_JVM mode, makes every connection to the JVM use a different
-      classloader so that each connection is isolated from the others.
-      Ex: PRIVATE => 1
-      Note: This configuration option only has an effect on the first
-      'use Inline Java' call inside a Perl script, since all other calls
-      make use of the same JVM.
-
-   DEBUG:
-      Enables debugging info. Debugging now uses levels (1 through 5)
-      that (loosely) follow these definitions:
-        1 = Major program steps
-        2 = Object creation/destruction
-        3 = Method/member accesses + packet dumps
-        4 = Everything else
-        5 = Data structure dumps
-      Ex: DEBUG => 2
-
-   DEBUGGER:
-      Starts jdb, (the Java debugger) instead of the regular Java JVM.
-      This option will also cause the Java code to be compiled using the
-      '-g' switch for extra debugging information. EXTRA_JAVA_ARGS can
-      be used use to pass extra options to the debugger.
-      Ex: DEBUGGER => 1
-
-   WARN_METHOD_SELECT:
-      Throws a warning when C<Inline::Java> has to 'choose' between 
-      different method signatures. The warning states the possible 
-      choices and the signature chosen.
-      Ex: WARN_METHOD_SELECT => 1
-
-   STUDY:
-      Takes an array of Java classes that you wish to have 
-      C<Inline::Java> learn about so that you can use them inside Perl.
-      Ex: STUDY => ['java.lang.HashMap', 'my.class']
-
-   AUTOSTUDY:
-      Makes C<Inline::Java> automatically study unknown classes it
-      encounters them.
-      Ex: AUTOSTUDY => 1
-
-
-=head1 ENVIRONMENT VARIABLES
-
-Every configuration option listed above, with the exception of STUDY,
-can be specified using an environment variable named using the 
-following convention:
-
-   PERL_INLINE_JAVA_<option name>
-
-For example, your can specified the JNI option usng the 
-PERL_INLINE_JAVA_JNI environment variable. 
-
-Note that environment variables take precedence over options specified
-in the script itself.
-
-Under Win32, you can also use set the PERL_INLINE_JAVA_COMMAND_COM 
-environment variable to a true value to indicate that you are using 
-the command.com shell. However, C<Inline::Java> should normally be 
-able to determine this on its own.
-
-
-=head1 CLASSES AND OBJECTS
-
-Because Java is object oriented, any interface between Perl and Java
-needs to support Java classes adequately.
-
-Example: 
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      class Pod_1 {
-         String data = "data" ;
-         static String sdata = "static data" ;
-
-         public Pod_1(){
-         }
-
-         public String get_data(){
-            return data ;
-         }
-
-         public static String get_static_data(){
-            return sdata ;
-         }
-
-         public void set_data(String d){
-            data = d ;
-         }
-
-         private void priv(){
-         }
-      }
-   END
-
-   my $obj = new Pod_1 ;
-   print($obj->get_data() . "\n") ; # prints data
-   $obj->set_data("new data") ;
-   print($obj->get_data() . "\n") ; # prints new data
-
-=for comment
-
-C<Inline::Java> created a new namespace called C<main::Pod_1> and 
-created the following functions:
-
-   sub main::Pod_::new { ... }
-   sub main::Pod_::Pod_1 { ... }
-   sub main::Pod_::get_data { ... }
-   sub main::Pod_::get_sdata { ... }
-   sub main::Pod_::set_data { ... }
-   sub main::Pod_::DESTROY { ... }
-
-Note that only the public methods are exported to Perl. 
-
-Inner classes are also supported, you simply need to supply a reference
-to an outer class object as the first parameter of the constructor:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      class Pod_2 {
-         public Pod_2(){
-         }
-
-         public class Pod_2_Inner {
-            public String name = "Pod_2_Inner" ;
-
-            public Pod_2_Inner(){
-            }
-         }
-      }
-   END
-
-   my $obj = new Pod_2() ;
-   my $obj2 = new Pod_2::Pod_2_Inner($obj) ;
-   print($obj2->{name} . "\n") ; # prints Pod_2_Inner
-
-=for comment
-
-=head1 METHODS
-
-In the previous example we have seen how to call a method. You can also
-call static methods in the following manner:
-
-   print Pod_1->get_sdata() . "\n" ; # prints static data
-   # or
-   my $obj = new Pod_1() ;
-   print $obj->get_sdata() . "\n" ; # prints static data  
-
-You can pass any kind of Perl scalar or any Java object to a method. It
-will be automatically converted to the correct type:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      class Pod_3_arg {
-         public Pod_3_arg(){
-         }
-      }
-      class Pod_3 {
-         public int n ;
-
-         public Pod_3(int i, String j, Pod_3_arg k) {
-            n = i ;
-         }
-      }
-   END
-
-   my $obj = new Pod_3_arg() ;
-   my $obj2 = new Pod_3(5, "toto", $obj) ;
-   print($obj2->{n} . "\n") ; # prints 5
-
-=for comment
-
-will work fine. These objects can be of any type, even if these types
-are not known to C<Inline::Java>. This is also true for return types:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      import java.util.* ;
-
-      class Pod_4 {
-         public Pod_4(){
-         }
-
-         public HashMap get_hash(){
-            HashMap h = new HashMap() ;
-            h.put("key", "value") ;
-
-            return h ;
-         }
-
-         public String do_stuff_to_hash(HashMap h){
-           return (String)h.get("key") ;
-         }
-      }
-   END
-
-   my $obj = new Pod_4() ;
-   my $h = $obj->get_hash() ;
-   print($obj->do_stuff_to_hash($h) . "\n") ; # prints value
-
-=for comment
-
-Objects of types unknown to Perl can exist in the Perl space, you just 
-can't call any of their methods. See the STUDYING section for more
-information on how to tell C<Inline::Java> to learn about these classes.
-   Z<>
-
-
-=head1 MEMBER VARIABLES
-
-You can also access all public member variables (static or not) from Perl.
-As with method arguments, the types of these variables does not need to
-be known to Perl:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      import java.util.* ;
-
-      class Pod_5 {
-         public int i ;
-         public static HashMap hm ;
-
-         public Pod_5(){
-         }
-     }
-   END
-
-   my $obj = new Pod_5() ;
-   $obj->{i} = 2 ;
-   print($obj->{i} . "\n") ; # prints 2
-   my $hm1 = $obj->{hm} ; # instance way
-   my $hm2 = $Pod_4::hm ; # static way   
-
-=for comment
-
-Note: Watch out for typos when accessing members in the static fashion,
-'use strict' will not catch them since they have a package name...
-   Z<>
-
-
-=head1 ARRAYS
-
-You can also send, receive and modify arrays. This is done simply by
-using Perl lists:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      import java.util.* ;
-
-      class Pod_6 {
-         public int i[] = {5, 6, 7} ;
-
-         public Pod_6(){
-         }
-
-         public String [] f(String a[]){
-            return a ;
-         }
-
-         public String [][] f(String a[][]){
-            return a ;
-         }
-     }
-   END
-
-   my $obj = new Pod_6() ;
-   my $i_2 = $obj->{i}->[2] ; # 7
-   print($i_2 . "\n") ; # prints 7
-
-   my $a1 = $obj->f(["a", "b", "c"]) ; # String []
-   my $a2 = $obj->f([
-      ["00", "01"],
-      ["10", "11"],
-   ]) ; # String [][]
-   print($a2->[1]->[0] . "\n") ; # prints 10
-
-=for comment
-
-
-=head1 TYPE CASTING
-
-Sometimes when a class as many signatures for the same method,
-C<Inline::Java> will have to select one of the signatures based on
-the arguments that are passed:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      class Pod_7 {
-         public Pod_7(){
-         }
-
-         public String f(int i){
-            return "int" ;
-         }
-
-         public String f(char c){
-            return "char" ;
-         }
-      }
-   END
-
-   my $obj = new Pod_7() ;
-   print($obj->f('5') . "\n") ; # prints int
-
-=for comment
-
-In this case, C<Inline::Java> will call f(int i), because '5' is an integer.
-But '5' is a valid char as well. So to force the call of f(char c), do the 
-following:
-
-   use Inline::Java qw(cast) ;
-   $obj->f(cast('char', '5')) ;
-   # or
-   $obj->f(Inline::Java::cast('char', '5')) ;
-
-The cast function forces the selection of the matching signature. Note that
-the cast must match the argument type exactly. Casting to a class that
-extends the argument type will not work.
-
-Another case where type casting is need is when one wants to pass an array
-as a java.lang.Object:
-
-   use Inline Java => <<'END';
-      class Pod_8 {
-         public Object o ;
-         int a[] = {1, 2, 3} ;
-
-         public Pod_8() {
-         }
-      }
-   END
-
-   my $obj = new Pod_8() ;
-   $obj->{o} = [1, 2, 3] ;	# No!
-
-The reason why this will not work is simple. When C<Inline::Java> sees an
-array, it checks the Java type you are trying to match it against to validate
-the construction of your Perl list. But in this case, it can't validate
-the array because you're assigning it to an Object. You must use the 3 
-parameter version of the cast function to do this:
-
-   $obj->{o} = Inline::Java::cast(
-     "java.lang.Object", 
-     [1, 2, 3],
-     "[Ljava.lang.String;") ;
-
-This tells C<Inline::Java> to validate your Perl list as a String [], and 
-then cast it as an Object.
-
-Here is how to construct the array type representations:
-
-  [<type>  -> 1 dimensional <type> array
-  [[<type> -> 2 dimensional <type> array
-  ...
-
-  where <type> is one of:
-    B byte     S short     I int     J long  
-    F float    D double    C char    Z boolean
-
-    L<class>; array of <class> objects
-
-This is described in more detail in most Java books that talk about
-reflection.
-
-But you only need to do this if you have a Perl list. If you already have a
-Java array reference obtained from elsewhere, you don't even need to cast:
-
-   $obj->{o} = $obj->{a} ;
-
-
-=head1 EXCEPTIONS
-
-You can now (as of 0.31) catch exceptions as objects when they are thrown 
-from Java. To do this you use the regular Perl exception tools: eval and
-$@. A helper function named 'caught' is provided to help determine the
-type of the exception. Here is a example of a typical use:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      import java.util.* ;
-
-      class Pod_9 {
-         public Pod_9(boolean t) throws Exception {
-            if (t){
-               throw new Exception("ouch!") ;
-            }
-         }
-      }
-   END
-
-   use Inline::Java qw(caught) ;
-
-   eval {
-	   my $obj = new Pod_9(1) ;
-   } ;
-   if ($@){
-      if (caught("java.lang.Exception")){
-         my $msg = $@->getMessage() ;
-         print($msg . "\n") ; # prints ouch!
-      }
-      else{
-         # It wasn't a Java exception after all...
-         die $@ ;
-      }
-   }
-
-=for comment
-
-What's important to understand is that $@ actually contains a reference
-to the Throwable object that was thrown by Java. The getMessage() function
-is really a method of the java.lang.Exception class. So if Java is throwing
-a custom exception you have in your code, you will have access to that
-exception object's public methods just like any other Java object in
-C<Inline::Java>. It is also probably a good idea to undef $@ once you have
-treated a Java exception, or else the object still has a reference until
-$@ is reset by the next eval.
-   Z<>
-
-
-=head1 CALLBACKS
-
-See L<Inline::Java::Callbacks> for more information on making callbacks.
-
-
-=head1 STUDYING
-
-As of version 0.21, C<Inline::Java> can learn about other Java classes
-and use them just like the Java code you write inside your Perl script.
-In fact you are not even required to write Java code inside your Perl
-script anymore. Here's how to use the 'studying' function:
-
-=for comment
-
-   use Inline (
-      Java => 'STUDY',
-      STUDY => ['java.util.HashMap'],
-   ) ;
-
-   my $hm = new java::util::HashMap() ;
-   $hm->put("key", "value") ;
-   my $val = $hm->get("key") ;
-   print($val . "\n") ; # prints value
-
-=for comment
-
-If you do not wish to put any Java code inside you Perl script, you must
-use the string 'STUDY' as your code. This will skip the build section.
-
-You can also use the AUTOSTUDY option to tell C<Inline::Java> that you wish
-to study all classes that it comes across:
-
-=for comment
-
-   use Inline Java => <<'END', AUTOSTUDY => 1 ;
-      import java.util.* ;
-
-      class Pod_10 {
-         public Pod_10(){
-         }
-
-         public HashMap get_hm(){
-            HashMap hm = new HashMap() ;
-            return hm ;
-         }
-      }
-   END
-
-   my $obj = new Pod_10() ;
-   my $hm = $obj->get_hm() ;
-   $hm->put("key", "value") ;
-   my $val = $hm->get("key") ;
-   print($val . "\n") ; # prints value
-
-=for comment
-
-In this case C<Inline::Java> intercepts the return value of the get_hm()
-method, sees that it's of a type that it doesn't know about 
-(java.lang.HashMap), and immediately studies the class. After that call 
-the java::lang::HashMap class is available to use through Perl.
-
-In some cases you may not know which classes to study until runtime. In 
-these cases you can use the study_classes() function:
-
-=for comment
-
-   use Inline (
-      Java => 'STUDY',
-      STUDY => [],
-   ) ;
-   use Inline::Java qw(study_classes) ;
-
-   study_classes(['java.util.HashMap'], undef) ;
-   my $hm = new java::util::HashMap() ;
-   $hm->put("key", "value") ;
-   my $val = $hm->get("key") ;
-   print($val . "\n") ; # prints value
-
-=for comment
-
-The study_classes() function takes 2 arguments, a reference to an array of
-class names (like the STUDY configuration option) and the name of the 
-package in which to bind those classes. If the name of the package is 
-undefined, the classes will be bound to the current (caller) package.
-Note: You can only specify the names of packages in which you have 
-previously "used" C<Inline::Java>.
-   Z<>
-
-
-=head1 JNI vs CLIENT/SERVER MODES
-
-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 an improvement in performance.
-
-If you have built the JNI extension, you must enable it explicitely by doing
-one of the following:
-
-   - set the JNI configuration option to 1
-   - set the PERL_INLINE_JAVA_JNI environment variable to 1
-
-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.
-
-See README.JNI for more information about the JNI extension.
-   Z<>
-
-
-=head1 SHARED_JVM
-
-Starting with version 0.30, the C<Inline::Java> JVM can now be shared between
-multiple processes. The first process to start creates the JVM but does not 
-shut it down on exit. All other processes can then connect as needed to the JVM. 
-If any of these other processes where created by forking the parent process, 
-the Inline::Java->reconnect_JVM() function must be called in the child to get 
-a fresh connection to the JVM. Ex:
-
-=for comment
-
-   use Inline (
-      Java => <<'END',
-         class Pod_11 {
-            public static int i = 0 ;
-            public Pod_11(){
-               i++ ;
-            }
-         }
-   END
-      SHARED_JVM => 1,
-   ) ;
-
-   my $nb = 5 ;
-   for (my $i = 0 ; $i < $nb ; $i++){
-      if (! fork()){
-         Inline::Java::reconnect_JVM() ;
-         my $f = new Pod_11() ;
-         exit ;
-      }
-   }
-   sleep(5) ;
-
-   my $f = new Pod_11() ;
-   print($f->{i} . "\n") ; # prints 6
-
-=for comment
-
-Once this code was run, each of the 6 processes will have created a different 
-instance of the 't' class. Data can be shared between the processes by using 
-static members in the Java code.
-
-Note: The Java System.out stream is closed in SHARED_JVM mode.
-   Z<>
-
-
-=head1 USING Inline::Java IN A CGI
-
-If you want to use C<Inline::Java> in a CGI script, do the following:
-
-=for comment
-
-   use CGI ;
-   use Inline (
-      Java => <<'END',
-         class Pod_counter {
-            public static int cnt = 0 ;
-            public Pod_counter(){
-               cnt++ ;
-            }
-         }
-   END
-      SHARED_JVM => 1,
-      DIRECTORY => '/somewhere/your/web/server/can/write',
-   ) ;
-
-   my $c = new Pod_counter() ;
-   my $q = new CGI() ;
-   print 
-      $q->start_html() . 
-      "This page has been accessed " . $c->{cnt} . " times." .
-      $q->end_html() ;
-
-=for comment
-
-In this scenario, the first CGI to execute will start the JVM, but does
-not shut it down on exit. Subsequent CGI, since they have the SHARED_JVM
-option enabled, will try to connect to the already existing JVM before
-trying to start a new one. Therefore if the JVM happens to crash or is
-killed, the next CGI that runs will start a new one. The JVM will be
-killed when Apache is shut down.
-   Z<>
-
-
-=head1 USING Inline::Java UNDER MOD_PERL
-
-Here is an example of how to use C<Inline::Java> under mod_perl:
-
-   use Apache::Constants ;
-   use Inline (
-      Java => <<'END',
-         class Pod_counter {
-            public static int cnt = 0 ;
-            public Pod_counter(){
-               cnt++ ;
-            }
-         }
-   END
-      SHARED_JVM => 1,
-      DIRECTORY => '/somewhere/your/web/server/can/write',
-   ) ;
-
-   my $c = new Pod_counter() ;
-
-   sub handler {
-      my $r = shift ;
-
-      my $q = new CGI ;
-      print
-         $q->start_html() .
-         "This page has been accessed " . $c->{cnt} . " times." .
-         $q->end_html() ;
-
-      return Apache::Constants::OK() ;
-   }
-
-See USING Inline::Java IN A CGI for more details.
-   Z<>
-
-
-=head1 BUGS AND DEFICIENCIES
-
-When reporting a bug, please do the following:
-
- - Put "use Inline REPORTBUG;" at the top of your code, or
-   use the command line option "perl -MInline=REPORTBUG ...".
- - Run your code.
- - Follow the printed instructions.
-
-Here are some things to watch out for:
-
-=over 4
-
-=item 1
-
-You shouldn't name any of your classes 'B', 'S', 'I', 'J', 'F', 'D',
-'C', 'Z' or 'L'. These classes seem to be used internally by Java to
-represent the primitive types.
-
-=item 2
-
-If you upgrade C<Inline::Java> from a previous version, be sure to delete
-your _Inline directory so that C<Inline::Java>'s own Java classes get 
-rebuilt to match the Perl code.
-
+=head1 NAME
+
+Inline::Java - Write Perl classes in Java.
+
+=head1 SYNOPSIS
+
+=for comment
+
+   use Inline Java => <<'END_OF_JAVA_CODE' ;
+      class Pod_alu {
+         public Pod_alu(){
+         }
+
+         public int add(int i, int j){
+            return i + j ;
+         }
+
+         public int subtract(int i, int j){
+            return i - j ;
+         }
+      }
+   END_OF_JAVA_CODE
+
+   my $alu = new Pod_alu() ;
+   print($alu->add(9, 16) . "\n") ; # prints 25
+   print($alu->subtract(9, 16) . "\n") ; # prints -7
+
+=for comment
+
+
+=head1 DESCRIPTION
+
+The C<Inline::Java> module allows you to put Java source code
+directly "inline" in a Perl script or module. A Java compiler
+is launched and the Java code is compiled. Then Perl asks the
+Java classes what public methods have been defined. These classes
+and methods are available to the Perl program as if they had been
+written in Perl.
+
+The process of interrogating the Java classes for public methods
+occurs the first time you run your Java code. The namespace is
+cached, and subsequent calls use the cached version.
+   Z<>
+
+
+=head1 USING THE Inline::Java MODULE
+
+C<Inline::Java> is driven by fundamentally the same idea as other
+C<Inline> language modules, like C<Inline::C> or C<Inline::CPP>.
+Because Java is both compiled and interpreted, the method of getting
+your code is different, but overall, using C<Inline::Java> is very similar
+to any other C<Inline> language module.
+
+This section will explain the different ways to C<use> Inline::Java.
+For more details on C<Inline>, see 'perldoc Inline'.
+
+B<Basic Usage>
+
+The most basic form for using C<Inline::Java> is:
+
+   use Inline Java => 'Java source code' ;
+
+Of course, you can use Perl's "here document" style of quoting to make
+the code slightly easier to read:
+
+   use Inline Java => <<'END';
+
+      Java source code goes here.
+
+   END
+
+The source code can also be specified as a filename, a subroutine
+reference (sub routine should return source code), or an array
+reference (array contains lines of source code). This information
+is detailed in 'perldoc Inline'.
+
+In order for C<Inline::Java> to function properly, it needs to know
+where to find a Java 2 SDK on your machine. This is done using one
+of the following techniques:
+
+=over 4
+
+=item 1 
+
+Set the J2SDK configuration option to the correct directory
+
+=item 2 
+
+Set the PERL_INLINE_JAVA_J2SDK environment variable to the 
+correct directory
+
+=back
+
+
+If none of these are specified, C<Inline::Java> will use the Java
+2 SDK that was specified a install time (see below).
+
+
+=head1 DEFAULT JAVA 2 SDK
+
+When C<Inline::Java> was installed, the path to the Java 2 SDK that was
+used was stored in a file called default_j2sdk.pl that resides with
+the C<Inline::Java> module. You can find this file by using the following
+command:
+
+    % perl -MInline::Java=j2sdk
+
+If you wish to permanently change the default Java 2 SDK that is used
+by C<Inline::Java>, edit this file and change the value found there.
+If you wish use a different Java 2 SDK temporarily, see the J2SDK
+configuration option described below.
+
+Additionally, you can use the following command to get the list of directories
+that you should put in you shared library path when using the JNI extension:
+
+    % perl -MInline::Java=so_dirs
+
+
+=head1 CONFIGURATION OPTIONS
+
+There are a number of configuration options that dictate the
+behavior of C<Inline::Java>:
+
+=over 4
+
+=item J2SDK
+
+Specifies the path to your Java 2 SDK.
+
+   Ex: J2SDK => '/my/java/2/sdk/path'
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls
+make use of the same JVM.
+
+=item PORT
+
+Specifies the starting port number for the server. If many
+C<Inline::Java> blocks are declared, the port number is
+incremented each time. Default is 0 (next available port number),
+default for SHARED_JVM mode is 7890.
+
+   Ex: PORT => 4567
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls
+make use of the same JVM.
+
+=item STARTUP_DELAY
+
+Specifies the maximum number of seconds that the Perl script
+will try to connect to the Java server. In other this is the
+delay that Perl gives to the Java server to start. Default 
+is 15 seconds.
+
+   Ex: STARTUP_DELAY => 20
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls
+make use of the same JVM.
+
+=item CLASSPATH
+
+Adds the specified CLASSPATH. This CLASSPATH will only be available
+threw the use classloader. To set the CLASSPATH globally, use the 
+CLASSPATH environment variable.
+
+   Ex: CLASSPATH => '/my/other/java/classses'
+
+=item 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. 
+
+   Ex: JNI => 1
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls 
+make use of the same JVM.
+
+=item EXTRA_JAVA_ARGS, EXTRA_JAVAC_ARGS
+
+Specify extra command line parameters to be passed to, respectively,  
+the JVM and the Java compiler. Use with caution as some options may 
+alter normal C<Inline::Java> behavior.
+
+   Ex: EXTRA_JAVA_ARGS => '-Xmx96m'
+
+Note: EXTRA_JAVA_ARGS only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls 
+make use of the same JVM.
+
+=item EMBEDDED_JNI
+
+Same as JNI, except C<Inline::Java> expects the JVM to already be
+loaded and to have loaded the Perl interpreter that is running the
+script. This is an advanced feature that should only be need in
+very specific circumstances.
+
+   Ex: EMBEDDED_JNI => 1
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls 
+make use of the same JVM. Also, the EMBEDDED_JNI option automatically
+sets the JNI option.
+
+=item SHARED_JVM
+
+This mode enables mutiple processes to share the same JVM. It was 
+created mainly in order to be able to use C<Inline::Java> under 
+mod_perl. 
+
+   Ex: SHARED_JVM => 1
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls 
+make use of the same JVM.
+
+=item PRIVATE
+
+In SHARED_JVM mode, makes every connection to the JVM use a different
+classloader so that each connection is isolated from the others.
+
+   Ex: PRIVATE => 1
+
+Note: This configuration option only has an effect on the first
+'use Inline Java' call inside a Perl script, since all other calls
+make use of the same JVM.
+
+=item DEBUG
+
+Enables debugging info. Debugging now uses levels (1 through 5)
+that (loosely) follow these definitions:
+
+   1 = Major program steps
+   2 = Object creation/destruction
+   3 = Method/member accesses + packet dumps
+   4 = Everything else
+   5 = Data structure dumps
+
+   Ex: DEBUG => 2
+
+=item DEBUGGER
+
+Starts jdb, (the Java debugger) instead of the regular Java JVM.
+This option will also cause the Java code to be compiled using the
+'-g' switch for extra debugging information. EXTRA_JAVA_ARGS can
+be used use to pass extra options to the debugger.
+
+   Ex: DEBUGGER => 1
+
+=item WARN_METHOD_SELECT
+
+Throws a warning when C<Inline::Java> has to 'choose' between 
+different method signatures. The warning states the possible 
+choices and the signature chosen.
+
+   Ex: WARN_METHOD_SELECT => 1
+
+=item STUDY
+
+Takes an array of Java classes that you wish to have 
+C<Inline::Java> learn about so that you can use them inside Perl.
+
+   Ex: STUDY => ['java.lang.HashMap', 'my.class']
+
+=item AUTOSTUDY
+
+Makes C<Inline::Java> automatically study unknown classes it
+encounters them.
+
+   Ex: AUTOSTUDY => 1
+
+=back 
+
+
+=head1 ENVIRONMENT VARIABLES
+
+Every configuration option listed above, with the exception of STUDY,
+can be specified using an environment variable named using the 
+following convention:
+
+   PERL_INLINE_JAVA_<option name>
+
+For example, your can specified the JNI option usng the 
+PERL_INLINE_JAVA_JNI environment variable. 
+
+Note that environment variables take precedence over options specified
+in the script itself.
+
+Under Win32, you can also use set the PERL_INLINE_JAVA_COMMAND_COM 
+environment variable to a true value to indicate that you are using 
+the command.com shell. However, C<Inline::Java> should normally be 
+able to determine this on its own.
+
+
+=head1 CLASSES AND OBJECTS
+
+Because Java is object oriented, any interface between Perl and Java
+needs to support Java classes adequately.
+
+Example: 
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      class Pod_1 {
+         String data = "data" ;
+         static String sdata = "static data" ;
+
+         public Pod_1(){
+         }
+
+         public String get_data(){
+            return data ;
+         }
+
+         public static String get_static_data(){
+            return sdata ;
+         }
+
+         public void set_data(String d){
+            data = d ;
+         }
+
+         private void priv(){
+         }
+      }
+   END
+
+   my $obj = new Pod_1 ;
+   print($obj->get_data() . "\n") ; # prints data
+   $obj->set_data("new data") ;
+   print($obj->get_data() . "\n") ; # prints new data
+
+=for comment
+
+C<Inline::Java> created a new namespace called C<main::Pod_1> and 
+created the following functions:
+
+   sub main::Pod_::new { ... }
+   sub main::Pod_::Pod_1 { ... }
+   sub main::Pod_::get_data { ... }
+   sub main::Pod_::get_sdata { ... }
+   sub main::Pod_::set_data { ... }
+   sub main::Pod_::DESTROY { ... }
+
+Note that only the public methods are exported to Perl. 
+
+Inner classes are also supported, you simply need to supply a reference
+to an outer class object as the first parameter of the constructor:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      class Pod_2 {
+         public Pod_2(){
+         }
+
+         public class Pod_2_Inner {
+            public String name = "Pod_2_Inner" ;
+
+            public Pod_2_Inner(){
+            }
+         }
+      }
+   END
+
+   my $obj = new Pod_2() ;
+   my $obj2 = new Pod_2::Pod_2_Inner($obj) ;
+   print($obj2->{name} . "\n") ; # prints Pod_2_Inner
+
+=for comment
+
+=head1 METHODS
+
+In the previous example we have seen how to call a method. You can also
+call static methods in the following manner:
+
+   print Pod_1->get_sdata() . "\n" ; # prints static data
+   # or
+   my $obj = new Pod_1() ;
+   print $obj->get_sdata() . "\n" ; # prints static data  
+
+You can pass any kind of Perl scalar or any Java object to a method. It
+will be automatically converted to the correct type:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      class Pod_3_arg {
+         public Pod_3_arg(){
+         }
+      }
+      class Pod_3 {
+         public int n ;
+
+         public Pod_3(int i, String j, Pod_3_arg k) {
+            n = i ;
+         }
+      }
+   END
+
+   my $obj = new Pod_3_arg() ;
+   my $obj2 = new Pod_3(5, "toto", $obj) ;
+   print($obj2->{n} . "\n") ; # prints 5
+
+=for comment
+
+will work fine. These objects can be of any type, even if these types
+are not known to C<Inline::Java>. This is also true for return types:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      import java.util.* ;
+
+      class Pod_4 {
+         public Pod_4(){
+         }
+
+         public HashMap get_hash(){
+            HashMap h = new HashMap() ;
+            h.put("key", "value") ;
+
+            return h ;
+         }
+
+         public String do_stuff_to_hash(HashMap h){
+           return (String)h.get("key") ;
+         }
+      }
+   END
+
+   my $obj = new Pod_4() ;
+   my $h = $obj->get_hash() ;
+   print($obj->do_stuff_to_hash($h) . "\n") ; # prints value
+
+=for comment
+
+Objects of types unknown to Perl can exist in the Perl space, you just 
+can't call any of their methods. See the STUDYING section for more
+information on how to tell C<Inline::Java> to learn about these classes.
+   Z<>
+
+
+=head1 MEMBER VARIABLES
+
+You can also access all public member variables (static or not) from Perl.
+As with method arguments, the types of these variables does not need to
+be known to Perl:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      import java.util.* ;
+
+      class Pod_5 {
+         public int i ;
+         public static HashMap hm ;
+
+         public Pod_5(){
+         }
+     }
+   END
+
+   my $obj = new Pod_5() ;
+   $obj->{i} = 2 ;
+   print($obj->{i} . "\n") ; # prints 2
+   my $hm1 = $obj->{hm} ; # instance way
+   my $hm2 = $Pod_4::hm ; # static way   
+
+=for comment
+
+Note: Watch out for typos when accessing members in the static fashion,
+'use strict' will not catch them since they have a package name...
+   Z<>
+
+
+=head1 ARRAYS
+
+You can also send, receive and modify arrays. This is done simply by
+using Perl lists:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      import java.util.* ;
+
+      class Pod_6 {
+         public int i[] = {5, 6, 7} ;
+
+         public Pod_6(){
+         }
+
+         public String [] f(String a[]){
+            return a ;
+         }
+
+         public String [][] f(String a[][]){
+            return a ;
+         }
+     }
+   END
+
+   my $obj = new Pod_6() ;
+   my $i_2 = $obj->{i}->[2] ; # 7
+   print($i_2 . "\n") ; # prints 7
+
+   my $a1 = $obj->f(["a", "b", "c"]) ; # String []
+   my $a2 = $obj->f([
+      ["00", "01"],
+      ["10", "11"],
+   ]) ; # String [][]
+   print($a2->[1]->[0] . "\n") ; # prints 10
+
+=for comment
+
+
+=head1 TYPE CASTING
+
+Sometimes when a class as many signatures for the same method,
+C<Inline::Java> will have to select one of the signatures based on
+the arguments that are passed:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      class Pod_7 {
+         public Pod_7(){
+         }
+
+         public String f(int i){
+            return "int" ;
+         }
+
+         public String f(char c){
+            return "char" ;
+         }
+      }
+   END
+
+   my $obj = new Pod_7() ;
+   print($obj->f('5') . "\n") ; # prints int
+
+=for comment
+
+In this case, C<Inline::Java> will call f(int i), because '5' is an integer.
+But '5' is a valid char as well. So to force the call of f(char c), do the 
+following:
+
+   use Inline::Java qw(cast) ;
+   $obj->f(cast('char', '5')) ;
+   # or
+   $obj->f(Inline::Java::cast('char', '5')) ;
+
+The cast function forces the selection of the matching signature. Note that
+the cast must match the argument type exactly. Casting to a class that
+extends the argument type will not work.
+
+Another case where type casting is need is when one wants to pass an array
+as a java.lang.Object:
+
+   use Inline Java => <<'END';
+      class Pod_8 {
+         public Object o ;
+         int a[] = {1, 2, 3} ;
+
+         public Pod_8() {
+         }
+      }
+   END
+
+   my $obj = new Pod_8() ;
+   $obj->{o} = [1, 2, 3] ;	# No!
+
+The reason why this will not work is simple. When C<Inline::Java> sees an
+array, it checks the Java type you are trying to match it against to validate
+the construction of your Perl list. But in this case, it can't validate
+the array because you're assigning it to an Object. You must use the 3 
+parameter version of the cast function to do this:
+
+   $obj->{o} = Inline::Java::cast(
+     "java.lang.Object", 
+     [1, 2, 3],
+     "[Ljava.lang.String;") ;
+
+This tells C<Inline::Java> to validate your Perl list as a String [], and 
+then cast it as an Object.
+
+Here is how to construct the array type representations:
+
+  [<type>  -> 1 dimensional <type> array
+  [[<type> -> 2 dimensional <type> array
+  ...
+
+  where <type> is one of:
+    B byte     S short     I int     J long  
+    F float    D double    C char    Z boolean
+
+    L<class>; array of <class> objects
+
+This is described in more detail in most Java books that talk about
+reflection.
+
+But you only need to do this if you have a Perl list. If you already have a
+Java array reference obtained from elsewhere, you don't even need to cast:
+
+   $obj->{o} = $obj->{a} ;
+
+
+=head1 EXCEPTIONS
+
+You can now (as of 0.31) catch exceptions as objects when they are thrown 
+from Java. To do this you use the regular Perl exception tools: eval and
+$@. A helper function named 'caught' is provided to help determine the
+type of the exception. Here is a example of a typical use:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      import java.util.* ;
+
+      class Pod_9 {
+         public Pod_9(boolean t) throws Exception {
+            if (t){
+               throw new Exception("ouch!") ;
+            }
+         }
+      }
+   END
+
+   use Inline::Java qw(caught) ;
+
+   eval {
+	   my $obj = new Pod_9(1) ;
+   } ;
+   if ($@){
+      if (caught("java.lang.Exception")){
+         my $msg = $@->getMessage() ;
+         print($msg . "\n") ; # prints ouch!
+      }
+      else{
+         # It wasn't a Java exception after all...
+         die $@ ;
+      }
+   }
+
+=for comment
+
+What's important to understand is that $@ actually contains a reference
+to the Throwable object that was thrown by Java. The getMessage() function
+is really a method of the java.lang.Exception class. So if Java is throwing
+a custom exception you have in your code, you will have access to that
+exception object's public methods just like any other Java object in
+C<Inline::Java>. It is also probably a good idea to undef $@ once you have
+treated a Java exception, or else the object still has a reference until
+$@ is reset by the next eval.
+   Z<>
+
+
+=head1 CALLBACKS
+
+See L<Inline::Java::Callbacks> for more information on making callbacks.
+
+
+=head1 STUDYING
+
+As of version 0.21, C<Inline::Java> can learn about other Java classes
+and use them just like the Java code you write inside your Perl script.
+In fact you are not even required to write Java code inside your Perl
+script anymore. Here's how to use the 'studying' function:
+
+=for comment
+
+   use Inline (
+      Java => 'STUDY',
+      STUDY => ['java.util.HashMap'],
+   ) ;
+
+   my $hm = new java::util::HashMap() ;
+   $hm->put("key", "value") ;
+   my $val = $hm->get("key") ;
+   print($val . "\n") ; # prints value
+
+=for comment
+
+If you do not wish to put any Java code inside you Perl script, you must
+use the string 'STUDY' as your code. This will skip the build section.
+
+You can also use the AUTOSTUDY option to tell C<Inline::Java> that you wish
+to study all classes that it comes across:
+
+=for comment
+
+   use Inline Java => <<'END', AUTOSTUDY => 1 ;
+      import java.util.* ;
+
+      class Pod_10 {
+         public Pod_10(){
+         }
+
+         public HashMap get_hm(){
+            HashMap hm = new HashMap() ;
+            return hm ;
+         }
+      }
+   END
+
+   my $obj = new Pod_10() ;
+   my $hm = $obj->get_hm() ;
+   $hm->put("key", "value") ;
+   my $val = $hm->get("key") ;
+   print($val . "\n") ; # prints value
+
+=for comment
+
+In this case C<Inline::Java> intercepts the return value of the get_hm()
+method, sees that it's of a type that it doesn't know about 
+(java.lang.HashMap), and immediately studies the class. After that call 
+the java::lang::HashMap class is available to use through Perl.
+
+In some cases you may not know which classes to study until runtime. In 
+these cases you can use the study_classes() function:
+
+=for comment
+
+   use Inline (
+      Java => 'STUDY',
+      STUDY => [],
+   ) ;
+   use Inline::Java qw(study_classes) ;
+
+   study_classes(['java.util.HashMap'], undef) ;
+   my $hm = new java::util::HashMap() ;
+   $hm->put("key", "value") ;
+   my $val = $hm->get("key") ;
+   print($val . "\n") ; # prints value
+
+=for comment
+
+The study_classes() function takes 2 arguments, a reference to an array of
+class names (like the STUDY configuration option) and the name of the 
+package in which to bind those classes. If the name of the package is 
+undefined, the classes will be bound to the current (caller) package.
+
+Note: You can only specify the names of packages in which you have 
+previously "used" C<Inline::Java>.
+   Z<>
+
+
+=head1 JNI vs CLIENT/SERVER MODES
+
+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 an improvement in performance.
+
+If you have built the JNI extension, you must enable it explicitely by doing
+one of the following:
+
+=over 4
+
+=item 1 
+
+Set the JNI configuration option to 1
+
+=item 2 
+
+Set the PERL_INLINE_JAVA_JNI environment variable to 1
+
+=back
+
+
+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.
+
+See README.JNI for more information about the JNI extension.
+   Z<>
+
+
+=head1 SHARED_JVM
+
+Starting with version 0.30, the C<Inline::Java> JVM can now be shared between
+multiple processes. The first process to start creates the JVM but does not 
+shut it down on exit. All other processes can then connect as needed to the JVM. 
+If any of these other processes where created by forking the parent process, 
+the Inline::Java->reconnect_JVM() function must be called in the child to get 
+a fresh connection to the JVM. Ex:
+
+=for comment
+
+   use Inline (
+      Java => <<'END',
+         class Pod_11 {
+            public static int i = 0 ;
+            public Pod_11(){
+               i++ ;
+            }
+         }
+   END
+      SHARED_JVM => 1,
+   ) ;
+
+   my $nb = 5 ;
+   for (my $i = 0 ; $i < $nb ; $i++){
+      if (! fork()){
+         Inline::Java::reconnect_JVM() ;
+         my $f = new Pod_11() ;
+         exit ;
+      }
+   }
+   sleep(5) ;
+
+   my $f = new Pod_11() ;
+   print($f->{i} . "\n") ; # prints 6
+
+=for comment
+
+Once this code was run, each of the 6 processes will have created a different 
+instance of the 't' class. Data can be shared between the processes by using 
+static members in the Java code.
+
+Note: The Java System.out stream is closed in SHARED_JVM mode.
+   Z<>
+
+
+=head1 USING Inline::Java IN A CGI
+
+If you want to use C<Inline::Java> in a CGI script, do the following:
+
+=for comment
+
+   use CGI ;
+   use Inline (
+      Java => <<'END',
+         class Pod_counter {
+            public static int cnt = 0 ;
+            public Pod_counter(){
+               cnt++ ;
+            }
+         }
+   END
+      SHARED_JVM => 1,
+      DIRECTORY => '/somewhere/your/web/server/can/write',
+   ) ;
+
+   my $c = new Pod_counter() ;
+   my $q = new CGI() ;
+   print 
+      $q->start_html() . 
+      "This page has been accessed " . $c->{cnt} . " times." .
+      $q->end_html() ;
+
+=for comment
+
+In this scenario, the first CGI to execute will start the JVM, but does
+not shut it down on exit. Subsequent CGI, since they have the SHARED_JVM
+option enabled, will try to connect to the already existing JVM before
+trying to start a new one. Therefore if the JVM happens to crash or is
+killed, the next CGI that runs will start a new one. The JVM will be
+killed when Apache is shut down.
+   Z<>
+
+
+=head1 USING Inline::Java UNDER MOD_PERL
+
+Here is an example of how to use C<Inline::Java> under mod_perl:
+
+   use Apache::Constants ;
+   use Inline (
+      Java => <<'END',
+         class Pod_counter {
+            public static int cnt = 0 ;
+            public Pod_counter(){
+               cnt++ ;
+            }
+         }
+   END
+      SHARED_JVM => 1,
+      DIRECTORY => '/somewhere/your/web/server/can/write',
+   ) ;
+
+   my $c = new Pod_counter() ;
+
+   sub handler {
+      my $r = shift ;
+
+      my $q = new CGI ;
+      print
+         $q->start_html() .
+         "This page has been accessed " . $c->{cnt} . " times." .
+         $q->end_html() ;
+
+      return Apache::Constants::OK() ;
+   }
+
+See USING Inline::Java IN A CGI for more details.
+   Z<>
+
+
+=head1 BUGS AND DEFICIENCIES
+
+When reporting a bug, please do the following:
+
+ - Put "use Inline REPORTBUG;" at the top of your code, or
+   use the command line option "perl -MInline=REPORTBUG ...".
+ - Run your code.
+ - Follow the printed instructions.
+
+Here are some things to watch out for:
+
+=over 4
+
+=item 1
+
+You shouldn't name any of your classes 'B', 'S', 'I', 'J', 'F', 'D',
+'C', 'Z' or 'L'. These classes seem to be used internally by Java to
+represent the primitive types.
+
+=item 2
+
+If you upgrade C<Inline::Java> from a previous version, be sure to delete
+your _Inline directory so that C<Inline::Java>'s own Java classes get 
+rebuilt to match the Perl code.
+
 =back
 
 
-=head1 SEE ALSO
-
+=head1 SEE ALSO
+
 L<Inline::Java::Callback>, L<Inline::Java::PerlNatives>, 
-L<Inline::Java::PerlInterpreter>.
-
-For information about using C<Inline>, see L<Inline>.
-
-For information about other Inline languages, see L<Inline-Support>.
-
-C<Inline::Java>'s mailing list is <inline at perl.org>.
-To subscribe, send an email to <inline-subscribe at perl.org>
-
-C<Inline::Java>'s home page is http://inline.perl.org/java/
-   Z<>
-
-
-=head1 AUTHOR
-
-Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
-
-Brian Ingerson <ingy at cpan.org> is the author of Inline.
-   Z<>
-
-
-=head1 COPYRIGHT
-
-Copyright (c) 2001-2004, Patrick LeBoutillier.
-
-All Rights Reserved. This module is free software. It may be used,
-redistributed and/or modified under the terms of the Perl Artistic
-License. See http://www.perl.com/perl/misc/Artistic.html for more
-details.
-
+L<Inline::Java::PerlInterpreter>.
+
+For information about using C<Inline>, see L<Inline>.
+
+For information about other Inline languages, see L<Inline-Support>.
+
+C<Inline::Java>'s mailing list is <inline at perl.org>.
+To subscribe, send an email to <inline-subscribe at perl.org>
+
+C<Inline::Java>'s home page is http://inline.perl.org/java/
+   Z<>
+
+
+=head1 AUTHOR
+
+Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
+
+Brian Ingerson <ingy at cpan.org> is the author of Inline.
+   Z<>
+
+
+=head1 COPYRIGHT
+
+Copyright (c) 2001-2004, Patrick LeBoutillier.
+
+All Rights Reserved. This module is free software. It may be used,
+redistributed and/or modified under the terms of the Perl Artistic
+License. See http://www.perl.com/perl/misc/Artistic.html for more
+details.
+
 =cut
diff --git a/Java/Array.pm b/Java/Array.pm
index 88e8adf..9b66e89 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -4,7 +4,7 @@ package Inline::Java::Array ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Array::VERSION = '0.48_01' ;
+$Inline::Java::Array::VERSION = '0.48_90' ;
 
 # Here we store as keys the knots and as values our blessed objects
 my $OBJECTS = {} ;
diff --git a/Java/Callback.pm b/Java/Callback.pm
index ff37271..934d115 100644
--- a/Java/Callback.pm
+++ b/Java/Callback.pm
@@ -3,7 +3,7 @@ package Inline::Java::Callback ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Callback::VERSION = '0.48_01' ;
+$Inline::Java::Callback::VERSION = '0.48_90' ;
 
 $Inline::Java::Callback::OBJECT_HOOK = undef ;
 
diff --git a/Java/Class.pm b/Java/Class.pm
index 47e47d6..efb09d3 100644
--- a/Java/Class.pm
+++ b/Java/Class.pm
@@ -3,7 +3,7 @@ package Inline::Java::Class ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Class::VERSION = '0.48_01' ;
+$Inline::Java::Class::VERSION = '0.48_90' ;
 
 $Inline::Java::Class::MAX_SCORE = 10 ;
 
diff --git a/Java/JNI.pm b/Java/JNI.pm
index 1735629..8a5bf4a 100644
--- a/Java/JNI.pm
+++ b/Java/JNI.pm
@@ -4,7 +4,7 @@ package Inline::Java::JNI ;
 
 use strict ;
 
-$Inline::Java::JNI::VERSION = '0.48_01' ;
+$Inline::Java::JNI::VERSION = '0.48_90' ;
 
 use DynaLoader ;
 use Carp ;
diff --git a/Java/JVM.pm b/Java/JVM.pm
index 72a8d36..1763953 100644
--- a/Java/JVM.pm
+++ b/Java/JVM.pm
@@ -7,7 +7,7 @@ use IPC::Open3 ;
 use IO::File ;
 use IO::Socket ;
 
-$Inline::Java::JVM::VERSION = '0.48_01' ;
+$Inline::Java::JVM::VERSION = '0.48_90' ;
 
 my %SIGS = () ;
 
diff --git a/Java/Makefile.PL b/Java/Makefile.PL
index 808ea9e..43e3161 100644
--- a/Java/Makefile.PL
+++ b/Java/Makefile.PL
@@ -56,7 +56,7 @@ print
 	"process. The use of this extension is optional, and building it still\n" .
 	"allows Inline::Java to run the JVM in the default (separate process)\n" .
 	"fashion.\n" .
-	"Note: You need a C compiler to build the extension.\n" ;
+	"Note: You need a C compiler to build the extension.\n" .
 	"Note: You must build the extension if you wish to use PerlNatives or\n" .
 	"      PerlInterpreter.\n" ;
 
@@ -144,8 +144,8 @@ TXT
 
 			print <<TXT;
 The PerlInterpreter extension allows Inline::Java to be loaded directly from
-Java using an embedded PerlInterpreter. It is still EXPERIMENTAL and 
-currently builds and works only with gcc under Linux. See documentation for 
+Java using an embedded Perl interpreter. It is still EXPERIMENTAL and 
+may not build or work properly on all platforms. See documentation for 
 more details.
 TXT
 			if (AskYN("Do you wish to build the PerlInterpreter extension?", 'n')){
diff --git a/Java/Object.pm b/Java/Object.pm
index c0e6cef..e34a072 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -5,7 +5,7 @@ use strict ;
 use Inline::Java::Protocol ;
 use Carp ;
 
-$Inline::Java::Object::VERSION = '0.48_01' ;
+$Inline::Java::Object::VERSION = '0.48_90' ;
 
 # Here we store as keys the knots and as values our blessed private objects
 my $PRIVATES = {} ;
diff --git a/Java/PerlInterpreter/Makefile.PL b/Java/PerlInterpreter/Makefile.PL
index dfb5c30..35bcb2c 100644
--- a/Java/PerlInterpreter/Makefile.PL
+++ b/Java/PerlInterpreter/Makefile.PL
@@ -11,11 +11,14 @@ chomp($ccopts) ;
 my $ldopts = ldopts() ;
 chomp($ldopts) ;
 
+my $pre = Inline::Java::Portable::portable("PRE_WHOLE_ARCHIVE") ;
+my $post = Inline::Java::Portable::portable("POST_WHOLE_ARCHIVE") ;
+
 WriteMakefile(
 	NAME => 'Inline::Java::PerlInterpreter',
 	VERSION_FROM => 'PerlInterpreter.pm',
 	CCFLAGS => $ccopts,
-	LDDLFLAGS => "-Wl,--whole-archive $ldopts -Wl,--no-whole-archive $Config{lddlflags}",
+	LDDLFLAGS => "$pre $ldopts $post $Config{lddlflags}",
 	INC => join(' ', @main::I),
 	# CCFLAGS => '-D_REENTRANT',
 ) ;
diff --git a/Java/PerlInterpreter/PerlInterpreter.pod b/Java/PerlInterpreter/PerlInterpreter.pod
index 5392f1c..bda0c2c 100644
--- a/Java/PerlInterpreter/PerlInterpreter.pod
+++ b/Java/PerlInterpreter/PerlInterpreter.pod
@@ -1,63 +1,63 @@
-=head1 NAME
-
-Inline::Java::PerlInterpreter - Call Perl directly from Java using Inline::Java.
-
-=head1 SYNOPSIS
-
-=for comment
-
-   import org.perl.inline.java.* ;
-
-   class HelpMePerl {
-      static private InlineJavaPerlInterpreter pi = null ;
-
-      public HelpMePerl() throws InlineJavaException {
-      }
-
+=head1 NAME
+
+Inline::Java::PerlInterpreter - Call Perl directly from Java using Inline::Java.
+
+=head1 SYNOPSIS
+
+=for comment
+
+   import org.perl.inline.java.* ;
+
+   class HelpMePerl {
+      static private InlineJavaPerlInterpreter pi = null ;
+
+      public HelpMePerl() throws InlineJavaException {
+      }
+
       static private boolean matches(String target, String pattern)
-      	throws InlineJavaPerlException, InlineJavaException {
-        Boolean b = (Boolean)pi.eval("'" + target + "' =~ /" + pattern + "/", Boolean.class) ;
-        return b.booleanValue() ;
-      }
-
-      public static void main(String args[])
-	     throws InlineJavaPerlException, InlineJavaException {
-         pi = InlineJavaPerlInterpreter.create() ;
-
-         String target = "aaabbbccc" ;
-         String pattern = "ab+" ;
-         boolean ret = matches(target, pattern) ;
-
-         System.out.println(
+      	throws InlineJavaPerlException, InlineJavaException {
+        Boolean b = (Boolean)pi.eval("'" + target + "' =~ /" + pattern + "/", Boolean.class) ;
+        return b.booleanValue() ;
+      }
+
+      public static void main(String args[])
+	     throws InlineJavaPerlException, InlineJavaException {
+         pi = InlineJavaPerlInterpreter.create() ;
+
+         String target = "aaabbbccc" ;
+         String pattern = "ab+" ;
+         boolean ret = matches(target, pattern) ;
+
+         System.out.println(
            target + (ret ? " matches " : " doesn't match ") + pattern) ;
            
-         pi.destroy() ;
-      }
-   }
-
-=for comment
-
-
-=head1 DESCRIPTION
-
-WARNING: C<Inline::Java::PerlInterpreter> is still experimantal.
-
-The C<org.perl.inline.java.InlineJavaPerlInterpreter> Java class allows
+         pi.destroy() ;
+      }
+   }
+
+=for comment
+
+
+=head1 DESCRIPTION
+
+WARNING: C<Inline::Java::PerlInterpreter> is still experimental.
+
+The C<org.perl.inline.java.InlineJavaPerlInterpreter> Java class allows
 you to load a Perl interpreter directly from Java. You can then perform
 regular callbacks to call into Perl.
-   Z<>
-
-
-=head1 USING THE org.perl.inline.java.InlineJavaPerlInterpreter CLASS
-
-B<Installation>
-
-Before using C<org.perl.inline.java.InlineJavaPerlInterpreter>, you must
-have installed C<Inline::Java> as well as the JNI extension. Additionally,
-the PerlInterpreter extension must also have been installed.
-
-B<Finding the jar>
-
+   Z<>
+
+
+=head1 USING THE org.perl.inline.java.InlineJavaPerlInterpreter CLASS
+
+B<Installation>
+
+Before using C<org.perl.inline.java.InlineJavaPerlInterpreter>, you must
+have installed C<Inline::Java> as well as the JNI extension. Additionally,
+the PerlInterpreter extension must also have been installed.
+
+B<Finding the jar>
+
 To be able to use the C<org.perl.inline.java.InlineJavaPerlInterpreter> 
 class, you must use the jar file provided by C<Inline::Java>. You can 
 easily locate this jar file using the following command:
@@ -66,7 +66,7 @@ easily locate this jar file using the following command:
       
 You must then add this jar file to your CLASSPATH as you would any jar
 file.
-
+
 B<Basic Usage>
 
 C<org.perl.inline.java.InlineJavaPerlInterpreter> itself extends
@@ -76,16 +76,19 @@ for information on the callback API.
 Besides that API, C<org.perl.inline.java.InlineJavaPerlInterpreter> provides
 only 2 other public methods:
 
-  public InlineJavaPerlInterpreter create() 
-     throws InlineJavaPerlException, InlineJavaException 
+=over 4
+
+=item public InlineJavaPerlInterpreter create() 
+throws InlineJavaPerlException, InlineJavaException 
     
-     Creates a new org.perl.inline.java.InlineJavaPerlInterpreter object.
-     This class in a singleton.
+Creates a new org.perl.inline.java.InlineJavaPerlInterpreter object.
+This class in a singleton.
      
-  public void destroy()
+=item public void destroy()
   
-     Destroys the Perl interpreter.
+Destroys the Perl interpreter.
 
+=back
 
 =head1 BUGS AND DEFICIENCIES
 
@@ -93,26 +96,26 @@ Presently, C<Inline::Java::PerlInterpreter> compiles only using the gcc
 C compiler. Any help on porting it to other platforms is appreciated.
    Z<>
 
-     
-=head1 SEE ALSO
-
+     
+=head1 SEE ALSO
+
 L<Inline::Java>, L<Inline::Java::Callback>, L<Inline::Java::PerlNatives>.
-   Z<>
-
-
-=head1 AUTHOR
-
-Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
-   Z<>
-
-
-=head1 COPYRIGHT
-
-Copyright (c) 2001-2004, Patrick LeBoutillier.
-
-All Rights Reserved. This module is free software. It may be used,
-redistributed and/or modified under the terms of the Perl Artistic
-License. See http://www.perl.com/perl/misc/Artistic.html for more
-details.
-
-=cut
+   Z<>
+
+
+=head1 AUTHOR
+
+Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
+   Z<>
+
+
+=head1 COPYRIGHT
+
+Copyright (c) 2001-2004, Patrick LeBoutillier.
+
+All Rights Reserved. This module is free software. It may be used,
+redistributed and/or modified under the terms of the Perl Artistic
+License. See http://www.perl.com/perl/misc/Artistic.html for more
+details.
+
+=cut
diff --git a/Java/PerlInterpreter/t/02_perl_interpreter.t b/Java/PerlInterpreter/t/02_perl_interpreter.t
index 65c38dc..0d1487f 100644
--- a/Java/PerlInterpreter/t/02_perl_interpreter.t
+++ b/Java/PerlInterpreter/t/02_perl_interpreter.t
@@ -20,6 +20,8 @@ ok(1) ;
 
 
 my $inline = $Tests::INLINE ;
+$inline = $Tests::INLINE ; # stupid warning...
+
 my $install_dir = File::Spec->catdir($inline->get_api('install_lib'),
         'auto', $inline->get_api('modpname')) ;
 
diff --git a/Java/PerlNatives/PerlNatives.pm b/Java/PerlNatives/PerlNatives.pm
index b246d28..0046002 100644
--- a/Java/PerlNatives/PerlNatives.pm
+++ b/Java/PerlNatives/PerlNatives.pm
@@ -2,6 +2,6 @@ package Inline::Java::PerlNatives ;
 
 use strict ;
 
-$Inline::Java::PerlNatives::VERSION = '0.48_01' ;
+$Inline::Java::PerlNatives::VERSION = '0.48_90' ;
 
 1 ;
diff --git a/Java/PerlNatives/PerlNatives.pod b/Java/PerlNatives/PerlNatives.pod
index 95807fc..f479d28 100644
--- a/Java/PerlNatives/PerlNatives.pod
+++ b/Java/PerlNatives/PerlNatives.pod
@@ -1,34 +1,37 @@
-=head1 NAME
-
-Inline::Java::PerlNatives - Map Java native methods to Perl functions.
-
-=head1 SYNOPSIS
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      class Pod_PN extends InlineJavaPerlNatives {
-         public Pod_PN() throws InlineJavaException {
-         }
-
-         native public String hello() ;
-      }
-   END
-
-   package Pod_PN ;
-   sub hello {
-      return "hi!" ;
-   }
-
-   package main ;
-   my $b = new Pod_PN() ;
-   print $b->hello() ; # prints hi!
-
-=for comment
-
-
-=head1 DESCRIPTION
-
+=head1 NAME
+
+Inline::Java::PerlNatives - Map Java native methods to Perl functions.
+
+=head1 SYNOPSIS
+
+=for comment
+
+
+   use Inline Java => <<'END' ;
+      import org.perl.inline.java.* ;
+
+      class Pod_PN extends InlineJavaPerlNatives {
+         public Pod_PN() throws InlineJavaException {
+         }
+
+         native public String hello() ;
+      }
+   END
+
+   package Pod_PN ;
+   sub hello {
+      return "hi!" ;
+   }
+
+   package main ;
+   my $b = new Pod_PN() ;
+   print($b->hello() . "\n") ; # prints hi!
+
+=for comment
+
+
+=head1 DESCRIPTION
+
 WARNING: C<Inline::Java::PerlNatives> is still experimental.
 
 C<Inline::Java::PerlNatives> allows you to define your callbacks as native 
@@ -40,69 +43,69 @@ C<org.perl.inline.java.InlineJavaPerlNatives> class.
 Note: PerlNatives requires J2SDK version >= 1.4
    Z<>
    
-
-=head1 USING THE org.perl.inline.java.InlineJavaPerlNatives CLASS
-
-Let's revisit the example from the L<Inline::Java::Callback> documentation:
-
-=for comment
-
-   use Inline Java => <<'END' ;
-      import java.util.* ;
-      import org.perl.inline.java.* ;
-      import javax.swing.* ;
-      import java.awt.event.* ;
-
-      class Pod_Button_PN extends InlineJavaPerlNatives
-                          implements ActionListener {
-         public Pod_Button_PN() throws InlineJavaException {
-            JFrame frame = new JFrame("Pod_Button") ;
-            frame.setSize(100,100) ;
-            JButton button = new JButton("Click Me!") ;
-            frame.getContentPane().add(button) ;
-            button.addActionListener(this) ;
-            frame.show() ;
-         }
-
-         public void actionPerformed(ActionEvent e){
-            button_pressed() ;
-         }
-
-         native public void button_pressed() ;
-      }
-   END
-
-   package Pod_Button_PN ;
-   sub button_pressed {
-      print("click!\n") ; # prints click!
-      $b->StopCallbackLoop() ;
-   }
-
-   package main ;
-   my $b = new Pod_Button_PN() ;
-   $b->StartCallbackLoop() ;
-
-=for comment
-
-Extending InlineJavaPerlNatives tells C<Inline::Java> that all native methods 
-declared in that class should be linked to Perl subroutines implemented in the 
-approriate package. You can then call these methods from Java just like regular 
+
+=head1 USING THE org.perl.inline.java.InlineJavaPerlNatives CLASS
+
+Let's revisit an example from the L<Inline::Java::Callback> documentation:
+
+=for comment
+
+   use Inline Java => <<'END' ;
+      import java.util.* ;
+      import org.perl.inline.java.* ;
+      import javax.swing.* ;
+      import java.awt.event.* ;
+
+      class Pod_Button_PN extends InlineJavaPerlNatives
+                          implements ActionListener {
+         public Pod_Button_PN() throws InlineJavaException {
+            JFrame frame = new JFrame("Pod_Button") ;
+            frame.setSize(100,100) ;
+            JButton button = new JButton("Click Me!") ;
+            frame.getContentPane().add(button) ;
+            button.addActionListener(this) ;
+            frame.show() ;
+         }
+
+         public void actionPerformed(ActionEvent e){
+            button_pressed() ;
+         }
+
+         native public void button_pressed() ;
+      }
+   END
+
+   package Pod_Button_PN ;
+   sub button_pressed {
+      print('click!' . "\n") ; # prints click!
+      $main::b->StopCallbackLoop() ;
+   }
+
+   package main ;
+   $main::b = new Pod_Button_PN() ;
+   $main::b->StartCallbackLoop() ;
+
+=for comment
+
+Extending InlineJavaPerlNatives tells C<Inline::Java> that all native methods 
+declared in that class should be linked to Perl subroutines implemented in the 
+approriate package. You can then call these methods from Java just like regular 
 methods. You can even call them from Perl if they are public. 
    Z<>
 
 
 =head1 BUGS AND DEFICIENCIES
 
-C<Inline::Java::PerlNatives> has a few limits that one must be aware of:
-
-=over 4
-
-=item 1
-
+C<Inline::Java::PerlNatives> has a few limits that one must be aware of:
+
+=over 4
+
+=item 1
+
 You cannot declare 2 native methods with the same name in a class (even if they 
-have different signatures).
-
-=item 2
+have different signatures).
+
+=item 2
 
 Native methods can have arguments of any type, but they must return either void 
 or an Object (use wrappers like Integer and Double to return primitive types).
@@ -110,30 +113,30 @@ or an Object (use wrappers like Integer and Double to return primitive types).
 =item 3
 
 Even if you do not declare them, InlineJavaException and InlineJavaPerlException 
-exceptions (as well as others) may be thrown from within the native methods
-
+exceptions (as well as others) may be thrown from within the native methods
+
 =back
-
-
-=head1 SEE ALSO
-
+
+
+=head1 SEE ALSO
+
 L<Inline::Java>, L<Inline::Java::Callback>, L<Inline::Java::PerlInterpreter>.
-   Z<>
-
-
-=head1 AUTHOR
-
-Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
-   Z<>
-
-
-=head1 COPYRIGHT
-
-Copyright (c) 2001-2004, Patrick LeBoutillier.
-
-All Rights Reserved. This module is free software. It may be used,
-redistributed and/or modified under the terms of the Perl Artistic
-License. See http://www.perl.com/perl/misc/Artistic.html for more
-details.
-
+   Z<>
+
+
+=head1 AUTHOR
+
+Patrick LeBoutillier <patl at cpan.org> is the author of Inline::Java.
+   Z<>
+
+
+=head1 COPYRIGHT
+
+Copyright (c) 2001-2004, Patrick LeBoutillier.
+
+All Rights Reserved. This module is free software. It may be used,
+redistributed and/or modified under the terms of the Perl Artistic
+License. See http://www.perl.com/perl/misc/Artistic.html for more
+details.
+
 =cut
diff --git a/Java/Portable.pm b/Java/Portable.pm
index e63c779..b268419 100644
--- a/Java/Portable.pm
+++ b/Java/Portable.pm
@@ -10,7 +10,7 @@ use Config ;
 use File::Find ;
 use File::Spec ;
 
-$Inline::Java::Portable::VERSION = '0.48_01' ;
+$Inline::Java::Portable::VERSION = '0.48_90' ;
 
 # Here is some code to figure out if we are running on command.com
 # shell under Windows.
@@ -158,6 +158,8 @@ sub portable {
 		SUB_FIX_MAKE_QUOTES	=>	undef,
 		JVM_LIB				=>	"libjvm.$Config{dlext}",
 		JVM_SO				=>	"libjvm.$Config{dlext}",
+		PRE_WHOLE_ARCHIVE	=>  '-Wl,--whole-archive',
+		POST_WHOLE_ARCHIVE	=>  '-Wl,--no-whole-archive',
 	} ;
 
 	my $map = {
@@ -185,6 +187,8 @@ sub portable {
 				$val = qq{"$val"} ;
 				return $val ;
 			},
+			PRE_WHOLE_ARCHIVE	=>  '',
+			POST_WHOLE_ARCHIVE	=>  '',
 		},
 		cygwin => {
 			ENV_VAR_PATH_SEP_CP	=>	';',
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 6eafd80..2460ec9 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -5,7 +5,7 @@ use Inline::Java::Object ;
 use Inline::Java::Array ;
 use Carp ;
 
-$Inline::Java::Protocol::VERSION = '0.48_01' ;
+$Inline::Java::Protocol::VERSION = '0.48_90' ;
 
 my %CLASSPATH_ENTRIES = () ;
 
diff --git a/META.yml b/META.yml
index aa32567..9861a8b 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Inline-Java
-version:      0.48_01
+version:      0.48_90
 version_from: Java.pm
 installdirs:  site
 requires:
diff --git a/README b/README
index 6399065..6272701 100644
--- a/README
+++ b/README
@@ -70,6 +70,7 @@ Inline::Java version 0.48 is a major upgrade that includes:
     - Added PerlInterpreter: require/eval Perl code directly from Java
     - Renamed PerlNatives stuff
     - Split and updated documentation
+    - Applied JNI memory leak patch by Jeff Janes
 
 
 See CHANGES for a full change list.
diff --git a/t/pod_test.pl b/t/pod_test.pl
index a64a444..300ee91 100644
--- a/t/pod_test.pl
+++ b/t/pod_test.pl
@@ -21,54 +21,55 @@ GetOptions (\%opts,
 ) ;
 
 
-open(POD, "<Java.pod") or 
-	die("Can't open Java.pod file") ;
-my $pod = join("", <POD>) ;
+foreach my $podf ('Java.pod', 'Java/Callback.pod', 'Java/PerlNatives/PerlNatives.pod'){
+	open(POD, "<$podf") or 
+		die("Can't open $podf file") ;
+	my $pod = join("", <POD>) ;
+	close(POD) ;
 
-my $del = "\n=for comment\n" ;
+	my $del = "\n=for comment\n" ;
 
-my @code_blocks = ($pod =~ m/$del(.*?)$del/gs) ;
+	my @code_blocks = ($pod =~ m/$del(.*?)$del/gs) ;
 
-my $skip_to = $opts{s} || 0 ;
+	my $skip_to = $opts{s} || 0 ;
 
-my $cnt = -1 ;
-foreach my $code (@code_blocks){
-	$cnt++ ;
+	my $cnt = -1 ;
+	foreach my $code (@code_blocks){
+		$cnt++ ;
 
-	if ((defined($opts{o}))&&($opts{o} != $cnt)){
-		print "skipped\n" ;
-		next ;
-	}
+		if ((defined($opts{o}))&&($opts{o} != $cnt)){
+			print "skipped\n" ;
+			next ;
+		}
 
-	if ($cnt < $skip_to){
-		print "skipped\n" ;
-		next ;
-	}
+		if ($cnt < $skip_to){
+			print "skipped\n" ;
+			next ;
+		}
 
-	print "-> Code Block $cnt\n" ;
+		print "-> Code Block $cnt ($podf)\n" ;
 
-	$code =~ s/(\n)(   )/$1/gs ;  
-	$code =~ s/(((END(_OF_JAVA_CODE)?)|STUDY)\')/$1, NAME => "main::main" / ;  
+		$code =~ s/(\n)(   )/$1/gs ;  
+		$code =~ s/(((END(_OF_JAVA_CODE)?)|STUDY)\')/$1, NAME => "main::main" / ;  
 
-	if (($code =~ /SHARED_JVM/)&&($opts{o} != $cnt)){
-		print "skipped\n" ;
-		next ;
-	}
+		if (($code =~ /SHARED_JVM/)&&($opts{o} != $cnt)){
+			print "skipped\n" ;
+			next ;
+		}
 
-	$code =~ s/print\((.*) \. \"\\n\"\) ; # prints (.*)/{
-		"print (((($1) eq ('$2')) ? \"ok\" : \"not ok ('$1' ne '$2')\") . \"\\n\") ;" ;
-	}/ge ;
+		$code =~ s/print\((.*) \. \"\\n\"\) ; # prints (.*)/{
+			"print (((($1) eq ('$2')) ? \"ok\" : \"not ok ('$1' ne '$2')\") . \"\\n\") ;" ;
+		}/ge ;
 
-	debug($code) ;
+		debug($code) ;
 
-	eval $code ;
-	if ($@){
-		die $@ ;
+		eval $code ;
+		if ($@){
+			die $@ ;
+		}
 	}
 }
 
-close(POD) ;
-
 
 sub debug {
 	my $msg = shift ;
diff --git a/t/swing_callback.pl b/t/swing_callback.pl
index 3e212f6..8da3e89 100644
--- a/t/swing_callback.pl
+++ b/t/swing_callback.pl
@@ -7,6 +7,7 @@ use Inline Java => "DATA";
 my $cnt = 0 ;
 my $greeter = MyButton->new();
 $greeter->StartCallbackLoop() ;
+print "loop done\n" ;
 
 
 ###########################################
@@ -53,7 +54,7 @@ public class MyButton extends    InlineJavaPerlCaller
   {
     try
     {
-      CallPerl("main", "button_pressed", new Object [] {});
+      CallPerlSub("main::button_pressed", new Object [] {});
     }
     catch (InlineJavaPerlException pe)  { }
     catch (InlineJavaException pe) { pe.printStackTrace() ;}

-- 
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