service-model
Version:
An object oriented web service framework inspired by Windows Communication Foundation.
37 lines (36 loc) • 1.11 kB
JavaScript
var url_1 = require("../url");
/**
* A description of a service endpoint.
*
* <uml>
* hide members
* hide circle
* ServiceDescription *-- EndpointDescription : endpoints
* EndpointDescription *-- ContractDescription : contract
* Url -* EndpointDescription : address
* EndpointDescription *- EndpointBehavior : behaviors
* </uml>
*/
var EndpointDescription = (function () {
/**
* Constructs an [[EndpointDescription]]
* @param contract The contract for the endpoint.
* @param address The base address for the endpoint.
*/
function EndpointDescription(contract, address) {
/**
* A list of behaviors that extend the service endpoint.
*/
this.behaviors = [];
if (!contract) {
throw new Error("Missing required argument 'contract'.");
}
if (!address) {
throw new Error("Missing required argument 'address'.");
}
this.address = new url_1.Url(address);
this.contract = contract;
}
return EndpointDescription;
})();
exports.EndpointDescription = EndpointDescription;