2 # Component is a GeniServer that implements the Component interface
13 from sfa.util.geniserver import GeniServer
14 from sfacomponent.plc.api import ComponentAPI
16 # GeniLight client support is optional
18 from egeni.geniLight_client import *
20 GeniClientLight = None
23 # Component is a GeniServer that serves component operations.
25 class Component(GeniServer):
27 # Create a new registry object.
29 # @param ip the ip address to listen on
30 # @param port the port to listen on
31 # @param key_file private key filename of registry
32 # @param cert_file certificate filename containing public key (could be a GID file)
34 def __init__(self, ip, port, key_file, cert_file):
35 GeniServer.__init__(self, ip, port, key_file, cert_file)
36 # re-initialize the servers api as Component api
37 self.server.api = ComponentAPI(interface='component', key_file=key_file, cert_file=cert_file)
38 self.server.interface = 'component'