Data Request Broker
2-3-release

fr.gael.drb.impl
Class DrbFactoryResolver

java.lang.Object
  extended by fr.gael.drb.impl.DrbFactoryResolver

public abstract class DrbFactoryResolver
extends Object

Abstract factory resolver. Registered metadata resolvers must identifies the target factory with the format property.


Constructor Summary
DrbFactoryResolver()
           
 
Method Summary
static fr.gael.drb.meta.DrbMetadataResolver getMetadataResolver()
           
static void registerFactory(String format, String classpath)
          Registers an implementation that handle the specified format.
static void registerMetadata(fr.gael.drb.meta.MetadataResolver metadata)
          Deprecated. DrbFactoryResolver no longer support multiple DrbMetadataResolver's. For compatibility purpose, this method now is equivalent to setMetadataResolver(DrbMetadataResolver) that replaces the current value. This method may be removed in a successive version.
static void registerSchema(String extension, String schema_location)
          Deprecated. the schema location should now be deduced from the DrbMetadata associated to the items. Calls to this operations now are equivalent to getMetadataResolver(). registerSchemaLocation(extension, schema_location). This only if the current resolver is the DrbDefaultMetadataResolver.
static DrbFactoryImpl resolveImpl(DrbNode base_node)
          Resolve a specific implementation that handle the specified base node.
static DrbFactoryImpl resolveImpl(String implementation_identifier)
          Retrieves an implementation factory denoted by a given implementation identifier.
static void setMetadataResolver(fr.gael.drb.meta.DrbMetadataResolver metadata_resolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrbFactoryResolver

public DrbFactoryResolver()
Method Detail

resolveImpl

public static DrbFactoryImpl resolveImpl(String implementation_identifier)
                                  throws NullPointerException
Retrieves an implementation factory denoted by a given implementation identifier.

Algorithm: the method looks first in this class internal register of implementation factories for creating an instance of the requested DrbFactoryImpl object. If the factory identifier was no found in the register, the method attempts to load an implementation factory class that would follow the pattern fr.gael.drb.impl.<identifier>.<Identifier>Factory, where <identifier> is the lower cased implementation identifier annd <Identifier> is the lowerCamlCase form of the same factory identifier. As an example, for the given "Xml" identifier, the searched class path would be fr.gael.drb.impl.xml.XmlFactory.

Note: the implementation identification is not case sensitive so, for example "file", "File" or "fIlE" would match the same implementation.

Parameters:
implementation_identifier - the implementation identifier
Returns:
an implementation factory or null if not found.
Throws:
NullPointerException - if the provided identifier is null.

resolveImpl

public static DrbFactoryImpl resolveImpl(DrbNode base_node)
Resolve a specific implementation that handle the specified base node.

Parameters:
base_node - the specified base node.
Returns:
an implementation.

getMetadataResolver

public static fr.gael.drb.meta.DrbMetadataResolver getMetadataResolver()

setMetadataResolver

public static void setMetadataResolver(fr.gael.drb.meta.DrbMetadataResolver metadata_resolver)

registerFactory

public static void registerFactory(String format,
                                   String classpath)
Registers an implementation that handle the specified format.

Parameters:
format - unique identifier of the factory
classpath - the classpath of the registered factory

registerSchema

public static void registerSchema(String extension,
                                  String schema_location)
Deprecated. the schema location should now be deduced from the DrbMetadata associated to the items. Calls to this operations now are equivalent to getMetadataResolver(). registerSchemaLocation(extension, schema_location). This only if the current resolver is the DrbDefaultMetadataResolver.

Registers a schema location.

Parameters:
extension - unique identifier of the schema
schema_location - the location path of the registered schema
See Also:
DrbDefaultMetadataResolver.registerSchemaLocation( String, String)

registerMetadata

public static void registerMetadata(fr.gael.drb.meta.MetadataResolver metadata)
Deprecated. DrbFactoryResolver no longer support multiple DrbMetadataResolver's. For compatibility purpose, this method now is equivalent to setMetadataResolver(DrbMetadataResolver) that replaces the current value. This method may be removed in a successive version.

Registers a metadata resolver

Parameters:
metadata - a metadata resolver

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .