All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.execution.ARunnable Maven / Gradle / Ivy

Go to download

TSL2 Framework Commons (Collections, Actions/Excecution, Readers, Xml, Print, Mail, FuzzyFinder, Proxies, Network-Structure)

There is a newer version: 2.5.2
Show newest version
/*
 * File: $HeadURL$
 * Id  : $Id$
 * 
 * created by: Tom
 * created on: 29.11.2013
 * 
 * Copyright: (c) Thomas Schneider 2013, all rights reserved
 */
package de.tsl2.nano.execution;

import java.io.Serializable;

import de.tsl2.nano.core.execution.ICRunnable;

/**
 * combines the two interfaces {@link ICRunnable} and {@link Runnable} to implement {@link ICRunnable}s usable by
 * {@link Thread}s.
 * 
 * @author Tom
 * @version $Revision$
 */
public abstract class ARunnable implements ICRunnable, Runnable {
    CONTEXT context;
    Object[] args;
    
    /**
     * constructor
     * @param context
     * @param args
     */
    public ARunnable(CONTEXT context, Object[] args) {
        super();
        this.context = context;
        this.args = args;
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public void run() {
        context = run(context, args);
    }
    public void setArgs(Object[] args) {
        this.args = args;
    }
    public CONTEXT getResult() {
        return context;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy