Beispiel #1
0
class EmbeddedObjectStoreCapability(ContainerCapability):
    def __init__(self, container):
        ContainerCapability.__init__(self, container)
        self.container.object_store = None
        self._file_store = FileDataStore(container, datastore_name='objects')

    def start(self):
        self._file_store.start()
        self.container.object_store = self._file_store

    def stop(self):
        self._file_store.stop()
        self.container.object_store = None
Beispiel #2
0
class EmbeddedResourceRegistryCapability(ContainerCapability):
    def __init__(self, container):
        ContainerCapability.__init__(self, container)
        self.container.resource_registry = None
        self._file_store = FileDataStore(container, datastore_name='resources')
        resregistry.EventPublisher = EmbeddedEventPublisherCapability

    def start(self):
        self._file_store.start()
        self.container.resource_registry = ResourceRegistry(datastore_manager=self, container=self.container)

    def stop(self):
        self._file_store.stop()
        self.container.resource_registry = None

    def get_datastore(self, *args, **kwargs):
        return self._file_store
Beispiel #3
0
 def __init__(self, container):
     ContainerCapability.__init__(self, container)
     self.container.object_store = None
     self._file_store = FileDataStore(container, datastore_name='objects')
Beispiel #4
0
 def __init__(self, container):
     ContainerCapability.__init__(self, container)
     self.container.resource_registry = None
     self._file_store = FileDataStore(container, datastore_name='resources')
     resregistry.EventPublisher = EmbeddedEventPublisherCapability