[0001] [0002] [0003] [0004] [0005] [0006] [0007] [0008] [0009] [0010] [0011] [0012] [0013] [0014] [0015] [0016] [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] [0028] [0029] [0030] [0031] [0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] [0045] [0046] [0047] [0048] [0049] [0050] [0051] [0052] [0053] [0054] [0055] [0056] [0057] [0058] [0059] [0060] [0061] [0062] [0063] [0064] [0065] [0066] [0067] [0068] [0069] [0070] [0071] [0072] [0073] [0074] [0075] [0076] [0077] [0078] [0079] [0080] [0081] [0082] [0083] [0084] [0085] [0086] [0087] [0088] [0089] [0090] [0091] [0092] [0093] [0094] [0095] [0096] [0097] [0098] [0099] [0100] [0101]
$!-----------------------------------------------------------------'f$verify(0) $! JAVA.COM $! $! DCL wrapper procedure for supporting Java classes as WASD scripts. $! This procedure resides in the same directory as the classes (scripts), so $! WASD_ROOT:[CGI-BIN] (CGI_BIN:) by default. $! Works in conjunction with the CGIplus class provided in CGIplus.java $! May require modification for local site Java environment. $! Class names must be all lower-case due to way WASD invokes the class file. $! $! 02-DEC-2014 MGD some overdue maintenance $! 24-NOV-2002 MGD WASD v8.1 directory restructure $! 05-MAR-2002 MGD increasing complexity (JDK 1.3.1) $! 03-SEP-1998 MGD changes for JDK 1.1.6 final release $! 09-DEC-1997 MGD initial, JDK1.1 beta kit $!---------------------------------------------------------------------------- $! $!(prepare either Java5 or Java6, depending on what we find installed) $ jsetup = f$edit(f$search("SYS$MANAGER:JAVA$150_SETUP.COM"),"COLLAPSE") $ if f$length(jsetup) .eq. 0 then jsetup = f$edit(f$search("SYS$MANAGER:JAVA$60_SETUP.COM"),"COLLAPSE") $ if f$length(jsetup) .eq. 0 $ then $ write sys$output "Status: 502" $ write sys$output "Content-type: text/html" $ write sys$output "" $ write sys$output "Neither Java5 or Java6 setups found!" $ exit $ endif $! $ if f$trnlnm("WASD_JAVA_DBUG") .nes. "" $ then $ write sys$output "Content-type: text/plain" $ write sys$output "" $ set verify $ @'jsetup' $ show symbol * $ show log /process $ else $ define sys$output nl: $ define sys$error nl: $ @'jsetup' $ deassign sys$output $ deassign sys$error $ endif $! $!(when called from a vanilla CGI environment outputs the Java version) $ if f$type(WWW_SCRIPT_NAME) .nes. "" $ then $ write sys$output "Status: 200" $ write sys$output "Content-type: text/plain" $ write sys$output "Script-Control: X-record0-mode=1" $ write sys$output "" $ java -version $ exit $ endif $! $!(include Java class directory in the local class path) $ if f$trnlnm("JAVA$CLASSPATH") .nes. "" $ then $ path = "" $ count = 0 $ classpath_loop: $ item = f$trnlnm("JAVA$CLASSPATH",,count) $ if item .eqs. "" then goto classpath_loop_end $ if path .nes. "" then path = path + "," $ path = path + item $ count = count + 1 $ goto classpath_loop $ classpath_loop_end: $ if path .nes. "" then path = path + "," $ if f$trnlnm("HT_JAVA_ROOT") .nes. "" $ then path = path + "ht_java_root:[java]" $ else path = path + "cgi-bin:[000000]" $ endif $ define/process/user JAVA$CLASSPATH 'path' $ else $ path = f$trnlnm("CLASSPATH") $ if path .nes. "" then path = path + ":.:" $ if f$trnlnm("HT_JAVA_ROOT") .nes. "" $ then path = path + "/ht_java_root/java/" $ else path = path + "/cgi-bin/" $ endif $ define /user CLASSPATH "''path'" $ endif $!(extract just the class file name from the full file path) $ class = f$edit(f$element(0,".",f$element(1,"]",p1)),"lowercase") $! $ dcgipluseof = f$trnlnm("CGIPLUSEOF") $ if dcgipluseof .nes. "" - then dcgipluseof = """-Dcgipluseof=" + dcgipluseof + """" $!(reading from System.in should give the standard CGI HTTP stream) $ define /user sys$input http$input $! $!(ok, here's the Java command) $ java 'dcgipluseof' 'class' $! $!(bit of tidying up) $ statuslognam = "JAVA$STATUS_" + f$getjpi("","PID") $ if f$trnlnm(statuslognam) then deassign /job 'statuslognam' $! $!----------------------------------------------------------------------------