java programming language basics phần 5

Các chương trình máy chủ không phải là đa luồng và không thể xử lý yêu cầu từ nhiều hơn một khách hàng. Ví dụ 2 chuyển đổi chương trình máy chủ với một phiên bản đa luồng để nó có thể xử lý yêu cầu từ nhiều hơn một khách hàng. | Java TM Language Basics Part 1 Lesson 8 Remote Method Invocation http Programming BasicJava1 This lesson converts the File Input and Output application from Lesson 6 File Access and Permissions to the RMI API. Program Behavior The RMIClient1 program presents a simple user interface and prompts for text input. When you click the Click Me button the text is sent to the RMIClient2 program by way of the remote server object. When you click the Click Me button on the RMiciient2 program the text sent from RMiciientl appears. First Instance of Client 1 If you start a second instance of RMiciientl and type in some text that text is sent to RMiciient2 when you click the Click Me button. To see the text received by RMiciient2 click its Click Me button. Second Instance of Client 1 File Summary The example program consists of the RMIClient1 program remote object and interface and the RMIClient2 program as illustrated in the diagram. The corresponding source code files for these executables are described in the bullet list below. Server Object RMlQientl Program Send Remote Send Interface Object RMICIientZ RMIClientl Program sendData getDataf 1. sendData getDataf 1 1 1 Program Client program that calls the sendData method on the RemoteServer server object. Client program that calls the getData method on 2 of 11 21-04-2000 17 32 Java TM Language Basics Part 1 Lesson 8 Remote Method Invocation http Programming BasicJava1 the RemoteServer server object. Remote server object that implements and the sendData and getData remote methods. Remote interface that declares the sendData and getData remote server methods. In addition the following security policy file grants the permissions needed to run the example. grant permission 1024-65535 connect accept resolve permission .

Bấm vào đây để xem trước nội dung
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.