|
Page Edited :
SM :
8. Intermediate - How to write my own binding component
8. Intermediate - How to write my own binding component has been edited by Lars Heinemann (Dec 08, 2008). Content:How to write my own binding component
Prerequisites
GeneralThis tutorial will explain to you how to write your own binding components. What you learn here is also enabling you to write own service engines because the difference between a binding component and a service engine is of pure logical nature. While a binding component is translating data from outside bus to normalized messages used inside the bus and vice versa a service engine is only working inside the bus with normalized messages. Should I really create my own binding component?Before beginning this tutorial, please take the time to read the FAQ entry titled "Should I Create My Own JBI Components?". It is very important that you understand the reason for developing a JBI binding component and this FAQ entry will explain this to you. A very brief introduction to Java Business Integration (JBI)The Java Business Integration (JBI) spec JBI components can be thought of as the smallest applications or services accessible in a service-oriented architecture. Each service has a very specific purpose and therefore a narrow scope and set of functionality. Components come in two flavors:
SU*s must be packaged into a *SA to be deployed to the JBI container. A SA is a complete application consisting of one or more services. By comparison, this is similar to the way that WAR files must be packaged inside of an EAR file to be deployed to a J2EE container. See also the page providing information on working with service units Below some quick definitions which are dominant throughout the JBI spec:
This tutorial focuses on both component architecture and component packaging. For further information and details on JBI, see the following:
Getting started with a BCThis tutorial will explain to you how to create a binding component for the SNMP protocol. If you don't know what this protocol is about, then see for example the SNMP Now let's move on to creating the Maven projects for the SNMP binding component. Creating a Maven project for the JBI BCThe focus of this section is on the creation of a JBI binding component. For this task, a Maven archetype Below are the steps to follow for creating the directory structure and project. All instructions are laid out to take place on a Unix command-line. 1) Create a Maven project named servicemix-snmp and switch to that directory: $ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-project-root \
-DarchetypeVersion=3.2.2 \
-DgroupId=org.apache.servicemix.tutorial.snmp \
-DartifactId=servicemix-snmp-tutorial$ cd servicemix-snmp-tutorial 2. Check the project Maven configuration file Maven created a project folder for you and already setup a project file called pom.xml. As this is not a beginner tutorial I won't explain the file here. $ nano pom.xml You will recognize, that the project file is setup for your purposes already. You normally don't need to change anything in there for the moment. 3) Create the binding component sub project Use the servicemix-binding-component To create the BC, execute the following command on the command-line: $ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-binding-component \
-DarchetypeVersion=3.2.2 \
-DgroupId=org.apache.servicemix.tutorial.snmp \
-DartifactId=snmp-binding
The command above will create a directory named snmp-binding that houses a Maven project for the JBI binding component being created here. The name of the directory is taken from the artifactId parameter. Now switch into the snmp-binding sub folder and open the pom.xml in your editor of choice. We will cleanup the file before proceeding to program code. Do the following things:
An overview of using Maven-based tooling and archetypes to develop a snmp binding component Goals of the documentThis tutorial provides an easy and convenient way for a new user to learn about:
After finishing this tutorial you have a snmp binding component ready to poll devices. Feel free to play around with it and adding improvements. ContentsStart this tutorial
|
Unsubscribe or edit your notifications preferences
