uk.ac.soton.itinnovation.grid.client.helpers
Class RegistrySearchPathBuilder

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.client.helpers.RegistrySearchPathBuilder

public class RegistrySearchPathBuilder
extends Object

Helper class to build registry search paths. A DefaultInvocationEngine has a search path of registries to search when making an invocation. Because of the recursive nature of registry searches, some care is needed when the search path includes remote registries. In particular, the search path used when accessing a registry must not include the registry itself. This class creates the remote registry proxies with suitable search paths.


Constructor Summary
RegistrySearchPathBuilder(Map<Class,Class<? extends ProxyHelpers>> helperRegistry, WSDLCache wsdlCache)
          Constructor.
 
Method Summary
 void addAllKnownRegistriesToSelectedRegistries(DefaultInvocationEngine engine)
           
 void addRemoteRegistryToSelectedRegistries(DefaultInvocationEngine engine, org.apache.axis.message.addressing.EndpointReferenceType epr)
          Create a registry proxy from an EPR and add it to the search path.
 List<SimpleRegistry> buildSearchPath(DefaultInvocationEngine engine, List<SimpleRegistry> localRegistries, List<org.apache.axis.message.addressing.EndpointReferenceType> remoteRegistries)
          Add local and remote registries to an engine's search path.
 void prettyPrint(DefaultInvocationEngine engine)
          Print the data structure of a DefaultInvocationEngine and its selectedRegistries list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistrySearchPathBuilder

public RegistrySearchPathBuilder(Map<Class,Class<? extends ProxyHelpers>> helperRegistry,
                                 WSDLCache wsdlCache)
Constructor.

Parameters:
helperRegistry - used in #addRemoteRegistry to construct the HelperProxyFactory
wsdlCache - used to construct the HelperProxyFactory
Method Detail

buildSearchPath

public List<SimpleRegistry> buildSearchPath(DefaultInvocationEngine engine,
                                            List<SimpleRegistry> localRegistries,
                                            List<org.apache.axis.message.addressing.EndpointReferenceType> remoteRegistries)
Add local and remote registries to an engine's search path.

Parameters:
localRegistries - list of registry objects to add
remoteRegistries - list of registry objects to add The localRegistries are appended to the search path first, then the remote registries (using addRemoteRegistryToSelectedRegistries(uk.ac.soton.itinnovation.grid.client.engine.impl.DefaultInvocationEngine, org.apache.axis.message.addressing.EndpointReferenceType) for each one.
Returns:
the engine's new search path

addRemoteRegistryToSelectedRegistries

public void addRemoteRegistryToSelectedRegistries(DefaultInvocationEngine engine,
                                                  org.apache.axis.message.addressing.EndpointReferenceType epr)
Create a registry proxy from an EPR and add it to the search path. The steps are:
  1. Clone the engine, including a copy of its search path.
  2. Create a proxy for the registry that uses this new engine.
  3. Add the new proxy to the original engine's search path.
Therefore, invocations later made using the original engine will search in the registry for extra information, but the invocations on the registry itself will only search the path as it was before the registry was added, preventing loops.


addAllKnownRegistriesToSelectedRegistries

public void addAllKnownRegistriesToSelectedRegistries(DefaultInvocationEngine engine)
                                               throws RemoteException
Throws:
RemoteException

prettyPrint

public void prettyPrint(DefaultInvocationEngine engine)
Print the data structure of a DefaultInvocationEngine and its selectedRegistries list.

Parameters:
engine - The DefaultInvocationEngine to print


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.