org.tm4j.net
Interface LocatorFactory

All Known Implementing Classes:
LocatorFactoryBase

public interface LocatorFactory

Interface that is implemented by factory classes used for the creation of Locators.

Since:
0.6.0
Author:
Kal Ahmed

Method Summary
 Locator createLocator(java.lang.String notation, java.lang.String address)
          Creates a new locator.
 void registerImplementation(java.lang.String notation, java.lang.Class implClass)
          Registers a locator implementation.
 void removeImplementation(java.lang.Class implClass)
          Unregisters a locator implementation.
 

Method Detail

registerImplementation

public void registerImplementation(java.lang.String notation,
                                   java.lang.Class implClass)
Registers a locator implementation. After the implementation is registered with the factory, a locator using this implementation can be created by invoking createLocator(String, String).

Parameters:
notation - the notation to be associated with the implementation.
implClass - the class that represents the actual locator implementation. This class must implement the Locator interface.

removeImplementation

public void removeImplementation(java.lang.Class implClass)
Unregisters a locator implementation. After the implementation is registered with the factory, a locator using this implementation can no longer be created by invoking createLocator(String, String).

Parameters:
implClass - the class that represents the locator implementation to be removed. If this class has not yet been registered, it is silently ignored.

createLocator

public Locator createLocator(java.lang.String notation,
                             java.lang.String address)
                      throws LocatorFactoryException
Creates a new locator. In order for the locator to be created correctly, its notation and implementing class must first have been registered with the factory using registerImplementation(String, Class).

Parameters:
notation - the notation to be associated with the new locator.
address - the address to be associated with the new locator.
Throws:
LocatorFactoryException - If no locator implementation class associated with notation has yet been registered, or an unexpected condition occurred during locator instantiation.