...
This 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 http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol SNMP Wikipedia entry for further details. As a first step we will only create a snmp polling service. Once you understand how to do this, you will be able to go further and create also a sender service but this will be not done inside this tutorial for now.
...
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 directory Maven project named servicemix-snmp
and switch to that directory:
Code Block |
---|
$ mkdir 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. Setup a 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.
Open up the pom.xml file in your favorite editor and look at the content if everything is like you want it to be.
Code Block |
---|
$ 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 Maven archetype to generate a Maven project for the component.
To create a the BC, execute the following command on the command-line:
Panelcode |
---|
$ mvn archetype:create\ \ -DarchetypeGroupId=org.apache.servicemix.tooling \ -DarchetypeArtifactId=servicemix-binding-component \ -DarchetypeVersion=3.2.1 \ 2 \ -DgroupId=org.apache.servicemix.samples.helloworld.bc \ tutorial.snmp \ -DartifactId=hello-world-bc snmp-binding
|
The command above will create a directory named hellosnmp-world-bcbinding
that houses a Maven project for the JBI service engine 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:
- we already defined repositories in project root pom, so you can safely discard the repository entries in the BC's pom.xml
- fill in a proper name for the binding component in the name tag
Note | ||
---|---|---|
| ||
|
...