Example usage for org.apache.commons.chain.impl ChainBase ChainBase

List of usage examples for org.apache.commons.chain.impl ChainBase ChainBase

Introduction

In this page you can find the example usage for org.apache.commons.chain.impl ChainBase ChainBase.

Prototype

public ChainBase(Collection commands) 

Source Link

Document

Construct a Chain configured with the specified Command s.

Usage

From source file:com.sf.ddao.chain.MethodInvocationHandler.java

public MethodInvocationHandler(Class<?> iFace, Method method, List<Command> commands) {
    this.iFace = iFace;
    isNullReturnDisallowed = notNullableTypes.contains(method.getReturnType());
    this.method = method;
    this.chain = new ChainBase(commands);
    final Annotation[][] parametersAnnotations = method.getParameterAnnotations();
    for (int i = 0; i < parametersAnnotations.length; i++) {
        for (Annotation parameterAnnotation : parametersAnnotations[i]) {
            if (parameterAnnotation.annotationType().equals(UseContext.class)) {
                contextParamIndex = i;/*w  ww .  ja  v  a  2s  . c  om*/
                return;
            }
        }
    }
}

From source file:ttf.analysis.processor.ChainProcessor.java

@Override
public void process(Article article) throws Exception {
    log.info("Start: " + article);

    Chain chain = new ChainBase(commands);
    AnalysisContext context = contextFactory.build();
    context.setIncomingArticle(article);
    chain.execute(context);/*ww  w. j  a  va2 s . c  om*/
}