def create_process_instance(self, svc_mod, className): """Given a class name and a loaded module, instantiate the class with a receiver. """ svc_class = pu.get_class(className, svc_mod) #if not issubclass(svc_class,BaseProcess): # raise RuntimeError("class is not a BaseProcess") receiver = Receiver(svc_mod.__name__) serviceInstance = svc_class(receiver) logging.info('create_process_instance: created service instance '+str(serviceInstance)) return receiver
def init_container(): """ Performs global initializations on the local container on startup. """ _set_container_args(Container.args) interceptorsys = CONF.getValue('interceptor_system',None) if interceptorsys: logging.info("Setting capability container interceptor system") cls = pu.get_class(interceptorsys) Container.interceptor_system = cls() # Collect all service declarations in local code modules ModuleLoader().load_modules()
def slc_init(self): # use spawn args to determine backend class, second config file backendcls = self.spawnArgs.get('backend_class', CONF.getValue('backend_class', None)) backendargs = self.spawnArgs.get('backend_args', CONF.getValue('backend_args', {})) if backendcls: self.backend = pu.get_class(backendcls) else: self.backend = Store assert issubclass(self.backend, IStore) # Provide rest of the spawnArgs to init the store self.store = yield self.backend.create_store(**backendargs) logging.info("AttributeStoreService initialized")
def slc_init(self): # use spawn args to determine backend class, second config file backendcls = self.spawnArgs.get('backend_class', CONF.getValue('backend_class', None)) backendargs = self.spawnArgs.get('backend_args', CONF.getValue('backend_args', {})) if backendcls: self.backend = pu.get_class(backendcls) else: self.backend = Store assert issubclass(self.backend, IStore) # Provide rest of the spawnArgs to init the store self.os = ObjectStore(backend=self.backend, backargs=backendargs) yield self.os.init() logging.info("DatastoreService initialized")
def init_container(): """ Performs global initializations on the local container on startup. """ _set_container_args(Container.args) interceptorsys = CONF.getValue('interceptor_system',None) if interceptorsys: logging.info("Setting capability container interceptor system") cls = pu.get_class(interceptorsys) Container.interceptor_system = cls() # Collect all service declarations in local code modules ModuleLoader().load_modules() #Load All Resource Descriptions for future decoding description_utility.load_descriptions()
def slc_init(self): # use spawn args to determine backend class, second config file backendcls = self.spawn_args.get('backend_class', CONF.getValue('backend_class', None)) backendargs = self.spawn_args.get('backend_args', CONF.getValue('backend_args', {})) # self.backend holds the class which is instantiated to provide the Store for the registry if backendcls: self.backend = pu.get_class(backendcls) else: self.backend = store.Store assert issubclass(self.backend, store.IStore) # Provide rest of the spawnArgs to init the store s = yield self.backend.create_store(**backendargs) # Now pass the instance of store to create an instance of the registry self.reg = Registry(s) name = self.__class__.__name__ logging.info(name + " initialized; backend:%s; backend args:%s" % (backendcls, backendargs))
def slc_init(self): # use spawn args to determine backend class, second config file backendcls = self.spawn_args.get('backend_class', CONF.getValue('backend_class', default='ion.data.store.Store')) backendargs = self.spawn_args.get('backend_args', CONF.getValue('backend_args', default={})) self.backend = None # self.backend holds the class which is instantiated to provide the Store if backendcls: self.backend = pu.get_class(backendcls) else: self.backend = Store assert issubclass(self.backend, IStore) # Now create an instance of the backend class # Provide rest of the spawnArgs to init the store self.store = yield self.backend.create_store(**backendargs) name = self.__class__.__name__ logging.info(name + " initialized") logging.info(name + " backend:"+str(backendcls)) logging.info(name + " backend args:"+str(backendargs))
def slc_init(self): # use spawn args to determine backend class, second config file backendcls = self.spawn_args.get( 'backend_class', CONF.getValue('backend_class', default='ion.data.store.Store')) backendargs = self.spawn_args.get( 'backend_args', CONF.getValue('backend_args', default={})) self.backend = None # self.backend holds the class which is instantiated to provide the Store if backendcls: self.backend = pu.get_class(backendcls) else: self.backend = Store assert issubclass(self.backend, IStore) # Now create an instance of the backend class # Provide rest of the spawnArgs to init the store self.store = yield self.backend.create_store(**backendargs) name = self.__class__.__name__ logging.info(name + " initialized") logging.info(name + " backend:" + str(backendcls)) logging.info(name + " backend args:" + str(backendargs))