com.ibm.adt.topology.handler
Class ConfigurationHandler

java.lang.Object
  extended by com.ibm.adt.topology.handler.ConfigurationHandler

public abstract class ConfigurationHandler
extends java.lang.Object

The ConfigurationHandler abstract class specifies the interface that must be implemented in order to parse a file or directory on the file system and return a list of providers that are regeistered to handle this type of artifact. All provider implementations must implement a provider-specific ConfigurationHandler class, though it is also possible to create a ConfigurationHandler that parses a given location and delegates the detection of providers to the provider-specific ConfigurationHandlers that are registered with TopologyService.

See Also:
TopologyServiceFactory.getRegisteredConfigurationHandlers()

Field Summary
protected static TopologyServiceLogger logger
           
 
Constructor Summary
ConfigurationHandler()
           
 
Method Summary
protected  java.lang.String getInstanceName(java.lang.String providerType, java.lang.String location)
          A helper method to build a default instance name to be displayed when the configuration is loaded.
protected  java.lang.String getNameFromLocation(java.lang.String location)
          A helper method to build a default name from a location.
 ProviderInfo[] getProviders(java.lang.String location)
          Parses through the specified location and returns required provider types that must be instantiated to handle the contained files.
protected static void logInfo(java.lang.String string)
          Helper method to log an informational message.
protected static void logWarning(java.lang.String string)
          Helper method to log a warning message.
protected static void logWarning(java.lang.String string, java.lang.Exception e)
          Helper method to a log an exception along with a warning message.
abstract  ProviderInfo[] parseLocation(java.lang.String location)
          Method implemented by a ConfigurationHandler implementation to parse through the specified location to determine if the location contains data relevant to the provider type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static TopologyServiceLogger logger
Constructor Detail

ConfigurationHandler

public ConfigurationHandler()
Method Detail

parseLocation

public abstract ProviderInfo[] parseLocation(java.lang.String location)
                                      throws TopologyHandlerException
Method implemented by a ConfigurationHandler implementation to parse through the specified location to determine if the location contains data relevant to the provider type. Implementations of this method must be thread-safe.

Parameters:
location - the location to parse in the form of a file or directory
Returns:
an array of ProviderInfo objects that specifies the TopologyProvider types required to load the configurations contained in location
Throws:
TopologyHandlerException

getProviders

public final ProviderInfo[] getProviders(java.lang.String location)
                                  throws TopologyHandlerException
Parses through the specified location and returns required provider types that must be instantiated to handle the contained files.

Parameters:
location - the location to parse in the form of a file or directory
Returns:
an array of ProviderInfo objects that specifies the TopologyProvider types required to load the configurations contained in location
Throws:
TopologyHandlerException

getInstanceName

protected java.lang.String getInstanceName(java.lang.String providerType,
                                           java.lang.String location)
A helper method to build a default instance name to be displayed when the configuration is loaded. Provider implementors may wish to override this method for more customized behavior.

Parameters:
providerType - the provider type
location - the location
Returns:

getNameFromLocation

protected java.lang.String getNameFromLocation(java.lang.String location)
A helper method to build a default name from a location.

Parameters:
location - the location
Returns:

logInfo

protected static void logInfo(java.lang.String string)
Helper method to log an informational message.

Parameters:
string - the message to log

logWarning

protected static void logWarning(java.lang.String string)
Helper method to log a warning message.

Parameters:
string - the message to log

logWarning

protected static void logWarning(java.lang.String string,
                                 java.lang.Exception e)
Helper method to a log an exception along with a warning message.

Parameters:
string - the message to log
e - the Exception


© Copyright 2006 IBM Corp. 2006 All Rights Reserved