public interface ExternalReferenceBuilderSPI<TargetType extends ExternalReferenceSPI>
ReferenceSetAugmentor
when there isn't a direct reference to
reference translation path available for a desired target type, but available
for external use wherever this functionality is needed.
Where an underlying resource is required this is extracted from the supplied ReferenceContext, this implies that all methods in implementations of this interface should be thread safe, allowing multiple concurrent threads cleanly. For SPI purposes implementations should be java beans with default constructors.
Modifier and Type | Method and Description |
---|---|
TargetType |
createReference(InputStream byteStream,
ReferenceContext context)
Given a stream of bytes, build the appropriate target
ExternalReferenceSPI implementation which would de-reference to the value
of that stream and return it.
|
float |
getConstructionCost()
Return an approximate complexity cost of the reference construction.
|
Class<TargetType> |
getReferenceType()
Expose the type of the ExternalReferenceSPI that this builder can
construct
|
boolean |
isEnabled(ReferenceContext context)
Because the reference builder may rely on facilities provided to it
through the context this method is available to check whether these
facilities are sufficient.
|
TargetType createReference(InputStream byteStream, ReferenceContext context)
byteStream
- the bytestream to read target from.context
- a reference resolution context, needed potentially to
construct the new ExternalReferenceSchemeSPI, especially in
cases where the context contains security agents giving access
to a remote data staging system *ExternalReferenceConstructionException
- if an error occurs instantiating the new reference.Class<TargetType> getReferenceType()
boolean isEnabled(ReferenceContext context)
context
- the reference context that will be used to construct new
referencesfloat getConstructionCost()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.