PHP 클래스 Prado\Web\Services\TRpcService

The TRpcService class is a generic class that can be extended and used to implement rpc services using different servers and protocols. A server is a {@link TModule} that must subclass {@link TRpcServer}: its role is to be an intermediate, moving data between the service and the provider. The base {@link TRpcServer} class should suit the most common needs, but can be sublassed for logging and debugging purposes, or to filter and modify the request/response on the fly. A protocol is a {@link TModule} that must subclass {@link TRpcProtocol}: its role is to implement the protocol that exposes the rpc api. Prado already implements two protocols: {@link TXmlRpcProtocol} for Xml-Rpc request and {@link TJsonRpcProtocol} for JSON-Rpc requests. A provider is a {@link TModule} that must subclass {@link TRpcApiProvider}: its role is to implement the methods that are available through the api. Each defined api must be a sublass of the abstract class {@link TRpcApiProvider} and implement its methods. The flow of requests and reponses is the following: Request <-> TRpcService <-> TRpcServer <-> TRpcProtocol <-> TRpcApiProvider <-> Response To define an rpc service, add the proper application configuration: An api can be registered adding a proper definition inside the service configuration. Each api definition must contain an id property and a class name expressed in namespace format. When the service receives a request for that api, the specified class will be instanciated in order to satisfy the request.
부터: 3.2
저자: Robin J. Rogge ([email protected])
상속: extends Prado\TService
파일 보기 프로젝트 열기: pradosoft/prado

보호된 프로퍼티들

프로퍼티 타입 설명
$apiProviders containing API provider and their configured properties
$protocolHandlers containing mimetype to protocol handler mappings

공개 메소드들

메소드 설명
createApiProvider ( TRpcProtocol $protocolHandler, string $providerId ) Creates the API provider instance for the current request
init ( TXmlElement $config ) Initializes the service
loadConfig ( TXmlElement $xml ) Loads the service configuration
run ( ) Runs the service

메소드 상세

createApiProvider() 공개 메소드

Creates the API provider instance for the current request
public createApiProvider ( TRpcProtocol $protocolHandler, string $providerId )
$protocolHandler TRpcProtocol instance
$providerId string

init() 공개 메소드

Initializes the service
public init ( TXmlElement $config )
$config Prado\Xml\TXmlElement containing the module configuration

loadConfig() 공개 메소드

Loads the service configuration
public loadConfig ( TXmlElement $xml )
$xml Prado\Xml\TXmlElement configuration

run() 공개 메소드

Runs the service
public run ( )

프로퍼티 상세

$apiProviders 보호되어 있는 프로퍼티

containing API provider and their configured properties
protected $apiProviders

$protocolHandlers 보호되어 있는 프로퍼티

containing mimetype to protocol handler mappings
protected $protocolHandlers