Quantcast
Channel: SCN : Document List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 571

Demystifying Custom Adapter Development: Part 1b - Cloning the Sample JCA Adapter

$
0
0

The following steps are continued from Demystifying Custom Adapter Development: Part 1a - Cloning the Sample JCA Adapter.

 

 

Step 4 - Creating the Adapter Metadata in ESR

Next we will import the Adapter Metadata into the ESR.

 

i) Update JNDIName in the metadata file

SampleRA.xml is the Adapter Metadata file which was extracted from the XIAF SCA file (in Step 1 - ii).

Update the JNDIName value following the name of the Java Project (in Step 2 - i).

adapter_metadata.png

 

ii) Create Adapter Metadata object in ESR

Create a new namespace in ESR and then create a new Adapter Metadata object. The combination of adapter name and namespace must match exactly the values used in Step 3 - ii above.

metadata.png

 

Upon creation of the object, it will provide a default metadata. Overwrite this metadata by importing the modified SampleRA.xml above.

import.png

 

Activate the new metadata object.

metadata2.png

 

 

Step 5 - Building and Deploying the Adapter

We are now ready to build and deploy the adapter!

 

i) Export JAR file for Java project

Firstly, we export the JAR file of the Java project. The destination of the export will be the connectorModule folder of the RAR project.

export_jar1.png

 

Once the export is completed, refresh the RAR project and verify that the JAR file is in the connectorModule folder.

export_jar2_1.png

 

ii) Export RAR file for RAR project

Right click on the RAR project and export it as a RAR file.

exp_rar1.png

 

The destination will be the root folder of the RAR project itself.

exp_rar2_2.png

 

Once the export is completed, refresh the RAR project and verify that the RAR file is available.

export_rar1.png

 

iii) Deploy the RAR file to the SAP AS Java server

Prior to deployment, make sure that the AS Java server is configured under Windows > Preferences > SAP As Java.

 

Switch to the Deployment perspective. Click Import and select the RAR file from the workspace.

dep_import2.png

import_rar2.png

 

Click Start to begin deployment of the RAR file.

start_deploy2.png

 

Upon completion, the following pop up dialog will display the result of the successful deployment.

succ_deploy.png

 

iv) Verify deployment was successful

We can verify that the deployment was really successful with the following tools.

 

Go to NWA > Troubleshooting > Logs and Traces > Log Viewer. Check that the following errors are generated - they are just sample messages and can be ignored.

log_viewer.png

 

Go to NWA > Configuration > Infrastructure > Application Modules. Enter the filters for Type and Application to verify that the resource adapter is available.

apps.png

 

Go to NWA > Troubleshooting > Java > JNDI Browser. Navigate to the deployedAdapters folder and verify that the JNDI object name is correctly registered. The JNDI name specified in the Adapter Metadata must match this value.

jndi_browser.png

 

Go to NWA > Operations > System > Start & Stop. Select Java Applications tab and filter by the adapter name. Check that the application status is started.

started.png

 

 

Step 6 - Using the Adapter in a Communication Channel

After successful deployment, we can create communication channels using this new adapter.

 

Select the Adapter from the list of adapter and populate all the mandatory fields.

channel.png

 

Activate the channel and check that it's successful in the Communication Channel Monitor.

 

Ta-daaaa!

monitor.png

 

This channel can then be used in an integration scenario as per normal configuration. However, usage of this channel which is based on the sample adapter's behavior will not be covered here.

 

 

Conclusion

As shown above, with clear and concise steps, we are able to setup the projects in NWDS correctly to build and deploy a clone copy of the sample JCA adapter. Communication channels can then be created to use this adapter in integration scenarios. The sample JCA adapter provides some simple logic to connect to the file system of the PI system.

 

This clone adapter forms the basis for the subsequent posts in this series. We will look at the different aspects of the development, and aim to change the logic and behavior of the adapter according for an example requirement.

 

In the next post we will be examining the source codes of the custom adapter, looking at some of the key classes and methods in order to understand the behavior of the adapter. Watch this space!


Viewing all articles
Browse latest Browse all 571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>