Show TOC Start of Content Area

Procedure documentation Defining the Callback Object  Locate the document in its SAP Library structure

Use

To start with, you must create the Notificator interface that represents the callback object on the server-side. The actual implementation of this interface is located on the client side.

The reason for starting with the Notificator interface is that this object is passed as an argument to one of the business methods of the UtilCallback bean. Therefore, the Notificator object must be defined so that the Developer Studio can resolve it when the arguments of the corresponding method of the bean are specified.

Procedure

Before you actually create the Notificator interface, you must create an EJB Module project in the Developer Studio where the application classes must reside. Give it the name UtilCallback. Also, expand the UtilCallback project (while you are in the J2EE Explorer view) and create the package of the application classes from the context menu of the ejbModule node from your project’s structure. Create the examples.iiop package.

This graphic is explained in the accompanying text

Now that you have created the project and have defined the packages, you can go on and create the Notificator interface:

       1.      Change the J2EE Explorer view with the Package Explorer view in your Developer Studio and expand the UtilCallback project.

       2.      From the examples.iiop node access the context menu and choose New  Other

This graphic is explained in the accompanying text

       3.      From the New screen that appears, choose Java from the left-hand side pane and then choose Interface from the right-hand side one. Then choose Next to go to the next screen where you define the interface.

       4.      In the New Java Interface screen, enter the following parameters describing the interface:

Field

Value

Name

Notificator

Modifiers

public

Extended interfaces

java.rmi.Remote

After that choose Finish so that the Developer Studio generates the interface:

This graphic is explained in the accompanying text

       5.      Define the method message(String str) of the Notificator interface in the Notificator.java screen on the right-hand side. Enter the following code between the curly brackets:

public void message(String str) throws java.rmi.RemoteException;

       6.      To save the interface, choose File Save from the main menu of the Developer Studio.

Next Step:

Developing the UtilCallback Enterprise Bean

 

End of Content Area