uk.ac.ncl.cs.instantsoap.mapprocessor
Class MultiplexingMapProcessor

java.lang.Object
  extended by uk.ac.ncl.cs.instantsoap.mapprocessor.MultiplexingMapProcessor
All Implemented Interfaces:
MapProcessor

public class MultiplexingMapProcessor
extends Object
implements MapProcessor

Multiplex over a set of map processors.

Incomming requests are routed through to the underlying processor that can handle that request. The requests taht this processor can handle is the union of those that all of the underlying processors can.

Author:
Matthew Pocock

Constructor Summary
MultiplexingMapProcessor()
           
MultiplexingMapProcessor(Set<MapProcessor> processors)
          Create a new processor that multiplexes over the supplied processors.
 
Method Summary
 void deRegisterHandler(MapProcessor processor)
           
 MetaData describeApplication(String application)
          Describe an application.
 Set<MetaData> getInputs(String application)
          Get the inputs assocaited with an application.
 Set<MetaData> getOutputs(String application)
          Get the outputs assocaited with an application.
 boolean handlesApplication(String application)
          Indicates if this processor can handle applications with a particuar name.
 List<String> listApplications()
          List all of the applications handled, by name.
 Map<String,String> process(String application, Map<String,String> inputs)
          Handle a request.
 void registerHandler(MapProcessor processor)
           
 void validate(String application, Map<String,String> inputs)
          Validate the inputs for the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplexingMapProcessor

public MultiplexingMapProcessor(Set<MapProcessor> processors)
Create a new processor that multiplexes over the supplied processors.

Parameters:
processors - the Set of MapProcessor instances that will be used to handle requests

MultiplexingMapProcessor

public MultiplexingMapProcessor()
Method Detail

registerHandler

public void registerHandler(MapProcessor processor)

deRegisterHandler

public void deRegisterHandler(MapProcessor processor)

handlesApplication

public boolean handlesApplication(String application)
Description copied from interface: MapProcessor
Indicates if this processor can handle applications with a particuar name.

This must return true for exactly those application names listed in listApplicaionts.

Specified by:
handlesApplication in interface MapProcessor
Parameters:
application - the name of the application to be checked
Returns:
true if the application can be handled, false otherwise

listApplications

public List<String> listApplications()
Description copied from interface: MapProcessor
List all of the applications handled, by name.

Specified by:
listApplications in interface MapProcessor
Returns:
the List of handled applications

describeApplication

public MetaData describeApplication(String application)
                             throws UnknownApplicationException
Description copied from interface: MapProcessor
Describe an application.

Specified by:
describeApplication in interface MapProcessor
Parameters:
application - the name of the application
Returns:
the MetaData with the name matching application providing the description and semantic annotation for this application
Throws:
UnknownApplicationException

process

public Map<String,String> process(String application,
                                  Map<String,String> inputs)
                           throws JobExecutionException,
                                  UnknownApplicationException
Description copied from interface: MapProcessor
Handle a request.

Specified by:
process in interface MapProcessor
Parameters:
application - the name of the application
inputs - the input Map
Returns:
the result of processing the request
Throws:
JobExecutionException
UnknownApplicationException

validate

public void validate(String application,
                     Map<String,String> inputs)
              throws InvalidJobSpecificationException,
                     UnknownApplicationException
Description copied from interface: MapProcessor
Validate the inputs for the application.

Specified by:
validate in interface MapProcessor
Parameters:
application - the name of the application
inputs - the Map of input values
Throws:
InvalidJobSpecificationException
UnknownApplicationException

getInputs

public Set<MetaData> getInputs(String application)
                        throws UnknownApplicationException
Description copied from interface: MapProcessor
Get the inputs assocaited with an application.

Specified by:
getInputs in interface MapProcessor
Parameters:
application - the name of the application
Returns:
the application inputs as a Set of MetaData instances
Throws:
UnknownApplicationException

getOutputs

public Set<MetaData> getOutputs(String application)
                         throws UnknownApplicationException
Description copied from interface: MapProcessor
Get the outputs assocaited with an application.

Specified by:
getOutputs in interface MapProcessor
Parameters:
application - the name of the application
Returns:
the application outputs as a Set of MetaData instances
Throws:
UnknownApplicationException


Copyright © 2006-2008. All Rights Reserved.