Package org.jboss.remoting.samples.transporter.complex

Examples of org.jboss.remoting.samples.transporter.complex.Patient


   private String locatorURI = "socket://localhost:5401/?serializationtype=jboss";

   public void makeClientCall() throws Exception
   {
      // First create patient and populate with data
      Patient patient = new Patient("Bill", "Gates");
      patient.setAilmentType("financial");
      patient.setAilmentDescription("Money coming out the wazoo.");

      System.out.println("*** Have a new patient that needs a doctor.  The patient is:\n" + patient);

      // now create remote provide interface to call on
      ProviderInterface providerProcessor = (ProviderInterface) TransporterClient.createTransporterClient(locatorURI, ProviderInterface.class);


      try
      {
         // find a doctor that can help our patient.  Note, if none found, will throw an exception
         System.out.println("*** Looking for doctor that can help our patient...\n");
         Doctor doctor = providerProcessor.findDoctor(patient);

         // notice that list of patients now includes our patient, Bill Gates
         System.out.println("*** Found doctor for our patient.  Doctor found is:\n" + doctor);

         // assign doctor as patient's doctor
         patient.setDoctor(doctor);
         System.out.println("*** Set doctor as patient's doctor.  Patient info is now:\n" + patient);

         // let's say our doctor made enough money to retire after helping out our patient, Bill.
         providerProcessor.retireDoctor(doctor);

         // let's create a new patient and find a doctor for him
         Patient patient2 = new Patient("Larry", "Page");
         patient2.setAilmentType("financial");
         patient2.setAilmentDescription("Money coming out the wazoo.");

         System.out.println("*** Have a new patient that we need to find a doctor for (remember, the previous one retired and there are no others)");
         providerProcessor.findDoctor(patient2);
      }
      catch(NoDoctorAvailableException e)
View Full Code Here


/* 35 */   private String locatorURI = "socket://localhost:5401/?serializationtype=jboss";
/*    */
/*    */   public void makeClientCall()
/*    */     throws Exception
/*    */   {
/* 40 */     Patient patient = new Patient("Bill", "Gates");
/* 41 */     patient.setAilmentType("financial");
/* 42 */     patient.setAilmentDescription("Money coming out the wazoo.");
/*    */
/* 44 */     System.out.println("*** Have a new patient that needs a doctor.  The patient is:\n" + patient);
/*    */
/* 47 */     ProviderInterface providerProcessor = (ProviderInterface)TransporterClient.createTransporterClient(this.locatorURI, ProviderInterface.class);
/*    */     try
/*    */     {
/* 53 */       System.out.println("*** Looking for doctor that can help our patient...\n");
/* 54 */       Doctor doctor = providerProcessor.findDoctor(patient);
/*    */
/* 57 */       System.out.println("*** Found doctor for our patient.  Doctor found is:\n" + doctor);
/*    */
/* 60 */       patient.setDoctor(doctor);
/* 61 */       System.out.println("*** Set doctor as patient's doctor.  Patient info is now:\n" + patient);
/*    */
/* 64 */       providerProcessor.retireDoctor(doctor);
/*    */
/* 67 */       Patient patient2 = new Patient("Larry", "Page");
/* 68 */       patient2.setAilmentType("financial");
/* 69 */       patient2.setAilmentDescription("Money coming out the wazoo.");
/*    */
/* 71 */       System.out.println("*** Have a new patient that we need to find a doctor for (remember, the previous one retired and there are no others)");
/* 72 */       providerProcessor.findDoctor(patient2);
/*    */     }
/*    */     catch (NoDoctorAvailableException e)
View Full Code Here

TOP

Related Classes of org.jboss.remoting.samples.transporter.complex.Patient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.