class EnsLib.JavaGateway.Service
extends EnsLib.Gateway.Service
A service responsible for starting, monitoring and stopping the Java Gateway Server in a production.
parameter JAVADEBUG = "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=${JavaDebugPort},suspend=${JavaDebugSuspend},server=y";
Java debugging parameters, used if JavaDebug is True:
(see http://java.sun.com/j2se/1.3/docs/guide/jpda/conninv.html#Xrunjdwp)
- -Xdebug : Enable debugging
- -Xnoagent : Disables oldjdb support
- -Djava.compiler=NONE : Disable JIT compiler
- -Xrunjdwp : JDWP Options
- transport=dt_socket, (Use TCP/IP)
- address=8000, (Listen on port 8000)
- suspend=y, (Suspend the Java process until the debugger connects)
- server=y (Listen for incoming debugger connection)
parameter SETTINGS = "%gatewayName:Basic,%stopNamedGatewayOnTeardown:Basic,Address:Basic,Port:Basic,HeartbeatInterval,HeartbeatFailureTimeout,HeartbeatFailureAction,HeartbeatFailureRetry,JavaHome,ClassPath,JVMArgs,Logfile,UsePassphrase,JavaDebug,JavaDebugPort,JavaDebugSuspend,-ArchiveIO";
List of properties can be set as settings in the configuration file
format is a comma separated list of property names
property Address
as %String [ InitialExpression = "127.0.0.1" ];
IP address or name of the machine where the JVM to be used by the Java Gateway Server is located.
property ClassPath
as %String(MAXLEN=32000);
CLASSPATH containing the files required to be passed as an argument when starting the JVM.
The user should typically provide here the files containing the classes used via the Java Gateway.
We assume that the user has properly quoted the classpath and supplied the correct separators for the platform
in case of multiple files.
Note that additional classpath can be specified in business operations derived from EnsLib.JavaGateway.AbstractOperation.
See property AdditionalPaths in that class.
deprecatedproperty JDKVersion
as %String(DISPLAYLIST=",Java 1.7,Java 1.8",VALUELIST=",JDK17,JDK18") [ Deprecated,InitialExpression = "JDK18" ];
DEPRECATED : We now check the version of the java executable before starting the gateway.
There is no need fo the user to tell which version of the JARs to use anymore.
Version of JDK used to select the intended version of the InterSystems .jar files.
It is used to assemble the command to start the Java Gateway.
property JVMArgs
as %String(MAXLEN=32000);
Optional arguments to be passed to the Java Virtual Machine (JVM) to include when assembling the
command to start the Java Gateway.
For example, you can specify system properties: Dsystemvar=value
or set the maximum heap size: Xmx256m
and so on, as needed.
property JavaDebug
as %Boolean [ InitialExpression = "0" ];
If set to True, enables Java debugging via TCP, allowing a Java debugger (such as Eclipse or Jswat) to attach.
The default is False.
The following arguments can be set: JavaDebug, JavaDebugSuspend
and JAVADEBUG.
property JavaDebugPort
as %String [ InitialExpression = "8000" ];
Specifies the port to listen on if JavaDebug is True. The default is 8000.
property JavaDebugSuspend
as %String(DISPLAYLIST=",Yes,No",VALUELIST=",y,n") [ InitialExpression = "n" ];
If JavaDebug is True, this setting indicates whether the JVM is suspended
on start in order to wait for the debugger to attach.
The default is No.
property JavaHome
as %String(MAXLEN=1023);
Location of the JVM (similar to JAVA_HOME environment variable). It is used to find the target JVM and assemble the
command to start the Java Gateway.
Note: If there is a default JVM on the machine that is usable without the need to specify its location,
this setting may be left blank.
deprecatedclassmethod ConnectGateway(pEndpoint As %String, ByRef pGateway As %Net.Remote.Gateway, pDebug As %Boolean = 0, pTimeout As %Numeric = 5, pAdditionalPaths As %String = "")
as %Status
Connect to a running Java Gateway Server.
This method is deprecated.
method GetObjectGateway()
as %DynamicObject
classmethod JavaDebugParams(pDebugPort As %String, pDebugSuspend As %String)
as %String
deprecatedclassmethod PingJavaGateway(pPort As %String, pServer As %String = "127.0.0.1")
as %Status
"Ping" the Java Gateway server to check if it's alive.
This method is deprecated.
method ServerGet()
as %String
This is a Get accessor method for the Server property.
deprecatedclassmethod StartGateway(pJavaHome As %String, pClassPath As %String, pJVMArgs As %String, pPort As %String, pLogfile As %String = "", pJavaDebug As %Boolean = 0, ByRef pDevice As %String = "", pAddress As %String = "127.0.0.1", pJavaDebugPort As %String = "", pJavaDebugSuspend As %String = "", pUsePassphrase As %Boolean = 0)
as %Status
Start up the Java Gateway Server.
This method is deprecated.
deprecatedclassmethod StopGateway(pPort As %String, pServer As %String = "127.0.0.1", pTimeout As %Numeric = 5)
as %Status
Shutdown the Gateway.
This method is deprecated.