org.tm4j.net
Interface LocatorResolverManager

All Superinterfaces:
LocatorResolver
All Known Implementing Classes:
SimpleLocatorResolverManager

public interface LocatorResolverManager
extends LocatorResolver

Manages a collection of LocatorResolvers. New resolvers can be added for specific locator notation schemes. The Manager also acts as a coordinator of all the contained resolvers — selecting the appropriate resolver to use by examining the notation of the locator passed in.

Since:
0.7.0
Author:
Kal Ahmed

Method Summary
 LocatorResolver addResolver(java.lang.String notation, LocatorResolver resolver)
          Adds a resolver for the specified notation to this manager.
 LocatorResolver getResolver(java.lang.String notation)
          Returns the resolver for the specified notation.
 java.util.Map getResolverMap()
          Returns an unmodifiable Map of resolvers by the notation they resolve.
 void removeResolver(java.lang.String notation)
          Removes the resolver for the specified notation from the manager.
 
Methods inherited from interface org.tm4j.net.LocatorResolver
resolve
 

Method Detail

addResolver

public LocatorResolver addResolver(java.lang.String notation,
                                   LocatorResolver resolver)
Adds a resolver for the specified notation to this manager. A manager can manage only a single resolver for each notation.

Parameters:
notation - the notation resolved by the resolver.
resolver - the resolver to be added.
Returns:
the previously registered resolver for notation or null if there is no previously registered resolver for the notation.

getResolver

public LocatorResolver getResolver(java.lang.String notation)
Returns the resolver for the specified notation.

Parameters:
notation - the notation to locate the resolver for.
Returns:
The registered resolver for notation. Returns null if no resolver is registered for notation.

removeResolver

public void removeResolver(java.lang.String notation)
Removes the resolver for the specified notation from the manager. That resolver will be unregistered in the manager and locators with the specified notation will no longer be resolvable via the manager.

Parameters:
notation - The notation for which to remove the resolver.

getResolverMap

public java.util.Map getResolverMap()
Returns an unmodifiable Map of resolvers by the notation they resolve.

Returns:
Unmodifiable Map. Map key is the notation string, map value is the resolver registered for that notation.