From the Command Line:
In Your Java Code:
* When specifying J-Integra® properties within your Java code, be sure to specify them before any other J-Integra® calls are made!
You can tell the runtime what ip address to use in DCOM references to local Java objects that are passed to remote COM objects. Do this by setting the java.util.rmi.server property or the com.linar.jintegra.server property (the latter overrides the former). If this is set, J-Integra® will only listen on that IP address. You may need to set this if your computer has multiple IP addresses.
Using this property means that TCP/IP connections will have TCP_NODELAY set when running in DCOM mode. This link has a good description of what this setting does: http://www.rgagnon.com/javadetails/java-0294.html
Sets the threading model to be used when J-Integra® initialises COM for new threads using CoInitializeEx. You must have a value to go with this property (i.e. JINTEGRA_COINIT_VALUE=2). 0 is the default value. See the How to Run Java Clients in Native Mode section of the J-Integra® documentation.
Specifies the DCOM ping timeout length in minutes. A supplied value of "0" (zero) disables the timeout; any other supplied value must be a multiple of 2 (i.e. 6, 8, 10, etc.). PLEASE NOTE: This property is only useful when the COM object is hosted in DCOM Mode in Windows Vista (since Vista does not currently ping registered event listeners). The default value (when the property is not specified at runtime) is 6 minutes.
Specifies the TCP/IP port J-Integra® uses to receive incoming DCOM requests (actually uses two ports).
J-Integra® threads initiated by COM clients will normally terminate after five minutes of not being used. However, you can increase this by setting this property (in milliseconds). See the Multi-Threading section of the J-Integra® documentation.
With this option set to a non-zero timeout, a read() call on the InputStream associated with any incoming socket connections will block for only this amount of time (in milliseconds). For more information, see setSoTimeout in http://java.sun.com/j2se/1.4.1/docs/api/java/net/Socket.html
If the timeout expires, a java.io.InterruptedIOException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout, which is also the default value when JINTEGRA_INCOMING_CONNECTION_TIMEOUT is not specified at runtime.
Incoming connections refer to connections that come into (but have not been initiated by) the J-Integra® runtime. J-Integra® listens for incoming connections when acting as a COM-to-Java bridge (e.g. VB accessing Java), or after a reference to a Java object is passed to the COM side. When the timeout is reached, the Java server side will get java.net.ConnectException: Connection timed out: connect.
Tells the J-Integra® runtime the upper limit to use for local ports to use when opening DCOM connections to COM servers (see JINTEGRA_LOCAL_PORT_START).
Tells the J-Integra® runtime what local port to try to use when opening DCOM connections to COM servers -- if the specified port is already in use, it tries the next one up, until it reaches JINTEGRA_LOCAL_PORT_END.
Specifies the name and location of the file where J-Integra® will write logging information.
Specifies the logging level when logging turned on for J-Integra® (from 0 to 3). Level 3 contains the most detail, and should always be used when sending logs to J-Integra® Support.
When the number of lines logged to a log file reaches this limit the runtime closes the existing log file and opens a new one. When the log file is closed, it is timestamped by adding "yyMMddHmmssSSSS" in the file name, where yy=year, MM=month, H=hour, mm=minutes, ss=seconds, and SSSS=milliseconds. The log header is always printed at the top of the log files, and the last line in the log file indicates the name of the new log file.
When a user leaves an applet that uses the JDK plug-in, all threads created by that applet are killed. Unfortunately, unless the user kills all instances of the browser and re-launches it, the same JVM is used. This causes a problem if the user decides to re-visit the applet page - because the same JVM is used, the J-Integra® background ping thread is not restarted. By using the JINTEGRA_MAIN_THREADGROUP property, all J-Integra® threads will be started in the applet thread group known as "main". The JVM does not kill these threads when the user leaves the applet page and J-Integra® can continue to function.
With this property set, any overloaded methods are renamed so they do not conflict, and the mapping to the new alias name is saved automatically. Existing mappings are left unmodified and are always used (even if there is a potential conflict in the IDL file). Without this flag, java2com will not save renamed overloaded methods but instead will generate a unique alias for them on the fly. This can cause your COM client application to fail every time a new TLB file and Java proxies are regenerated with java2com.
To use this property, you would run java2com like this...
java -DJINTEGRA_MAP_OVERLOADED com.linar.java2com.Main
If you wish to have multiple calls from the same COM client thread result in the same J-Integra® runtime Java thread being used to invoke the corresponding methods on Java objects, then you can set the JINTEGRA_MATCH_THREADS property. This will result in a dedicated thread being allocated for each COM client thread -- you may need to modify the default maximum number of threads and the time the threads sit idle before terminating, by setting the appropriate properties. This property is not currently supported when making IDispatch (late-bound) calls in Native Mode. See the Threading from COM to Java section of the J-Integra® documentation.
There is no limit on the value you can set JINTEGRA_MAX_REQUEST_HANDLERS to. For example, if 'JINTEGRA_MAX_REQUEST_HANDLERS=50' is used, this increases the max threads from 20 (the default) to 50. But you can set this to whatever number you would like (100, 500, etc). This max number of threads is essentially for every COM-to-Java bridge running on a given machine. Generally speaking, you just have one bridge running per server, but in theory you could have two or more bridges running on the same computer, and each bridge could have a different number of max threads connecting to it. See the Multi-Threading section of the J-Integra® documentation.
Tells the J-Integra® runtime to run in Native mode (the value associated with the property is ignored).
This property allows you to run the com.linar.jintegra.GetJvmMoniker class on a system which doesn't support GUI (for example, a UNIX system on which XWindows is not configured). If you do not use this property on a non-GUI system, it will result in a crash.
java -DJINTEGRA_NOCLIPBOARD com.linar.jintegra.GetJvmMoniker localhost 1350
Tells the J-Integra® runtime not to use the COM Global Interface Table construct when running in Native mode. Setting this property means that J-Integra® stores object reference pointers directly, instead of GIT cookies, which in turn means that you may have problems passing object references between threads.
This property is used for COM accessing Java. Set this property to the name of a NT server machine that J-Integra® can talk to to authenticate incoming DCOM calls. See the Security/Authentication section of the J-Integra® documentation.
This property is used for Java accessing COM. With this option set to a non-zero timeout, a read() call on the InputStream associated with any outgoing socket connections (initiated by the J-Integra® runtime) will block for only this amount of time (in milliseconds). For more information, see setSoTimeout in http://java.sun.com/j2se/1.4.1/docs/api/java/net/Socket.html
If the timeout expires, a java.io.InterruptedIOException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout, which is also the default value when JINTEGRA_OUTGOING_CONNECTION_TIMEOUT is not specified at runtime.
JINTEGRA_OUTGOING_CONNECTION_TIMEOUT should be set before the Java client establishes a connection to the machine hosting the COM component, and it cannot be changed to another value during runtime. When the timeout is reached, the Java client side will get java.net.ConnectException: Connection timed out: connect.
|1 com.linar.jintegra.AuthInfo.setDefault("domain", "user", "password");|
2 System.setProperty("JINTEGRA_OUTGOING_CONNECTION_TIMEOUT", "5000");
3 COMClass cls = new COMClass("123.456.78.9");
Line 3 in the above code, COMClass cls = new COMClass();, is the place where the connection is established. Setting JINTEGRA_OUTGOING_CONNECTION_TIMEOUT cannot be reset to another value after line 3.
Some COM methods return a COM VariantEnumeration type. J-Integra®'s com2java tool automatically converts the returned type into a standard Java java.lang.Enumeration. There isn't a perfect match though, since COM Enumerations have no equivalent to the hasMoreElements() call, meaning that you have to keep on doing nextElement until you get a NoSuchElementException. However, if you set the JINTEGRA_PREFETCH_ENUMS Java property, J-Integra® will pre-fetch the next element behind the scenes, and thus allow the hasMoreElements() method to work properly.
Used when the proxies generated by java2com have been put into a specific package (using an undocumented mechanism).
Causes the runtime to call com.linar.jintegra.Cleaner.releaseAll() when the JVM shuts down normally (e.g. when Ctrl-C is pressed). This property will only work with JDK 1.3.x (and above).
When running J-Integra® on Windows XP/2003, this property needs to be specified to avoid errors when Java exceptions are passed back to VB in DCOM (late binding) mode. For more on this, please see the related article "J-Integra® and Windows XP".
Disabled by default, if this is set J-Integra® will not close any socket connections itself. It will be left up to the "peer" that J-Integra® is connected with to close socket connections.
If this property is set, then log files have the current time (as returned by System.currentTimeMillis()) added before the final '.' in the log file name. This is useful if you have multiple JVMs running that use the same log file name, since they risk being corrupted otherwise.
Sets the name that an NT machine will see as the client's workstation name when the client is running in DCOM mode, using AuthInfo.setDefault(...), or AuthInfo.setThreadDefault(...)