[hydra-commits] hydra/slice.git branch "master" updated.
Commits to the Hydra project code repositories
hydra-commits at lists.digium.com
Fri Aug 6 09:47:40 CDT 2010
branch "master" has been updated
via c504b2a1c5b2ec18ffbac48bca5f365ad60ad414 (commit)
from 5d56f5e4bde77999c3f5f85f6d0cb423a86641d2 (commit)
Summary of changes:
Core/CMakeLists.txt | 4 ++-
Core/Service.ice | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletions(-)
create mode 100644 Core/Service.ice
- Log -----------------------------------------------------------------
commit c504b2a1c5b2ec18ffbac48bca5f365ad60ad414
Author: Brent Eagles <beagles at digium.com>
Date: Fri Aug 6 12:16:00 2010 -0230
Adding a core service interface.
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 847f795..c7d360c 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -4,8 +4,10 @@ hydra_compile_slice(ServiceLocatorI.ice lib "Slice Defined API" Core)
# Can't forget about events
hydra_compile_slice(ServiceLocatorEventsI.ice lib "Slice Defined API" Core)
+hydra_compile_slice(Service.ice lib "Slice Defined API" Core)
+
# Slice definitions for Endpoint functionality
add_subdirectory(Endpoint)
# Slice definitions for Routing functionality
-add_subdirectory(Routing)
\ No newline at end of file
+add_subdirectory(Routing)
diff --git a/Core/Service.ice b/Core/Service.ice
new file mode 100644
index 0000000..11b5593
--- /dev/null
+++ b/Core/Service.ice
@@ -0,0 +1,60 @@
+#pragma once
+module Hydra
+{
+module Core
+{
+module V1
+{
+ const string Version = "V1";
+
+ /**
+ * ShuttingDown is thrown when an operation is performed when a service is in the process
+ * of shutting itself down. This exception may be thrown from other interface methods
+ */
+ exception ShuttingDown {};
+
+ /**
+ * Suspended is thrown when a service cannot perform an operation because it is a suspended
+ * state.
+ */
+ exception Suspended {};
+
+ /**
+ * Service is the base interface for all Hydra services. Most components will include an implementation
+ * of this or a derived interface.
+ */
+ interface Service
+ {
+ /**
+ * Suspends activity in the service. In general this means that the primary activity of a service
+ * is suspended. Queries about state etc, may or may not be available. Calling suspend on a service
+ * that is suspended should be treated as a no-op.
+ *
+ * @throws ShuttingDown if the service is in the process of shutting down.
+ */
+ void suspend() throws ShuttingDown;
+
+ /**
+ * Resumes a service that has been suspended. After this call returns the suspended service
+ * must be ready to handle requests in a manner consistent with its state at the time the service
+ * was suspended.
+ *
+ * @throws ShuttingDown if the service is in the process of shutting down.
+ */
+ void resume() throws ShuttingDown;
+
+ /**
+ * Commences a clean shutdown of the services. The details of shutdown are implementation specific.
+ * For example, some services will begin to reject requests immediately after being shutdown but
+ * resume requests currently being handled. Others might abort requests in progress. A component
+ * implementing this interface should indicate if requests will be aborted or not on shutdown.
+ *
+ * @throws Suspended if the service is suspended.
+ */
+ void shutdown() throws Suspended;
+ };
+
+}; // End of module V1
+}; // End of module Core
+}; // End of module Hydra
+
-----------------------------------------------------------------------
--
hydra/slice.git
More information about the asterisk-scf-commits
mailing list