[hydra-commits] hydra/slice.git branch "master" created.

Commits to the Hydra project code repositories hydra-commits at lists.digium.com
Thu Aug 5 15:12:11 CDT 2010


branch "master" has been created
        at  838d58f5fc9a967e6695b4f67b71097adadbd82c (commit)

- Log -----------------------------------------------------------------
commit 838d58f5fc9a967e6695b4f67b71097adadbd82c
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Aug 5 17:27:36 2010 -0300

    Add the service locator slice to the newly created slice repository. More will join, shortly.

diff --git a/core/service_locator.ice b/core/service_locator.ice
new file mode 100644
index 0000000..ae0bea9
--- /dev/null
+++ b/core/service_locator.ice
@@ -0,0 +1,157 @@
+#include <Ice/BuiltinSequences.ice>
+
+module Hydra
+{
+
+module System
+{
+
+module Discovery
+{
+
+module V1
+{
+
+	/**
+	 * Exception used for service locator requests to indicate that no service could be found.
+	 */
+	exception ServiceNotFound { };
+
+	/**
+	 * Exception used for indicating that a comparator is already registered with a given guid.
+	 */
+	exception DuplicateCompare { };
+
+	/**
+	 * Exception used for indicating that a comparator was not found.
+	 */
+	exception CompareNotFound { };
+
+	/**
+	 * Generic service locator parameters class that more specific parameter classes can extend.
+	 */
+	["preserved"] class ServiceLocatorParams
+	{
+		/**
+		 * Basic category for the service, such as bridge or channel service.
+		 */
+		string category;
+	};
+
+	/**
+	 * Interface used to perform service locator requests.
+	 */
+	interface ServiceLocator
+	{
+		/**
+		 * Method which performs a locator request using provided parameters but only returns a single
+		 * proxy.
+		 *
+		 * @param params A concrete class containing parameters describing the service that is trying to be found.
+		 *
+		 * @return A proxy to the service matching the given parameters.
+		 */
+		idempotent Object *locate(ServiceLocatorParams params) throws ServiceNotFound;
+
+		/**
+		 * Method which performs a location request using provided parameters but can return multiple
+		 * proxies.
+		 *
+		 * @param params A concrete class containing parameters describing the service that is trying to be found.
+		 *
+		 * @return A sequence of proxies which match the given parameters.
+		 */
+		idempotent Ice::ObjectProxySeq locateAll(ServiceLocatorParams params) throws ServiceNotFound;
+	};
+
+	/**
+	 * Interface to the service locator component which allows manipulation of registered service.
+	 */
+	interface ServiceManagement
+	{
+		/**
+		 * Method which adds supported discovery parameters to a registered service.
+		 *
+		 * @param params A concrete class containing parameters describing what is supported.
+		 *
+		 * @param compareguid The unique identifier of a comparator which can perform a lower level
+		 *              comparison to determine whether supplied parameters in a locator request
+		 *              are truly supported or not. This is optional.
+		 */
+		void addLocatorParams(ServiceLocatorParams params, string compareguid);
+
+		/**
+		 * Method which suspends this service from being considered when a locator request
+		 * is performed.
+		 */
+		void suspend();
+
+		/**
+		 * Method which unsuspends this service. Once this method is called the service will
+		 * be able to found again when a locator request is performed.
+		 */
+		void unsuspend();
+
+		/**
+		 * Method which unregisters this service from the service locator.
+		 */
+		void unregister();
+	};
+
+	/**
+	 * Interface to an external component which performs a service locator parameters comparison.
+	 */
+	interface ServiceLocatorParamsCompare
+	{
+		/**
+		 * Method which determines whether provided parameters are supported by the
+		 * comparator or not.
+		 *
+		 * @param params A concrete class containing parameters describing the service that is trying to be found.
+		 *
+		 * @return A boolean value with true meaning the parameters are supported and false if not.
+		 *
+		 */
+		bool isSupported(ServiceLocatorParams params);
+	};
+
+	/**
+	 * Interface to do service locator management, such as adding services and comparators.
+	 */
+	interface ServiceLocatorManagement
+	{
+		/**
+		 * Method which adds a service to the service locator.
+		 *
+		 * @param service A proxy to the service that is being registered.
+		 *
+		 * @param guid A unique identifier for the service which is used in events.
+		 *
+		 * @return A proxy to the service management interface for this service.
+		 */
+		ServiceManagement *addService(Object *service, string guid);
+
+		/**
+		 * Method which adds a comparator to the service locator.
+		 *
+		 * @param compareguid A unique identifier for this comparator.
+		 *
+		 * @param compare A proxy to the comparator service.
+		 */
+		void addCompare(string compareguid, ServiceLocatorParamsCompare *compare) throws DuplicateCompare;
+
+		/**
+		 * Method which removes a comparator from the service locator.
+		 *
+		 * @param compareguid The unique identifier for the comparator to remove.
+		 */
+		void removeCompare(string compareguid) throws CompareNotFound;
+	};
+
+}; // end module V1
+
+}; // end module Discovery
+
+}; // end module System
+
+}; // end module Hydra

-----------------------------------------------------------------------


-- 
hydra/slice.git




More information about the asterisk-scf-commits mailing list