Specific How-tos

How to implement and add en extended service to EasyVIPER?

As EasyVIPER is an extensible engine, it is possible to add specific services, thanks to the com.ebmwebsourcing.easyviper.core.api.engine.thread.service.Service interface.
To create a new extended service, the basic thing is to develop a class implementing this interface, and then to add the service to a core instance of EasyVIPER.

A good way to perform this task follows these steps:

  • Create an interface that extends Service with specific operations
MyExtendedService.java
  • Create the class implementing MyExtendedService and extending the utility abstract class AbstractServiceImpl:
MyExtendedServiceImpl.java

The method run() can be filled as in the example for a by default behaviour.

Once done the new MyExtendedServiceImpl service can be added to EasyVIPER core with the following code:

In order to call methods of the extended service you can use the following code:

Finally a good way to conceive an extended service is to start from a formal description of its interface, with a WSDL definition for example.
Then, the corresponding Java interface can be generated thanks to CXF wsdl2java facilities for instance.
The interface of MyExtendedService is then:

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