Using the Java Gateway in a Production - InterSystems Documentation
Using the Java Gateway in a Production - InterSystems Documentation
Using the Java Gateway in a Production - InterSystems Documentation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Restrictions<br />
4.8.5 <strong>Java</strong> Standard Output Redirection<br />
The <strong>Java</strong> <strong>Gateway</strong> automatically redirects any standard <strong>Java</strong> output <strong>in</strong> <strong>the</strong> correspond<strong>in</strong>g <strong>Java</strong> code to <strong>the</strong> call<strong>in</strong>g Ensemble<br />
session. It collects any calls to System.out <strong>in</strong> your <strong>Java</strong> method calls and sends <strong>the</strong>m to Ensemble to display <strong>in</strong> <strong>the</strong> same<br />
format as you would expect to see if you ran your code from <strong>Java</strong>. To disable this behavior and direct your output to <strong>the</strong><br />
standard output device as designated by your <strong>Java</strong> code (<strong>in</strong> most cases that would be <strong>the</strong> console), set <strong>the</strong> follow<strong>in</strong>g global<br />
reference <strong>in</strong> your Ensemble-enabled namespace:<br />
Set ^%SYS("<strong>Gateway</strong>","Remote","DisableOutputRedirect") = 1<br />
4.9 Restrictions<br />
Important:<br />
Ra<strong>the</strong>r than abort<strong>in</strong>g import, <strong>the</strong> <strong>Java</strong> <strong>Gateway</strong> eng<strong>in</strong>e silently skips over all <strong>the</strong> members it is unable to<br />
generate. If you repeat <strong>the</strong> import step with logg<strong>in</strong>g turned on, Ensemble records all skipped members<br />
(along with <strong>the</strong> reason why <strong>the</strong>y were skipped) <strong>in</strong> <strong>the</strong> WARNING section of <strong>the</strong> log file.<br />
The <strong>Java</strong> <strong>Gateway</strong> eng<strong>in</strong>e always makes an attempt to preserve package and method names, parameter types, etc. That way,<br />
call<strong>in</strong>g an Ensemble proxy method is almost identical to call<strong>in</strong>g <strong>the</strong> correspond<strong>in</strong>g method <strong>in</strong> <strong>Java</strong>. It is <strong>the</strong>refore important<br />
to keep <strong>in</strong> m<strong>in</strong>d Caché Basic and ObjectScript restrictions and limits while writ<strong>in</strong>g your <strong>Java</strong> code. In a vast majority of<br />
cases, <strong>the</strong>re should be no issues at all. You might run <strong>in</strong>to some Caché Basic or ObjectScript limits if, for example:<br />
• Your <strong>Java</strong> method names are longer than 30 characters.<br />
• You have 100 or more arguments.<br />
• You are try<strong>in</strong>g to pass Str<strong>in</strong>g objects longer than 32K.<br />
• You rely on <strong>the</strong> fact that <strong>Java</strong> is case-sensitive when you choose your method names.<br />
• You are try<strong>in</strong>g to import a static method that overrides an <strong>in</strong>stance method.<br />
Check with <strong>the</strong> latest Caché Basic and ObjectScript documentation regard<strong>in</strong>g any limits or restrictions. The books are:<br />
• <strong>Us<strong>in</strong>g</strong> Caché Basic<br />
• Caché Basic Reference<br />
• <strong>Us<strong>in</strong>g</strong> Caché ObjectScript<br />
• Caché ObjectScript Reference<br />
<strong>Us<strong>in</strong>g</strong> <strong>the</strong> <strong>Java</strong> <strong>Gateway</strong> 31