Examples of ProviderInterface


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

      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)
      {
         System.out.println("*** Could not find doctor for patient.  This is an expected exception when there are not doctors available.");
         e.printStackTrace();
View Full Code Here

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

/* 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)
/*    */     {
/* 76 */       System.out.println("*** Could not find doctor for patient.  This is an expected exception when there are not doctors available.");
/* 77 */       e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.