Use this task to create a mediation handler.
Before you start, you need a mediation handler class containing your
mediation. For more information, see the topic "Writing a mediation handler"
in the Service Integration information.
In this task, you use the Deployment Descriptor editor to edit the
deployment descriptor file for your mediation handler enterprise bean, and
save it as an EAR file ready to export to WebSphere Application Server.
Complete the following steps:
- Display your EJB module:
- Switch to the J2EE perspective to work
with J2EE projects. Click Window > Open
Perspective > Other >J2EE.
- In the Project Explorer view, expand EJB Modules to
display the folder containing your EJB project.
- Expand the folder, select your EJB project and double-click
on the Deployment Descriptor.
The EJB project is displayed in the EJB Deployment Descriptor
editor.
- Select the Mediation Handlers tab at the
bottom of the editor area to open the Mediation Handlers pane.
- Click Add to open the Define
Mediation Handler pane.
- Specify the following properties for the mediation handler:
- Name
- Enter a name for the mediation handler. The name must be unique within
the WebSphere Applications Server administrative cell.
- Description
- Optional: Enter a description of the mediation, taking into account any
properties specified for the mediation.
- Handler class
- Click Browse, next to the Handler Class field,
to display a list of mediation handler classes. Select the mediation handler
class for the mediation.
The parameter list is completed automatically
with parameter names, where appropriate.
- Optional: You can set the mediation parameters to control
the behaviour of the mediation handler at runtime. By default, all the parameters
are selected.
- Optional: If you want to create the mediation handler
in its own handler list, click Finish. By default,
the handler list is created with the same name as the mediation handler.
- Optional: If you want to add your handler to multiple
handler lists, click ShowAdvanced, then select the Define
Handler List Containment check box. This displays the Handler
Lists Containment pane showing which handler lists contain this
handler. Specify the following properties, click Add,
and then Finish to add the mediation handler to the
handler list:
- Handler List Name
- Either select the name of an existing handler list in the list box, or
enter a new name.
- Handler List Description
- Optional: Enter a description of the handler list, for information only.
- Sequence Number
- Specify the position of the mediation handler in the handler list. By
default, a mediation handler is added at the first position, sequence number
0, in the handler list. At runtime, mediation handlers are applied to messages
in order of their sequence numbers. The mediation handler at the lowest sequence
number is applied first. If two handlers have the same sequence numbers, both
will run, but the order will be undetermined.
- If the mediation handler has properties that
are non-primitive types, they are displayed in the Non-primitive
properties page. For each property displayed, select the type
of reference entry to create in the Deployment Entry Type list
box, then click Finish.
- The mediation handler is displayed in the Mediation
handlers pane. You can view or change the properties
and parameters you have defined. For more information about changing handler
lists, mediation parameters, or reference parameters, see Changing
deployment information.
- Select File > Save to
save the mediation handler as an EAR file.
Next, you are ready to export the EAR file to WebSphere Application
Server.