def stop(self, context): """ Bundle stopped """ assert isinstance(context, BundleContext) assert self.context is context if fw_raiser: raise FrameworkException("Framework Exception", fw_raiser_stop) if raiser: raise Exception("Some exception") global stopped stopped = True
def bind(self, svc, svc_ref): """ Bound """ self.states.append(IPopoEvent.BOUND) self.ref = svc_ref # Assert that the service is already usable assert self.service.echo(True) if self.fw_raiser: raise FrameworkException("FrameworkException", self.fw_raiser_stop) if self.raiser: raise Exception("Some exception")
def unbind(self, svc, svc_ref): """ Unbound """ self.states.append(IPopoEvent.UNBOUND) # Assert that the service is still usable assert self.service.echo(True) assert self.ref is svc_ref self.ref = None if self.fw_raiser: raise FrameworkException("FrameworkException", self.fw_raiser_stop) if self.raiser: raise Exception("Some exception")