Skip to content

Defining Endpoint Contracts

sahan edited this page Jan 14, 2013 · 21 revisions

######The intended use of an endpoint contract is to identify a set of remote services and provide information for successful communication.
You start off by defining and exact copy (mirror) of the endpoint, with all its public methods (services), on a single interface. This interface is then annotated to provide information (metadata) on how to reach the endpoint services and communicate with them using data structures & a common format which both ends understand.

Almost all usage of the ZombieLink API revolves around this set of annotations for populating endpoint metadata.

####1. Identifying Endpoints

  • The @Endpoint annotation is used to mark interfaces which specify contracts for remote endpoints.
  • It takes a mandatory host parameter which specifies the target endpoint host-name for all service invocations.
@Endpoint("www.google.com")
public interface CurrencyConverterEndpoint {}
  • It can be optionally configured to use a different scheme and port, along with a root-path.
@Endpoint(scheme = "https", value = "www.google.com", port = "443", path = "/ig/calculator")
public interface CurrencyConverterEndpoint {}

Clone this wiki locally