uk.ac.ncl.cs.instantsoap.servicedp.impl
Class AsynchronousServiceDispatcherImpl

java.lang.Object
  extended by uk.ac.ncl.cs.instantsoap.servicedp.impl.AsynchronousServiceDispatcherImpl
All Implemented Interfaces:
AsynchronousServiceDispatcher

public class AsynchronousServiceDispatcherImpl
extends Object
implements AsynchronousServiceDispatcher

A simple implementation of AsynchronousServiceDispatcher that delegates all the hard work on to a StartegyDispatcher.

Author:
Louis, Matthew Pocock

Nested Class Summary
 class AsynchronousServiceDispatcherImpl.StrategyDispatcherListenerImpl
          StrategyDispatcherListener is implemented as an inner class.
 
Constructor Summary
AsynchronousServiceDispatcherImpl(StrategyDispatcher dispatcher, JobManager jobManager)
           
 
Method Summary
 MetaData describeApplication(String appName)
           
 NonBlockingInvocationResponse getExecutionResult(UUID id)
          Return the result of the jobManager.
 Set<MetaData> getInputs(String application)
           
 Set<MetaData> getOutputs(String application)
           
 UUID invoke(JobSpecification jobSpec)
          Invoke the jobManager.
 List<String> listApplications()
           
 InvocationState pollState(UUID id)
          Poll the state of the invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousServiceDispatcherImpl

public AsynchronousServiceDispatcherImpl(StrategyDispatcher dispatcher,
                                         JobManager jobManager)
Method Detail

listApplications

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

describeApplication

public MetaData describeApplication(String appName)
                             throws UnknownApplicationException
Specified by:
describeApplication in interface AsynchronousServiceDispatcher
Throws:
UnknownApplicationException

invoke

public UUID invoke(JobSpecification jobSpec)
            throws InvalidJobSpecificationException,
                   JobExecutionException,
                   UnknownApplicationException
Description copied from interface: AsynchronousServiceDispatcher
Invoke the jobManager. This should return the SerializableUuid of the jobManager at the earliest opportunity. It should not in general block until the jobManager has completed running. The SerializableUuid returned should be unique.

Specified by:
invoke in interface AsynchronousServiceDispatcher
Parameters:
jobSpec - the JobSpecification of the jobManager to run
Returns:
the SerializableUuid of the jobManager
Throws:
InvalidJobSpecificationException - if the specification is invalid
JobExecutionException - if the execution failed
UnknownApplicationException

pollState

public InvocationState pollState(UUID id)
                          throws UnknownUuidException,
                                 JobExecutionException
Description copied from interface: AsynchronousServiceDispatcher
Poll the state of the invocation. This should return as soon as possible.

Specified by:
pollState in interface AsynchronousServiceDispatcher
Parameters:
id - the SerializableUuid of the jobManager to be polled
Returns:
the state of the jobManager
Throws:
UnknownUuidException - if the uuid is not known by this dispatcher
JobExecutionException - if the job has failed

getExecutionResult

public NonBlockingInvocationResponse getExecutionResult(UUID id)
                                                 throws UnknownUuidException,
                                                        IllegalInvocationStateException,
                                                        JobExecutionException
Description copied from interface: AsynchronousServiceDispatcher
Return the result of the jobManager.

Specified by:
getExecutionResult in interface AsynchronousServiceDispatcher
Returns:
Throws:
UnknownUuidException - if the uuid is not known by this dispatcher
IllegalInvocationStateException - if the job associated with the uuid has not completed
JobExecutionException - if the job has failed

getInputs

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

getOutputs

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


Copyright © 2006-2008. All Rights Reserved.