org.apache.synapse.util.resolver
Class ResourceMap

java.lang.Object
  extended by org.apache.synapse.util.resolver.ResourceMap

public class ResourceMap
extends Object

A resource map. Instances of this class are used to resolve resources using registry entries. This is useful for XML documents that can reference other documents (e.g. WSDL documents importing XSD or other WSDL documents). A ResourceMap object contains a set of (location, registry key) mappings. The resolve method can be used to get retrieve the registry entry registered for a given location as an InputSource object.


Constructor Summary
ResourceMap()
           
 
Method Summary
 void addResource(String location, String key)
          Add a resource.
 Map<String,String> getResources()
          Get the (location, registry key) mappings.
 InputSource resolve(SynapseConfiguration synCfg, String location)
          Resolve a resource for a given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceMap

public ResourceMap()
Method Detail

addResource

public void addResource(String location,
                        String key)
Add a resource.

Parameters:
location - the location as it appears in referencing documents
key - the registry key that points to the referenced document

getResources

public Map<String,String> getResources()
Get the (location, registry key) mappings.

Returns:
a map containing the (location, registry key) pairs

resolve

public InputSource resolve(SynapseConfiguration synCfg,
                           String location)
Resolve a resource for a given location.

Parameters:
synCfg - the Synapse configuration (used to access the registry)
location - the location of of the resource at is appears in the referencing document
Returns:
an InputSource object for the referenced resource


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.