-
Notifications
You must be signed in to change notification settings - Fork 18
Exporting services
lukaszPulawski edited this page May 26, 2015
·
2 revisions
There is only one way of registering a service in the registry server. You can use @Publish annotation for this purpose:
@Service
@Publish
public class MyServiceImpl implements MyService {
A default behavior of @Publish annotation is that the first interface implemented by a bean (here: MyService) is considered a service contract and with use of this contract, the service is registered in the service registry.
If you want to control a contract used for registering the service, you can parametrize the anntation:
@Service
@Publish(MyService.class)
public class MyServiceImpl implements FirstService, SecondService, MyService {
By doing so, you explicitly point an interface that will be considered a service contract and used for registry and discovery.