public final class DestinationAccessor extends Object
DestinationLoader
, offering platform agnostic access to destinations.Modifier and Type | Method and Description |
---|---|
static Destination |
getDestination(String destinationName)
Loads the destination with the given name.
|
static DestinationLoader |
getLoader()
The loader containing the platform specific logic to retrieve destinations.
|
static void |
setLoader(DestinationLoader loader)
Sets the loader to be used for all future method invocations on this
DestinationAccessor . |
static io.vavr.control.Try<Destination> |
tryGetDestination(String destinationName)
Loads the destination with the given name.
|
public static void setLoader(@Nullable DestinationLoader loader)
DestinationAccessor
.
If null
is provided this will fallback to the default loader, which has the following priority list:
ServiceLoader
patternServiceLoader
finds multiple DestinationLoader
it will behave as if none was given, as no
deterministic order of resolution could be identified. Use the DestinationLoaderChain
to create your own
priority.loader
- The new loader to be used. If null
is provided the default loader will be used instead.@Nonnull public static Destination getDestination(@Nonnull String destinationName) throws DestinationAccessException
destinationName
- The name of the destination to search for.DestinationAccessException
- Exception describing what went wrong.@Nonnull public static io.vavr.control.Try<Destination> tryGetDestination(@Nonnull String destinationName)
destinationName
- The name of the destination to search for.Try
containing either the destination or an exception describing what went wrong.@Nonnull public static DestinationLoader getLoader()
Copyright © 2020 SAP SE. All rights reserved.