| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | #nullable enable |
| | 4 | |
|
| | 5 | | namespace IceBox; |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// This exception is a general failure notification. |
| | 9 | | /// It is thrown for errors such as a service encountering an error during initialization, or the service manager |
| | 10 | | /// being unable to load a service executable. |
| | 11 | | /// </summary> |
| | 12 | | public sealed class FailureException : Ice.LocalException |
| | 13 | | { |
| 0 | 14 | | public string reason => Message; |
| | 15 | |
|
| | 16 | | public FailureException(string? message, System.Exception? innerException = null) |
| 0 | 17 | | : base(message, innerException) |
| | 18 | | { |
| 0 | 19 | | } |
| | 20 | |
|
| 0 | 21 | | public override string ice_id() => "::IceBox::FailureException"; |
| | 22 | | } |
| | 23 | |
|
| | 24 | | public interface Service |
| | 25 | | { |
| | 26 | | /// <summary> |
| | 27 | | /// Start the service. |
| | 28 | | /// The given communicator is created by the ServiceManager for use by the service. This |
| | 29 | | /// communicator may also be used by other services, depending on the service configuration. |
| | 30 | | /// <p class="Note">The ServiceManager owns this communicator, and is responsible for destroying it. |
| | 31 | | /// </summary> |
| | 32 | | /// <param name="name">The service's name, as determined by the configuration. |
| | 33 | | /// </param> |
| | 34 | | /// <param name="communicator">A communicator for use by the service. |
| | 35 | | /// </param> |
| | 36 | | /// <param name="args">The service arguments that were not converted into properties. |
| | 37 | | /// </param> |
| | 38 | | /// <exception name="FailureException">Raised if start failed.</exception> |
| | 39 | | void start(string name, Ice.Communicator communicator, string[] args); |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Stop the service. |
| | 43 | | /// </summary> |
| | 44 | | void stop(); |
| | 45 | | } |