Creating a new DSB Distribution

Adding Core Services

If you want to add your own services, the best way to follow is to create your own 'kernel' which is extending the DSB kernel. Since we are using the Fractal component model in Petals ESB/DSB, you must also use it for your service.

To illustrate this chapter, let's add a simple and powerful service : The HelloWorld Service!

The source code for this illustration is available under the DSB samples folder in SVN at https://svn.petalslink.com/svnroot/trunk/research/commons/dsb/samples

We assume that you are Maven-aware so we do not explain all the commands here... 

Create a new kernel

Create a new project :

and choose groupId:org.petalslink.dsb.sample.custom, artifactId:custom-kernel, version:1.0-SNAPSHOT

Use the dsb-kernel as dependency in your new project POM:

Create the interface

Let's create a new project for the API definition of your service:

and choose groupId:org.petalslink.dsb.sample.custom, artifactId:custom-api, version:1.0-SNAPSHOT

Let's create a simple interface for our Hello service, HelloService.java:

Implement your service

Let's go back to our kernel and add the API as dependency:

Now, let's implement the Hello service, create the HelloServiceImpl in the org.petalslink.dsb.sample.custom.kernel package :

Is it enough? No... Since we use a component framework, we need to add component related configuration and dependencies in our kernel project. Let's add the required Fractal annotations and methods in the service implementation, the updated implementation looks like :

Is it enough? Almost... Let's say to Maven he has to do some extra steps at compilation time:

And add the spoon.cfg.xml at the root level of the custom-kernel project with this content :

Now that we

Create your custom distribution project

We do not have any other way to create a distribution other that cloning some existing distribution and to customize its configuration files. To be faster, clone the default distribution files from the dsb-distribution project located at http://svn.petalslink.org/svnroot/trunk/research/commons/dsb/distributions/dsb-distribution/ into a new custom-distrib folder.

Add your service to the distribution

Now that we have our service API, implemetation and distribution, let's add this service to the software component model. To be simple, let's add it in the top level component described in custom-distrib/src/main/resources/Petals.adl :

Packaging your distribution

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.