JavaRMIアプリケーションを実行してみる。 <<< クライアント側 >>> [inoue@onlpara keyin-21]$ rmiregistry & [1] 5681 [inoue@onlpara keyin-21]$ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 Jul26 ? 00:00:06 init root 2 1 0 Jul26 ? 00:00:00 [keventd] root 3 1 0 Jul26 ? 00:00:00 [ksoftirqd_CPU0] root 4 1 0 Jul26 ? 00:00:01 [kswapd] root 5 1 0 Jul26 ? 00:00:00 [bdflush] root 6 1 0 Jul26 ? 00:00:00 [kupdated] root 7 1 0 Jul26 ? 00:00:00 [mdrecoveryd] root 11 1 0 Jul26 ? 00:00:00 [kjournald] root 82 1 0 Jul26 ? 00:00:00 [khubd] root 279 1 0 Jul26 ? 00:00:00 [kjournald] root 280 1 0 Jul26 ? 00:00:00 [kjournald] root 753 1 0 Jul26 ? 00:00:00 syslogd -m 0 root 758 1 0 Jul26 ? 00:00:00 klogd -x rpc 772 1 0 Jul26 ? 00:00:00 [portmap] rpcuser 794 1 0 Jul26 ? 00:00:00 [rpc.statd] root 911 1 0 Jul26 ? 00:00:00 /usr/sbin/sshd root 932 1 0 Jul26 ? 00:00:00 xinetd -stayalive -reuse -pidfil lp 953 1 0 Jul26 ? 00:00:00 [lpd] root 991 1 0 Jul26 ? 00:00:00 gpm -t ps/2 -m /dev/mouse wnn 1007 1 0 Jul26 ? 00:00:00 [jserver] bin 1020 1 0 Jul26 ? 00:00:00 [cannaserver] root 1032 1 0 Jul26 ? 00:00:00 crond xfs 1084 1 0 Jul26 ? 00:00:00 [xfs] daemon 1108 1 0 Jul26 ? 00:00:00 [atd] root 1121 1 0 Jul26 ? 00:00:00 rhnsd --interval 240 root 1128 1 0 Jul26 tty1 00:00:00 /sbin/mingetty tty1 root 1129 1 0 Jul26 tty2 00:00:00 /sbin/mingetty tty2 root 1130 1 0 Jul26 tty3 00:00:00 /sbin/mingetty tty3 root 1131 1 0 Jul26 tty4 00:00:00 /sbin/mingetty tty4 root 1132 1 0 Jul26 tty5 00:00:00 /sbin/mingetty tty5 root 1133 1 0 Jul26 tty6 00:00:00 /sbin/mingetty tty6 root 1134 1 0 Jul26 ? 00:00:00 [gdm] root 1142 1134 0 Jul26 ? 00:00:00 [gdm] root 1143 1142 0 Jul26 ? 00:00:00 /usr/bin/X11/X :0 -auth /var/gdm gdm 1149 1142 0 Jul26 ? 00:00:00 /usr/bin/gdmlogin --disable-soun gdm 1150 1149 0 Jul26 ? 00:00:00 /usr/bin/xsri --redhat-login --r root 5604 911 0 15:41 ? 00:00:00 /usr/sbin/sshd inoue 5605 5604 0 15:41 pts/0 00:00:00 -bash inoue 5681 5605 20 15:51 pts/0 00:00:00 rmiregistry inoue 5682 5681 0 15:51 pts/0 00:00:00 rmiregistry inoue 5683 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5684 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5685 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5686 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5687 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5688 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5689 5682 10 15:51 pts/0 00:00:00 rmiregistry inoue 5691 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5692 5682 0 15:51 pts/0 00:00:00 rmiregistry inoue 5693 5605 0 15:51 pts/0 00:00:00 ps -ef [inoue@onlpara keyin-21]$ [inoue@onlpara keyin-21]$ java ClientImpl onlsbc1 (1). Enter 'q' to quit. (2). Enter numerical value to sep up CAMAC command (3). Enter 's' to start up command execution. Command (N, A, F)(dec) = 4,0,16 入力されたCommand: 4,0,16 Write Data(hex) = 0 入力されたData: 0(dec), 0x0(hex) Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 16, l_count = 1 ClientImpl.scmd [ 0 ] = -536608752(dec), 0xe0040010(hex) ClientImpl.sdat [ 0 ] = 0(dec), 0x0(hex) Command (N, A, F)(dec) = 4,0,0 入力されたCommand: 4,0,0 Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 0, l_count = 2 ClientImpl.scmd [ 1 ] = -536608768(dec), 0xe0040000(hex) ClientImpl.sdat [ 1 ] = 0(dec), 0x0(hex) Command (N, A, F)(dec) = 4,0,16 入力されたCommand: 4,0,16 Write Data(hex) = abcdef 入力されたData: 11259375(dec), 0xabcdef(hex) Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 16, l_count = 3 ClientImpl.scmd [ 2 ] = -536608752(dec), 0xe0040010(hex) ClientImpl.sdat [ 2 ] = 11259375(dec), 0xabcdef(hex) Command (N, A, F)(dec) = 4,0,0 入力されたCommand: 4,0,0 Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 0, l_count = 4 ClientImpl.scmd [ 3 ] = -536608768(dec), 0xe0040000(hex) ClientImpl.sdat [ 3 ] = 0(dec), 0x0(hex) Command (N, A, F)(dec) = 4,0,16 入力されたCommand: 4,0,16 Write Data(hex) = 567483 入力されたData: 5665923(dec), 0x567483(hex) Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 16, l_count = 5 ClientImpl.scmd [ 4 ] = -536608752(dec), 0xe0040010(hex) ClientImpl.sdat [ 4 ] = 5665923(dec), 0x567483(hex) Command (N, A, F)(dec) = 4,0,0 入力されたCommand: 4,0,0 Make up CAMAC Command of Single action. Accepted data: n = 4, a = 0, f = 0, l_count = 6 ClientImpl.scmd [ 5 ] = -536608768(dec), 0xe0040000(hex) ClientImpl.sdat [ 5 ] = 0(dec), 0x0(hex) Command (N, A, F)(dec) = s Ok. Start up CAMAC execution. RMI: Client side: RMI: Sent CAMAC command: array length =6 ClientImpl.scmd[0] = 0xe0040010, ClientImpl.sdat[0] = 0x0 ClientImpl.scmd[1] = 0xe0040000, ClientImpl.sdat[1] = 0x0 ClientImpl.scmd[2] = 0xe0040010, ClientImpl.sdat[2] = 0xabcdef ClientImpl.scmd[3] = 0xe0040000, ClientImpl.sdat[3] = 0x0 ClientImpl.scmd[4] = 0xe0040010, ClientImpl.sdat[4] = 0x567483 ClientImpl.scmd[5] = 0xe0040000, ClientImpl.sdat[5] = 0x0 ClientImpl.scmd[6] = 0x0, ClientImpl.sdat[6] = 0x0 RMI: Received CAMAC reply: array length = 6 c_reply[0] = 0xe0040010, d_reply[0] = 0x7000000 c_reply[1] = 0xe0040000, d_reply[1] = 0x0 c_reply[2] = 0xe0040010, d_reply[2] = 0x7000000 c_reply[3] = 0xe0040000, d_reply[3] = 0xabcdef c_reply[4] = 0xe0040010, d_reply[4] = 0x7000000 c_reply[5] = 0xe0040000, d_reply[5] = 0x567483 c_reply[6] = 0x0, d_reply[6] = 0x0 [inoue@onlpara keyin-21]$ <<< サーバ側 >>> onlsbc1:/home/toyo/JavaRMI/CAMAC/Key-in/keyin-21# rmiregistry & [1] 1674 onlsbc1:/home/toyo/JavaRMI/CAMAC/Key-in/keyin-21# ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 Jul26 ? 00:00:00 init [2] root 2 1 0 Jul26 ? 00:00:00 [keventd] root 3 1 0 Jul26 ? 00:00:00 [ksoftirqd_CPU0] root 4 1 0 Jul26 ? 00:00:00 [kswapd] root 5 1 0 Jul26 ? 00:00:00 [bdflush] root 6 1 0 Jul26 ? 00:00:00 [kupdated] root 105 1 0 Jul26 ? 00:00:00 [kjournald] root 277 1 0 Jul26 ? 00:00:00 [khubd] daemon 400 1 0 Jul26 ? 00:00:00 /sbin/portmap root 484 1 0 Jul26 ? 00:00:00 /sbin/syslogd root 510 1 0 Jul26 ? 00:00:00 /sbin/klogd root 524 1 0 Jul26 ? 00:00:00 /usr/sbin/inetd root 528 1 0 Jul26 ? 00:00:00 /usr/sbin/lpd root 539 1 0 Jul26 ? 00:00:00 /usr/sbin/sshd root 544 1 0 Jul26 ? 00:00:00 /sbin/rpc.statd root 547 1 0 Jul26 ? 00:00:00 /usr/sbin/cron root 555 1 0 Jul26 tty1 00:00:00 /sbin/getty 38400 tty1 root 556 1 0 Jul26 tty2 00:00:00 /sbin/getty 38400 tty2 root 557 1 0 Jul26 tty3 00:00:00 /sbin/getty 38400 tty3 root 558 1 0 Jul26 tty4 00:00:00 /sbin/getty 38400 tty4 root 559 1 0 Jul26 tty5 00:00:00 /sbin/getty 38400 tty5 root 560 1 0 Jul26 tty6 00:00:00 /sbin/getty 38400 tty6 root 1509 539 0 15:36 ? 00:00:00 sshd: toyo [priv] toyo 1512 1509 0 15:36 ? 00:00:00 sshd: toyo@pts/0 toyo 1513 1512 0 15:36 pts/0 00:00:00 -bash root 1672 1513 0 15:59 pts/0 00:00:00 bash root 1674 1672 46 15:59 pts/0 00:00:01 rmiregistry root 1675 1674 0 15:59 pts/0 00:00:00 rmiregistry root 1676 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1677 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1678 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1679 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1680 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1681 1675 11 15:59 pts/0 00:00:00 rmiregistry root 1682 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1684 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1685 1675 0 15:59 pts/0 00:00:00 rmiregistry root 1686 1672 0 15:59 pts/0 00:00:00 ps -ef onlsbc1:/home/toyo/JavaRMI/CAMAC/Key-in/keyin-21# export LD_LIBRARY_PATH=.:$LD_L IBRARY_PATH onlsbc1:/home/toyo/JavaRMI/CAMAC/Key-in/keyin-21# java ServerImpl bind done RMI: Server side: RMI: Received CAMAC command: array length = 6 cmd[0] = 0xe0040010, dat[0] = 0x0 cmd[1] = 0xe0040000, dat[1] = 0x0 cmd[2] = 0xe0040010, dat[2] = 0xabcdef cmd[3] = 0xe0040000, dat[3] = 0x0 cmd[4] = 0xe0040010, dat[4] = 0x567483 cmd[5] = 0xe0040000, dat[5] = 0x0 cmd[6] = 0x0, dat[6] = 0x0 JNI, Java side: before Native Call ServerImpl.r_cmd[0] = 0xe0040010, ServerImpl.r_dat[0] = 0x0 ServerImpl.r_cmd[1] = 0xe0040000, ServerImpl.r_dat[1] = 0x0 ServerImpl.r_cmd[2] = 0xe0040010, ServerImpl.r_dat[2] = 0xabcdef ServerImpl.r_cmd[3] = 0xe0040000, ServerImpl.r_dat[3] = 0x0 ServerImpl.r_cmd[4] = 0xe0040010, ServerImpl.r_dat[4] = 0x567483 ServerImpl.r_cmd[5] = 0xe0040000, ServerImpl.r_dat[5] = 0x0 ServerImpl.r_cmd[6] = 0x0, ServerImpl.r_dat[6] = 0x0 JNI, C side: Received CAMAC command: array length = 6 c_cmd[0] = 0xe0040010, c_dat[0] = 0x0 c_cmd[1] = 0xe0040000, c_dat[1] = 0x0 c_cmd[2] = 0xe0040010, c_dat[2] = 0xabcdef c_cmd[3] = 0xe0040000, c_dat[3] = 0x0 c_cmd[4] = 0xe0040010, c_dat[4] = 0x567483 c_cmd[5] = 0xe0040000, c_dat[5] = 0x0 c_cmd[6] = 0x0, c_dat[6] = 0x0 JNI, C side: CAMAC access camac write data: data = 0x0 camac write command reply: cmd = 0xe0040010 : data = 7000000 camac read command reply: cmd = 0xe0040000 : data = 0x0 camac write data: data = 0xabcdef camac write command reply: cmd = 0xe0040010 : data = 7000000 camac read command reply: cmd = 0xe0040000 : data = 0xabcdef camac write data: data = 0x567483 camac write command reply: cmd = 0xe0040010 : data = 7000000 camac read command reply: cmd = 0xe0040000 : data = 0x567483 JNI, Java side: after Native Call array length = 6 ServerImpl.r_cmd[0] = 0xe0040010, ServerImpl.r_dat[0] = 0x7000000 ServerImpl.r_cmd[1] = 0xe0040000, ServerImpl.r_dat[1] = 0x0 ServerImpl.r_cmd[2] = 0xe0040010, ServerImpl.r_dat[2] = 0x7000000 ServerImpl.r_cmd[3] = 0xe0040000, ServerImpl.r_dat[3] = 0xabcdef ServerImpl.r_cmd[4] = 0xe0040010, ServerImpl.r_dat[4] = 0x7000000 ServerImpl.r_cmd[5] = 0xe0040000, ServerImpl.r_dat[5] = 0x567483 ServerImpl.r_cmd[6] = 0x0, ServerImpl.r_dat[6] = 0x0 onlsbc1:/home/toyo/JavaRMI/CAMAC/Key-in/keyin-21# ok. 正常に実行できている。 サーバからの応答も長時間待たされることもな く正常に実行できている。  注. テスト用のスイッチレジスターモジュールはステーション#4にセットして  あるのでそのための修正をやった。 toyo@onlsbc1:~/JavaRMI/CAMAC/Key-in/keyin-21$ vi camac.c : /* #define CMD_F16_A0_N3 0xE0030010 #define CMD_F0_A0_N3 0xE0030000 */ #define CMD_F16_A0_N3 0xE0040010 #define CMD_F0_A0_N3 0xE0040000 : toyo@onlsbc1:~/JavaRMI/CAMAC/Key-in/keyin-21$ 現在の Apache の設定で、JNIを含めた JavaRMIアプリケーションは正常 に実行できている。