moving component server here
authorTony Mack <tmack@cs.princeton.edu>
Wed, 25 Nov 2009 20:24:31 +0000 (20:24 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 25 Nov 2009 20:24:31 +0000 (20:24 +0000)
sfa/server/component.py [new file with mode: 0644]

diff --git a/sfa/server/component.py b/sfa/server/component.py
new file mode 100644 (file)
index 0000000..ab76961
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Component is a GeniServer that implements the Component interface
+#
+### $Id: 
+### $URL: 
+#
+
+import tempfile
+import os
+import time
+import sys
+
+from sfa.util.geniserver import GeniServer
+from sfacomponent.plc.api import ComponentAPI
+# GeniLight client support is optional
+try:
+    from egeni.geniLight_client import *
+except ImportError:
+    GeniClientLight = None            
+
+##
+# Component is a GeniServer that serves component operations.
+
+class Component(GeniServer):
+    ##
+    # Create a new registry object.
+    #
+    # @param ip the ip address to listen on
+    # @param port the port to listen on
+    # @param key_file private key filename of registry
+    # @param cert_file certificate filename containing public key (could be a GID file)
+
+    def __init__(self, ip, port, key_file, cert_file):
+        GeniServer.__init__(self, ip, port, key_file, cert_file)
+        # re-initialize the servers api as Component api  
+        self.server.api = ComponentAPI(interface='component', key_file=key_file, cert_file=cert_file)  
+        self.server.interface = 'component'