FlowThread.java :  » Workflow-Engines » bexee » bexee » core » Java Open Source

Java Open Source » Workflow Engines » bexee 
bexee » bexee » core » FlowThread.java
/*
 * $Id: FlowThread.java,v 1.2 2004/12/09 12:34:17 kowap Exp $
 *
 * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
 * Berne University of Applied Sciences
 * School of Engineering and Information Technology
 * All rights reserved.
 */
package bexee.core;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import bexee.model.activity.Activity;

/**
 * This class is used to implement "Flow" BPEL activities. i.e. parallel
 * activity execution.
 * 
 * @author Patric Fornasier
 * @author Pawel Kowalski
 * @version $Revision: 1.2 $, $Date: 2004/12/09 12:34:17 $
 */
public class FlowThread extends Thread {

    private static Log log = LogFactory.getLog(FlowThread.class);

    private ProcessController processController;

    private ProcessInstance processInstance;

    private Activity activity;

    /**
     * Create a new FlowThread with a ProcessController, ProcessInstance and the
     * Activity to be executed.
     * 
     * @param processController
     *            the controller to be passed to the activity
     * @param processInstance
     *            the process instance
     * @param activity
     *            the activity to be executed
     */
    public FlowThread(ProcessController processController,
            ProcessInstance processInstance, Activity activity) {
        this.processController = processController;
        this.processInstance = processInstance;
        this.activity = activity;
    }

    /**
     * The overriden <code>Thread.run()</code> method.
     */
    public void run() {
        try {
            activity.accept(processController, processInstance);
        } catch (Exception e) {
            log.error("Activity execution failed, activity: "
                    + activity.getName());
            e.printStackTrace();
        }
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.