public class ServiceRequestExecutorImpl extends Object implements IServiceRequestExecutor
IServiceConnector.
- Invoke handler set on streamHandler(IAsyncHandler) chunks stream
through request chain, into connector).
- Invoke and evaluate response chain.
- Return results via resultHandler.
In the case of failure, the resultHandler is called at the earliest
opportunity.| Constructor and Description |
|---|
ServiceRequestExecutorImpl(io.apiman.gateway.engine.beans.ServiceRequest serviceRequest,
IAsyncResultHandler<IEngineResult> resultHandler,
IRegistry registry,
IPolicyContext context,
IPolicyFactory policyFactory,
IConnectorFactory connectorFactory,
IMetrics metrics)
Constructs a new
ServiceRequestExecutorImpl. |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Execute the policy chain and request.
|
protected void |
handleStream()
Called when the service connector is ready to receive data from the inbound
client request.
|
boolean |
isFinished()
Policy request-response sequence has completed.
|
protected void |
recordErrorMetrics(Throwable error) |
protected void |
recordFailureMetrics(io.apiman.gateway.engine.beans.PolicyFailure failure) |
protected void |
recordSuccessMetrics(io.apiman.gateway.engine.beans.ServiceResponse response) |
void |
streamHandler(IAsyncHandler<ISignalWriteStream> handler)
Indicates when the back-end connector is ready to handle streamed data.
|
protected void |
validateRequest(io.apiman.gateway.engine.beans.ServiceRequest request)
Validates that the contract being used for the request is valid against the
service information included in the request.
|
public ServiceRequestExecutorImpl(io.apiman.gateway.engine.beans.ServiceRequest serviceRequest,
IAsyncResultHandler<IEngineResult> resultHandler,
IRegistry registry,
IPolicyContext context,
IPolicyFactory policyFactory,
IConnectorFactory connectorFactory,
IMetrics metrics)
ServiceRequestExecutorImpl.serviceRequest - the service requestresultHandler - the result handlerregistry - the registrycontext - the contextpolicyFactory - the policy factoryconnectorFactory - the connector factorymetrics - the metrics instanceprotected void recordSuccessMetrics(io.apiman.gateway.engine.beans.ServiceResponse response)
response - protected void recordFailureMetrics(io.apiman.gateway.engine.beans.PolicyFailure failure)
failure - protected void recordErrorMetrics(Throwable error)
error - public void execute()
IServiceRequestExecutorexecute in interface IServiceRequestExecutorIServiceRequestExecutor.execute()protected void validateRequest(io.apiman.gateway.engine.beans.ServiceRequest request)
throws io.apiman.gateway.engine.beans.exceptions.InvalidContractException
request - io.apiman.gateway.engine.beans.exceptions.InvalidContractExceptionprotected void handleStream()
public boolean isFinished()
IServiceRequestExecutorisFinished in interface IServiceRequestExecutorIServiceRequestExecutor.isFinished()public void streamHandler(IAsyncHandler<ISignalWriteStream> handler)
IServiceRequestExecutorstreamHandler in interface IServiceRequestExecutorIServiceRequestExecutor.streamHandler(io.apiman.gateway.engine.async.IAsyncHandler)Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.