org.semanticweb.elk.util.concurrent.computation
Interface InputProcessor<J>

Type Parameters:
J - the type of the jobs to be submitted and processed
All Known Implementing Classes:
BaseInputProcessor, DelegatingInputProcessor

public interface InputProcessor<J>

An abstract interface for submitting and processing jobs of a certain type. It has a method for submitting jobs and processing of the submitted jobs, which are typically executed from concurrently running workers.

Author:
"Yevgeny Kazakov"

Method Summary
 void finish()
          Indicate that processing of the input is finished.
 void process()
          Process all currently submitted jobs.
 void submit(J job)
          Submit a job to be processed by this manager.
 

Method Detail

submit

void submit(J job)
Submit a job to be processed by this manager. This method can never fail or be interrupted.

Parameters:
job - the job to be submitted

process

void process()
             throws InterruptedException
Process all currently submitted jobs. This method is intended to be executed from several threads, therefore it is not guaranteed that all jobs will be processed when the method terminates.

Throws:
InterruptedException - if interrupted during processing

finish

void finish()
Indicate that processing of the input is finished. This method should be eventually called after every call of process() (but it is not necessary that every call of process() should be followed by finish()).



Copyright © 2011-2013 Department of Computer Science, University of Oxford. All Rights Reserved.