This topic has not yet been written. The content below is from the topic description.
Transporter sample -complex The complex transporter example (found in org.jboss.remoting.samples.transporter.complex package) is based off a test case a user, Milt Grinberg, provided (thanks Milt). The example is similar to the previous examples, except in this case involves matching Doctors and Patients using the ProviderInterface and provides a more complex sample in which to demonstrate how to use transporters. This example requires JDK 1.5 to run, since is using JBoss Serialization (and non-serialized data objects). To run this example, run the Server class and then the Client class. This can be done via ant targets 'run-transporter-complex-server' and then 'run-transporter-complex-client' as well. For example: ant run-transporter-complex-server and then: ant run-transporter-complex-client The output for the client should look similar to: *** Have a new patient that needs a doctor. The patient is: Patient: Name: Bill Gates Ailment - Type: financial, Description: Money coming out the wazoo. *** Looking for doctor that can help our patient... *** Found doctor for our patient. Doctor found is: Doctor: Name: Andy Jones Specialty: financial Patients: Patient: Name: Larry Ellison Ailment - Type: null, Description: null Doctor - Name: Andy Jones Patient: Name: Steve Jobs Ailment - Type: null, Description: null Doctor - Name: Andy Jones Patient: Name: Bill Gates Ailment - Type: financial, Description: Money coming out the wazoo. *** Set doctor as patient's doctor. Patient info is now: Patient: Name: Bill Gates Ailment - Type: financial, Description: Money coming out the wazoo. Doctor - Name: Andy Jones *** Have a new patient that we need to find a doctor for (remember, the previous one retired and there are no others) *** Could not find doctor for patient. This is an expected exception when there are not doctors available. org.jboss.remoting.samples.transporter.complex.NoDoctorAvailableException: No doctor available for ailment 'financial' at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:183) at org.jboss.remoting.Client.invoke(Client.java:325) at org.jboss.remoting.Client.invoke(Client.java:288) at org.jboss.remoting.Client.invoke(Client.java:273) at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterClient.java:237) at $Proxy0.findDoctor(Unknown Source) at org.jboss.remoting.samples.transporter.complex.client.Client.makeClientCall(Client.java:72) at org.jboss.remoting.samples.transporter.complex.client.Client.main(Client.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) From the output see the creation of a new patient, Bill Gates, and the attempt to find a doctor that specializes in his ailment. For Mr. Gates, we were able to find a doctor, Andy Jones, and can see that he has been added to the list of Dr. Jones' patients. Then we have Dr. Jones retire. Then we create a new patient and try to find an available doctor for the same ailment. Since Dr. Jones has retired, and there are no other doctors that specialize in that particular ailment, an exception is thrown. This is as expected.