Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DispatcherFactory

The DispatcherFactory is the primary class used to configure the service model, and is responsible for creating the RequestDispatcher based on the service descriptions.

Example

Once our service is defined, we add it to a DispatcherFactory. We then add an endpoint to the service, providing the name of the contract, the base address for the endpoint, and a list of endpoint behaviors.

import { DispatcherFactory, RpcBehavior } from "service-model";

var factory = new DispatcherFactory();

factory.addService(CalculatorService)
            .addEndpoint("Calculator", "/api/calculator", [new RpcBehavior()]);

In this case, we add the RpcBehavior which indicates that operations on this endpoint will be available through RPC.

Hierarchy

  • DispatcherFactory

Index

Properties

Methods

Properties

services

services: ServiceDescription[]

List of service descriptions configured for the dispatcher factory.

Methods

addService

createDispatcher

Generated using TypeDoc