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. First let's add all the dependencies we need in the POM file :

Let's rebuild the project with 'mvn eclipse:eclipse' in order to have a good classpath...
Now, 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 :

Create your custom distribution

Add your service to the distribution

Packaging your distribution

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