Adapter Services
Overview
The following sections describe how to configure adapter services that you use to access the business methods exposed on the EJBs.
You can configure the following types of services for use with Adapter for EJB:
- CreateEJB 2.1. See Configuring CreateEJB 2.1 Services.
- InvokeEJB 2.1. See Configuring InvokeEJB 2.1 Services.
- CreateInvokeEJB 2.1. See Configuring CreateInvokeEJB 2.1 Services.
- FetchEJB 3.0. See Configuring FetchEJB 3.0 Services.
- InvokeEJB 3.0. See Configuring InvokeEJB 3.0 Services.
- FetchInvokeEJB 3.0. See Configuring FetchInvokeEJB 3.0 Services. Note: The 2.1 services, namely, CreateEJB 2.1, InvokeEJB 2.1, and CreateInvokeEJB 2.1 are used with EJB 2.1 or earlier versions. All the 3.0 services, namely, FetchEJB 3.0, InvokeEJB 3.0, and FetchInvokeEJB 3.0 are used only with EJB 3.0.
For a description of the adapter services, see Adapter Services. For information about using adapter services you create in a flow service, see Creating Flows for Adapter for EJB Services.
Before Configuring or Managing Adapter Services
About this task
To prepare to configure or manage an Adapter for EJB service
Procedure
Configuring CreateEJB 2.1 Services
About this task
A CreateEJB 2.1 adapter service invokes a specific EJB creator or finder method on the EJB's remote home interface. For more information about the template used to create these services, see CreateEJB 2.1 Adapter Service. For more information about adapter services, see Adapter Services.
To configure a CreateEJB 2.1 adapter service
Procedure
Configuring InvokeEJB 2.1 Services
About this task
An InvokeEJB 2.1 adapter service invokes one or more methods on a single remote EJB reference. For more information about the template used to create these services, see InvokeEJB 2.1 Adapter Service. For more information about adapter services, see Adapter Services.
To configure an InvokeEJB 2.1 service
Procedure
Configuring CreateInvokeEJB 2.1 Services
About this task
A CreateInvokeEJB 2.1 adapter service combines the functionality of a CreateEJB 2.1 service and an InvokeEJB 2.1 service, enabling you to create one or more instances of a single EJB class and then invoke a single method on those instances. Additionally, a CreateInvokeEJB 2.1 service automatically calls the EJB-standard remove() method to release each session EJB instance. For more information about the template used to create these services, see CreateInvokeEJB 2.1 Adapter Service. For more information about adapter services, see Adapter Services. For more information about the RemoveEJB service, see Removing EJBs.
To configure a CreateInvokeEJB 2.1 service
Procedure
Configuring FetchEJB 3.0 Services
About this task
A FetchEJB 3.0 adapter service invokes a specific EJB finder method on the EJB's remote interface. For more information about the template used to create these services, see FetchEJB 3.0 Adapter Service. For more information about adapter services, see Adapter Services. For more information about the RemoveEJB service, see Removing EJBs.
To configure a FetchEJB 3.0 adapter service
Procedure
Configuring InvokeEJB 3.0 Services
About this task
An InvokeEJB 3.0 adapter service invokes one or more methods on a single remote EJB reference. For more information about the template used to create these services, see InvokeEJB 3.0 Adapter Service. For more information about adapter services, see Adapter Services. For more information about the RemoveEJB service, see Removing EJBs.
To configure an InvokeEJB 3.0 service
Procedure
Configuring FetchInvokeEJB 3.0 Services
About this task
A FetchInvokeEJB 3.0 adapter service combines the functionality of a FetchEJB 3.0 service and an InvokeEJB 3.0 service, enabling you to create one or more instances of a single EJB class and then invoke a single method on those instances. Additionally, a FetchEJB 3.0 service automatically calls the EJB-standard remove() method to release each session EJB instance. For more information about the template used to create these services, see FetchInvokeEJB 3.0 Adapter Service. For more information about adapter services, see Adapter Services. For more information about the RemoveEJB service, see Removing EJBs.
To configure a FetchInvokeEJB 3.0 service
Procedure
Removing EJBs
Adapter for EJB also provides a non-configurable built-in service, RemoveEJB. The RemoveEJB service is packaged with Adapter for EJB and is available in the adapter's public namespace at pub.ejbadapter.removeEJB.
RemoveEJB is a generic non-configurable service that takes an EJB Handle as its only parameter and invokes the EJB-standard remove() method on the EJB object represented by that handle. If successful, RemoveEJB produces no output whatsoever. If it fails, it throws an AdapterServiceException.
To control the remote EJB's life-cycle, call the RemoveEJB service from a flow service to inform the application server that a particular EJB is no longer being used by the client. This is most important when dealing with stateful or entity EJBs.
Calling the RemoveEJB service on an EJB has slightly different consequences depending upon the type of that EJB:
- For stateful session EJBs, its effect is to signal the end of the session to the application server.
- For entity EJBs, the RemoveEJB service causes the underlying entity to be removed from the EJB container. For example, CreateEJB 2.1 is used to create a new entity EJB, which may result in the application server creating a new row in a table to hold that EJB's state. Subsequently passing the Handle of that EJB to the RemoveEJB service causes the application server to delete that row from the table.
- For stateless session EJBs, it has no effect in the client. RemoveEJB simply notifies the application server that it is no longer using the EJB so that the server may, at its discretion, perform any housekeeping tasks.
The application server determines how and when the tasks above occur. If the client invokes the RemoveEJB service against an entity EJB, the client should consider that EJB to be deleted even if the application server does not actually delete the EJB at that point in time.
Testing Adapter Services
About this task
You use Designer to test adapter services. For information about testing and debugging services, see the IBM webMethods Service Development Help for your release.
To test an adapter service
Procedure
Viewing Adapter Services
About this task
You use Designer to view adapter services.
To view an adapter service
Procedure
Editing Adapter Services
About this task
To edit an adapter service
Procedure
Deleting Adapter Services
About this task
You use Designer to delete adapter services.
To delete an adapter service
Procedure
- Review the steps in Before Configuring or Managing Adapter Services.
- In Designer, expand the package and folder that contain the service you want to delete.
- Right-click the service and click Delete.
Validating Adapter Service Values
About this task
Designer enables Adapter for EJB to validate user-defined data for adapter services at design time. You can validate the values for a single adapter service or you can configure Designer to always validate the values for adapter services. Both options could potentially slow your design-time operations.
When you enable data validation for a single adapter service, Designer compares the service values against the resource data that has already been fetched from the selected adapter.
If you select the option to always validate values for adapter services, it will do so for all webMethods 6.x adapters installed on Integration Server.
For more information about the Adapter Service/Notification Editorand other Designer menu options and toolbar icons, see the IBM webMethods Service Development Help for your release.
Enabling Automatic Data Validation for a Single Adapter Service
About this task
To enable automatic data validation for a single adapter service
Procedure
Validating Adapter Service Values for all Adapter Services
About this task
To validate adapter service values for all adapter services
Procedure
- Review the steps in Before Configuring or Managing Adapter Services.
- Start Designer.
- Select the Window > Preferences >IBM> Service Development > Adapter Service/Notification Editor item.
- Enable the Automatic data validation option.
- Click OK.
Reloading Adapter Values
Designer enables Adapter for EJB to reload and validate user-defined data for adapter services at design time. You can reload values for a single adapter service or you can configure Designer so it automatically reloads the values for adapter services. Both options could potentially slow your design-time operations.
When you reload adapter values for a single adapter service, Designer compares the service values against the resource data that has already been fetched from the selected adapter.
If you select the option to always reload values for adapter services, it will do so for all webMethods 6.x adapters installed on Integration Server.
For more information about the Adapter Service/Notification Editor, other menu options, and toolbar icons, see the IBM webMethods Service Development Help for your release.
Reloading Adapter Values for a Single Adapter Service
About this task
To reload the adapter values for a single adapter service
Procedure
Reloading Adapter Values for all Adapter Services
About this task
To reload the adapter values for all adapter services
Procedure
- Review the steps in Before Configuring or Managing Adapter Services.
- Start Designer.
- Select the Window > Preferences > IBM > Service Development > Adapter Service/Notification Editor item.
- Enable the Automatic polling of adapter metadata option.
- Click OK.