org.camunda.bpm.connect.impl
Class AbstractConnector<T extends ConnectorRequest<?>,R extends ConnectorResponse>

java.lang.Object
  extended by org.camunda.bpm.connect.impl.AbstractConnector<T,R>
All Implemented Interfaces:
Connector<T>

public abstract class AbstractConnector<T extends ConnectorRequest<?>,R extends ConnectorResponse>
extends Object
implements Connector<T>

Abstract implementation of the connector interface. This implementation provides a linked list of interceptors and related methods for handling interceptor invocation.

Author:
Daniel Meyer

Field Summary
protected  List<RequestInterceptor> requestInterceptors
          The RequestInterceptor chain
 
Constructor Summary
AbstractConnector()
           
 
Method Summary
 void addRequestInterceptor(RequestInterceptor interceptor)
          Adds a RequestInterceptor to this connector.
abstract  R execute(T request)
          Execute the request on the connector.
 List<RequestInterceptor> getRequestInterceptors()
          Returns the RequestInterceptor chain for this connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.camunda.bpm.connect.Connector
createRequest, getId
 

Field Detail

requestInterceptors

protected List<RequestInterceptor> requestInterceptors
The RequestInterceptor chain

Constructor Detail

AbstractConnector

public AbstractConnector()
Method Detail

getRequestInterceptors

public List<RequestInterceptor> getRequestInterceptors()
Description copied from interface: Connector
Returns the RequestInterceptor chain for this connector. The implementation will return the actual list, modifications on the list will be reflected in the internal connector state. This means that you can use the returned list to modify the connector's RequestInterceptor chain.

Specified by:
getRequestInterceptors in interface Connector<T extends ConnectorRequest<?>>
Returns:
the list of interceptors.

addRequestInterceptor

public void addRequestInterceptor(RequestInterceptor interceptor)
Description copied from interface: Connector
Adds a RequestInterceptor to this connector. The interceptor is added at the end of the interceptor chain. The interceptor is invoked for all requests created by the connector.

Specified by:
addRequestInterceptor in interface Connector<T extends ConnectorRequest<?>>

execute

public abstract R execute(T request)
Execute the request on the connector.

Parameters:
request - the request
Returns:
the result.


Copyright © 2014 camunda services GmbH. All Rights Reserved.