Author: remi
Date: 2009-06-02 11:18:05 +0200 (Tue, 02 Jun 2009)
New Revision: 4720

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
   
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
Log:
* added new event type from plugins (actuation)
* handled this new event in the plugins server resource

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-06-02 08:16:39 UTC (rev 4719)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-06-02 09:18:05 UTC (rev 4720)
@@ -105,6 +105,7 @@
         plugin.setOnPluginErrorCallback(self.__onPluginError)
         plugin.setOnPluginTraceCallback(self.__onPluginTrace)
         plugin.setOnPluginResultCallback(self.__onPluginResult)
+        plugin.setOnPluginActuationCallback(self.__onPluginActuation)
         plugin.setOnPluginStartingCallback(self.__onPluginStarting)
         plugin.setOnPluginStoppedCallback(self.__onPluginStopped)
         self.logger.logDebug("Plugin deployed [%s] to [%s]" % (
@@ -173,6 +174,13 @@
         self.logger.logDebug("Plugin RESULT [%s] (%s)" % (
             plugin.getDescription().getName(), str(pluginResult)))
 
+    def __onPluginActuation(self, plugin, instanceParameters, *messagesList):
+        messageStr = ""
+        for message in messagesList:
+            messageStr += message
+        self.logger.logDebug("Plugin ACTUATION [%s] (%s)" % (
+            plugin.getDescription().getName(), messageStr))
+
     def __onPluginStarting(self, plugin, instanceParameters, instanceCommand,
         instanceIsDaemon):
         uuid = plugin.getDescription().getUuid()

Modified: 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
     2009-06-02 08:16:39 UTC (rev 4719)
+++ 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
     2009-06-02 09:18:05 UTC (rev 4720)
@@ -170,6 +170,7 @@
         self.__onPluginErrorCallback = None
         self.__onPluginTraceCallback = None
         self.__onPluginResultCallback = None
+        self.__onPluginActuationCallback = None
         self.__onPluginStartingCallback = None
         self.__onPluginStoppedCallback = None
 
@@ -577,6 +578,18 @@
         self.__onPluginResultCallback = funct
 
     # 
--------------------------------------------------------------------------
+    # Set the plugin actuation event callback.
+    # 
--------------------------------------------------------------------------
+    def setOnPluginActuationCallback(self, funct):
+        """Set the plugin actuation event callback.
+        @param funct: Function pointer.
+        Function prototype:
+        def onPluginActuation(plugin, instanceParameters, *messagesList):
+            pass
+        """
+        self.__onPluginActuationCallback = funct
+
+    # 
--------------------------------------------------------------------------
     # Set the plugin starting event callback.
     # 
--------------------------------------------------------------------------
     def setOnPluginStartingCallback(self, funct):
@@ -653,6 +666,10 @@
                     checkResult = False
                 self.__onPluginResultCallback(self,
                     self.__pluginInstanceParameters, checkResult)
+        elif messageId == "actuation":
+            if self.__onPluginActuationCallback != None:
+                self.__onPluginActuationCallback(self,
+                    self.__pluginInstanceParameters, *args)
         else:
             if self.__onPluginNotificationCallback != None:
                 self.__onPluginNotificationCallback(self,


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to