uk.ac.ncl.cs.instantsoap.strategydp.impl
Class QueuedDispatcher

java.lang.Object
  extended by uk.ac.ncl.cs.instantsoap.strategydp.impl.QueuedDispatcher
All Implemented Interfaces:
StrategyDispatcher

public class QueuedDispatcher
extends Object
implements StrategyDispatcher

Asynchronously dispatches jobs to an underlying dispatcher, using an ExecutorService to manage the running of the tasks.

Author:
Matthew Pocock

Nested Class Summary
 
Nested classes/interfaces inherited from interface uk.ac.ncl.cs.instantsoap.strategydp.StrategyDispatcher
StrategyDispatcher.ValidatedJob
 
Constructor Summary
QueuedDispatcher(StrategyDispatcher delegate, LoggingQueue<UUID> queue)
           
 
Method Summary
 MetaData describeApplication(String application)
           
 Set<MetaData> getInputs(String application)
           
 Set<MetaData> getOutputs(String application)
           
 boolean handlesApplication(String application)
           
 List<String> listApplications()
           
 StrategyDispatcher.ValidatedJob validateJob(JobSpecification specification)
          Ensure that the jobManager specification can be dispatched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueuedDispatcher

public QueuedDispatcher(StrategyDispatcher delegate,
                        LoggingQueue<UUID> queue)
Method Detail

handlesApplication

public boolean handlesApplication(String application)
Specified by:
handlesApplication in interface StrategyDispatcher

listApplications

public List<String> listApplications()
Specified by:
listApplications in interface StrategyDispatcher

describeApplication

public MetaData describeApplication(String application)
                             throws UnknownApplicationException
Specified by:
describeApplication in interface StrategyDispatcher
Throws:
UnknownApplicationException

getInputs

public Set<MetaData> getInputs(String application)
                        throws UnknownApplicationException
Specified by:
getInputs in interface StrategyDispatcher
Throws:
UnknownApplicationException

getOutputs

public Set<MetaData> getOutputs(String application)
                         throws UnknownApplicationException
Specified by:
getOutputs in interface StrategyDispatcher
Throws:
UnknownApplicationException

validateJob

public StrategyDispatcher.ValidatedJob validateJob(JobSpecification specification)
                                            throws InvalidJobSpecificationException,
                                                   UnknownApplicationException
Description copied from interface: StrategyDispatcher
Ensure that the jobManager specification can be dispatched.

If there is no handler for this jobManager, or if it is malformed, then an InvalidJobSpecificationException should be raised. Otherwise, this should chain on to the right handler's validateJob() method. Once validated, this returns a ValidatedJob that can be used to run the jobManager specification any number of times.

Specified by:
validateJob in interface StrategyDispatcher
Parameters:
specification - the JobSpecification describing what to validate
Returns:
the validated job, ready to run
Throws:
InvalidJobSpecificationException - if the JobSpecification is not for something we can run, or if it is mal-formed in some way
UnknownApplicationException - if the application named by the specification is not known


Copyright © 2006-2008. All Rights Reserved.