Show TOC

 Implementing the Callback ObjectLocate this document in the navigation structure

Use

You must provide the actual implementation of the callback object defined by the Notificator interface. The implementation is provided with the NotificatorServant.java class.

Procedure
  1. Create the NotificatorServant class using the New → Class function from the Client project's context menu. Enter the following parameters in the New Java Class screen that appears:
    Field Value

    Source Folder

    Client

    Package

    Leave empty (equivalent to default).

    Enclosing type

    Do not select

    Name

    NotificatorServant

    Modifiers

    public

    Superclass

    examples.iiop.NotificatorPOA

    Interfaces

    Leave empty

    Which method stubs would you like to create?

    Select Inherited abstract methods only.

  2. Open the NotificatorServant class for editing and implement its message(String arg0) method. Enter the following code in the method's body:
    System.out.println(arg0);
  3. Choose File → Save from the main menu of the Developer Studio to save the NotificatorServant class.
Result

You have successfully implemented the NotificatorServant object. The full source code of the class must be the following:

import examples.iiop.NotificatorPOA;
 
public class NotificatorServant extends NotificatorPOA {
 
   /*      
    * The message method that prints a string to the system output
    *
    * @see examples.iiop.NotificatorOperations#message(java.lang.String)
    */
   public void message(String arg0) {
      System.out.println(arg0);
   }
}