As a developer you have basically two ways in which you can use the OpenEngSB. One option is to use the OpenEngSB as a runtime environment for any project. In addition you've the possibility to write Plug-Ins (Domains, Connectors, ...) for the OpenEngSB. Both cases are explained in this chapter.
To create a new Domain run mvn openengsb:genDomain
(or use ../etc/scripts/gen-domain.sh
)
in the domain
folder.
You will be asked for the name of your domain. Enter the domain name starting with a lower case letter.
For the other questions valid defaults are given.
The new domain project will be added as a submodule. You eventually want to run mvn openengsb:eclipse and import the new project in eclipse.
Add the methods your domain supplies to the domain interface. If your domain raises any events add methods like
void raiseEvent(YourEvent event);
(your event class subtype of Event as single parameter) to the events interface.
To create a new Connector run mvn openengsb:genConnector
(or use ../etc/scripts/gen-connector.sh
) in the connector
folder.
You will be asked for the name of the domain you want to implement. Enter the domain name starting with a lower case letter.
You may adapt the name of the implemented domain interface if you it does not match the naming convention.
Supply the name of the connector staring with a lower case letter.
The new domain project will be added as a submodule. You eventually want to run mvn openengsb:eclipse and import the new project in eclipse.
Implement the domain interface in the supplied class (unfortunately no method stubs are generated).
Unimplemented domain methods should always throw an exception rather than return default value or do nothing. Therefore each domain method without body must throw DomainMethodNotImplementedException to indicate that requested domain functionality is not implemented.
@Override public void foo() { throw new DomainMethodNotImplementedException(); }
The ServiceFactory has to supply a ServiceDescriptor that contains all attributes needed to instanciate the Connector. In the methods createServiceInstance and updateServiceInstance use the provided attributes to create a new new instance or update your Connector. The methods updateValidation and createValidation should do the same but try to validate the provided attributes first and return a validation result.
The generated ServiceManager usually does not have to be changed.