UNPKG

service-model

Version:

An object oriented web service framework inspired by Windows Communication Foundation.

60 lines (59 loc) 2.04 kB
import { ContractDescription } from "./contractDescription"; import { Method } from "reflect-helper"; import { DispatchOperation } from "../dispatcher/dispatchOperation"; /** * A description of a service contract operation. * * <uml> * hide members * hide circle * ContractDescription *-- OperationDescription : operations * OperationDescription *- OperationBehavior : behaviors * OperationDescription *-- Method : method * </uml> */ export declare class OperationDescription { /** * The name of the operation. */ name: string; /** * The contract that owns the operation. */ contract: ContractDescription; /** * A list of behaviors that extend the operation. */ behaviors: OperationBehavior[]; /** * Metadata information for the method that is called by the operation. */ method: Method; /** * Indicates if the operation is one way. If true the dispatcher does not wait for the operation to complete before * sending a response to the client. */ isOneWay: boolean; /** * Timeout for the operation in milliseconds. If not specified defaults to a minute. A value of 0 indicates that operation does not timeout. */ timeout: number; /** * Constructs an [[OperationDescription]]. * @param contract The contract that owns the operation. * @param method The service method that is called by the operation. * @param name The name of the operation. If not specified, defaults to the name of the method. */ constructor(contract: ContractDescription, method: Method, name?: string); } /** * Describes a type that can be used to extend the behavior of an operation. */ export interface OperationBehavior { /** * Applies the a behavior extension to a [[DispatchOperation]]. * @param description A description of the operation. * @param operation The runtime operation. */ applyOperationBehavior(description: OperationDescription, operation: DispatchOperation): void; }