jlinker-init

Function

Package: javatools.jlinker

Arguments: &optional mode&key lisp-port lisp-host lisp-file java-port java-host java-file timeout java-args preload debug verbose

Update information

This page has been updated since its original release with Allegro CL 6.0. The new material concerns the optional mode argument, left out of the original release. FAQ entry 4-11 also has this correction. (The link assumes the updated FAQ is in the ../../../faq/ subdirectory with respect to this file. If the link does not work, you can find this FAQ on the Franz Inc. home page: http://www.franz.com/.)

Definition

This function establishes communication with a Java server. The value returned is a keyword identifying the last step that was performed. The result is a list if an error is detected.

The mode argument is one of the keywords

:start-java or :start
:lisp-advertises or :lisp
:java-advertises or :java

When mode is :start-java (the deafult), Lisp starts the Java VM as a dedicated server. The following keywords may be used to modify the default values:

:lisp-port      nil
:lisp-host      "localhost"
:java-port      nil
:java-host      "localhost"

NOTE: If :java-host is not the default value, the user must supply a function that starts Java at the desired host. The name of this function is stored in the variable *jlinker-run-java*.

When mode is :lisp-advertises, Lisp advertises a server and assumes Java will start independently and connect to the server. The following keywords may be used to modify the default values:

:lisp-file      "JavaToLisp.trp"
:lisp-port      nil
:lisp-host      "localhost"
:timeout        nil

If :lisp-file is specified as nil, Lisp simply listens at the specified port and does not advertise in a file. In that case it is necessary to specify :lisp-port as a non-zero value. If :timeout is a number greater than 0, then it is the number of seconds Lisp will wait for Java to respond.

When mode is :java-advertises, Lisp expects the Java server to start independently and advertise its server. The following keywords may be used to modify the default values:

:java-file      "LispToJava.trp"
:java-port      nil
:java-host      "localhost"
:lisp-port      nil
:lisp-host      "localhost"

When :java-file is non-nil, :java-port and :java-host are ignored. When :java-file is nil, Java is not expected to write a file; Lisp simply tries to connect to the :java-port socket at :java-host; in this case :java-port must be non-zero. If Java is not ready when Lisp tries to connect, an error message (list) is returned.

The following keywords alter the behavior of the init program:

When the :java-port argument is specified as a negative number, Lisp opens a passive socket for both the Lisp server and the Java server. Thus, the Java application connects to a listening socket for the Lisp server connection and also for the Java server connection. This feature is useful if the Java application is prevented from listening at sockets because of security restrictions.

See jlinker.htm for more information on the jLinker facility.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.