Struct LocatorProxy
Implements ILocator by making invocations on a remote IceRPC service.
This remote service must implement Ice interface ::Ice::Locator.
[IceTypeId("::Ice::Locator")]
public readonly record struct LocatorProxy : ILocator, IIceProxy, IEquatable<LocatorProxy>
- Implements
- Inherited Members
- Extension Methods
Constructors
LocatorProxy()
Constructs a proxy that uses the default service address: its protocol is ice
and its path is DefaultServicePath.
public LocatorProxy()
LocatorProxy(IInvoker, ServiceAddress?, IceEncodeOptions?)
Constructs a proxy from an invoker, a service address and encode options.
[SetsRequiredMembers]
public LocatorProxy(IInvoker invoker, ServiceAddress? serviceAddress = null, IceEncodeOptions? encodeOptions = null)
Parameters
invokerIInvokerThe invocation pipeline of the proxy.
serviceAddressServiceAddressThe service address. null is equivalent to the default service address (protocol:
ice, path: DefaultServicePath).encodeOptionsIceEncodeOptionsThe encode options, used to customize the encoding of request payloads.
LocatorProxy(IInvoker, Uri, IceEncodeOptions?)
Constructs a proxy from an invoker, a service address URI and encode options.
[SetsRequiredMembers]
public LocatorProxy(IInvoker invoker, Uri serviceAddressUri, IceEncodeOptions? encodeOptions = null)
Parameters
invokerIInvokerThe invocation pipeline of the proxy.
serviceAddressUriUriA URI that represents a service address.
encodeOptionsIceEncodeOptionsThe encode options, used to customize the encoding of request payloads.
Fields
DefaultServicePath
Represents the default path for IceRPC services that implement Ice interface
::Ice::Locator.
public const string DefaultServicePath = "/Ice.Locator"
Field Value
Properties
EncodeOptions
Gets or initializes the encode options, used to customize the encoding of payloads created from this proxy.
public IceEncodeOptions? EncodeOptions { get; init; }
Property Value
Invoker
Gets or initializes the invocation pipeline of this proxy.
public required IInvoker Invoker { get; init; }
Property Value
ServiceAddress
Gets or initializes the address of the remote service.
public ServiceAddress ServiceAddress { get; init; }
Property Value
Methods
FindAdapterByIdAsync(string, IFeatureCollection?, CancellationToken)
Finds an object adapter by adapter ID and returns a dummy proxy with the object adapter's endpoint(s).
public Task<IceObjectProxy?> FindAdapterByIdAsync(string id, IFeatureCollection? features = null, CancellationToken cancellationToken = default)
Parameters
idstringThe adapter ID.
featuresIFeatureCollectionThe features of this invocation.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task<IceObjectProxy?>
A dummy proxy with the adapter's endpoints, or null if an object adapter with
idwas not found.
Exceptions
- DispatchException
Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.
- AdapterNotFoundException
Thrown when an object adapter with this adapter ID was not found. The caller should treat this exception like a null return value. This exception is provided through the returned task; it's never thrown synchronously.
FindObjectByIdAsync(Identity, IFeatureCollection?, CancellationToken)
Finds an object by identity and returns a dummy proxy with endpoint(s) that can be used to reach this object. This dummy proxy may be an indirect proxy that requires further resolution using FindAdapterByIdAsync(string, IFeatureCollection?, CancellationToken).
public Task<IceObjectProxy?> FindObjectByIdAsync(Identity id, IFeatureCollection? features = null, CancellationToken cancellationToken = default)
Parameters
idIdentityThe identity.
featuresIFeatureCollectionThe features of this invocation.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task<IceObjectProxy?>
A dummy proxy, or null if an object with the requested identity was not found.
Exceptions
- DispatchException
Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.
- ObjectNotFoundException
Thrown when an object with the requested identity was not found. The caller should treat this exception like a null return value. This exception is provided through the returned task; it's never thrown synchronously.
GetRegistryAsync(IFeatureCollection?, CancellationToken)
Gets a proxy to the locator registry.
public Task<LocatorRegistryProxy?> GetRegistryAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)
Parameters
featuresIFeatureCollectionThe features of this invocation.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task<LocatorRegistryProxy?>
A proxy to the locator registry, or null if this locator has no associated registry.
Exceptions
- DispatchException
Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.