public class ServiceProviderHook extends Object
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.
Modifier and Type | Field and Description |
---|---|
static String |
JSON_CONSTRUCT_PARSER_FACTORY |
static String |
JSON_CONSTRUCT_WRITER_FACTORY |
static org.openrdf.rio.RDFFormat |
JSON_RDR
The extension MIME type for RDR aware data interchange of RDF and SPARQL
result stes using JSON.
|
static String |
JSON_RESULT_PARSER_FACTORY |
static String |
JSON_WRITER_FACTORY |
static String |
NTRIPLES_PARSER_FACTORY |
static org.openrdf.rio.RDFFormat |
NTRIPLES_RDR
The extension MIME type for RDR data interchange using the RDR extension
of N-TRIPLES.
|
static String |
TURTLE_PARSER_FACTORY |
static org.openrdf.rio.RDFFormat |
TURTLE_RDR
The extension MIME type for RDR data interchange using the RDR extension
of TURTLE.
|
static String |
TURTLE_WRITER_FACTORY |
Constructor and Description |
---|
ServiceProviderHook() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected static Object |
getInstanceForClass(String className) |
public static final String NTRIPLES_PARSER_FACTORY
public static final String TURTLE_PARSER_FACTORY
public static final String TURTLE_WRITER_FACTORY
public static final String JSON_WRITER_FACTORY
public static final String JSON_CONSTRUCT_WRITER_FACTORY
public static final String JSON_RESULT_PARSER_FACTORY
public static final String JSON_CONSTRUCT_PARSER_FACTORY
public static final org.openrdf.rio.RDFFormat TURTLE_RDR
http://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right
public static final org.openrdf.rio.RDFFormat NTRIPLES_RDR
http://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right
public static final org.openrdf.rio.RDFFormat JSON_RDR
public static void forceLoad()
META-INF/services
files.
Note: We need to use a synchronized pattern in order to ensure that any threads contending for this method awaits its completion. It would not be enough for a thread to know that the method was running. The thread needs to wait until the method is done.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.