com.bigdata.rdf
Class ServiceProviderHook

java.lang.Object
  extended by com.bigdata.rdf.ServiceProviderHook

public class ServiceProviderHook
extends Object

This static class provides a hook which allows the replacement of services registered via the openrdf ServiceRegistry pattern which makes use of the same underlying pattern which is disclosed by the ServiceLoader.

The ServiceRegistry pattern provides a declarative association between a service and a service provider. The service declarations are located in META-INF/services/ packages. Each file in such a package name the service interface and the contents of the file name the service provider(s). The set of all such service provides located in all such service packages is registered for a given service interface. For openrdf, the service provides are initially associated with a key, such as an RDFFormat, QueryLanguage, etc.

However, this service registration pattern does not support the specification of a preferred service provider. In the context of multiple service providers for the same key and service interface, there is no way to control which service provider will remain in the ServiceRegistry.

This effects things such as the bigdata extension for the RDF/XML parser which adds support for SIDs mode interchange and the interchange of StatementEnum metadata.

This class is used to "hook" the various service registeries and force the use of the bigdata extension when it adds semantics not present in the base service provider implementation. For such "hooked" services providers, the service registry pattern using META-INF/services is not manditory, but following the pattern is never the less recommended.

Version:
$Id: ServiceProviderHook.java 6327 2012-06-01 21:14:22Z thompsonbry $
Author:
Bryan Thompson
See Also:
Class loader problems

Constructor Summary
ServiceProviderHook()
           
 
Method Summary
static void forceLoad()
          This hook may be used to force the load of this class so it can ensure that the bigdata version of a service provider is used instead of the openrdf version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceProviderHook

public ServiceProviderHook()
Method Detail

forceLoad

public static void forceLoad()
This hook may be used to force the load of this class so it can ensure that the bigdata version of a service provider is used instead of the openrdf version. This is NOT optional. Without this hook, we do not have control over which version is resolved last in the processed META-INF/services files.



Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.