org.camunda.connect.impl
Class AbstractRequestInvocation<T>

java.lang.Object
  extended by org.camunda.connect.impl.AbstractRequestInvocation<T>
All Implemented Interfaces:
ConnectorInvocation

public abstract class AbstractRequestInvocation<T>
extends Object
implements ConnectorInvocation

A simple invocation implementation routing a request through a chain of interceptors. Implementations must implement the invokeTarget() method in order to implement the actual request execution / target invocation.

Author:
Daniel Meyer

Field Summary
protected  int currentIndex
           
protected  List<ConnectorRequestInterceptor> interceptorChain
           
protected  ConnectorRequest<?> request
           
protected  T target
           
 
Constructor Summary
AbstractRequestInvocation(T target, ConnectorRequest<?> request, List<ConnectorRequestInterceptor> interceptorChain)
           
 
Method Summary
 ConnectorRequest<?> getRequest()
          The connector request as created through the API.
 T getTarget()
          The underlying raw request.
abstract  Object invokeTarget()
           
 Object proceed()
          Makes the request proceed through the interceptor chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected T target

currentIndex

protected int currentIndex

interceptorChain

protected List<ConnectorRequestInterceptor> interceptorChain

request

protected ConnectorRequest<?> request
Constructor Detail

AbstractRequestInvocation

public AbstractRequestInvocation(T target,
                                 ConnectorRequest<?> request,
                                 List<ConnectorRequestInterceptor> interceptorChain)
Method Detail

getTarget

public T getTarget()
Description copied from interface: ConnectorInvocation
The underlying raw request.

Specified by:
getTarget in interface ConnectorInvocation
Returns:
the raw request as executed by the connector

getRequest

public ConnectorRequest<?> getRequest()
Description copied from interface: ConnectorInvocation

The connector request as created through the API. Accessing the request from an interceptor may be useful for setting additional properties on the raw request (returned by ConnectorInvocation.getTarget()) that are not supported by the connector.

NOTE: setting parameters on the request (via) ConnectorRequest.setRequestParameter(String, Object) will not have any effects once the request is executed.

Specified by:
getRequest in interface ConnectorInvocation
Returns:
the connector request

proceed

public Object proceed()
               throws Exception
Description copied from interface: ConnectorInvocation
Makes the request proceed through the interceptor chain. ConnectorRequestInterceptor implementations are responsible for calling this method on the invocation.

Specified by:
proceed in interface ConnectorInvocation
Returns:
the result of the invocation.
Throws:
Exception

invokeTarget

public abstract Object invokeTarget()
                             throws Exception
Throws:
Exception


Copyright © 2014 camunda services GmbH. All rights reserved.