Added logic to load config from json & improved hosting and service providing

This commit is contained in:
2020-11-28 15:13:54 +01:00
parent ff577b121e
commit 44ffb4e574
29 changed files with 285 additions and 141 deletions

View File

@@ -4,8 +4,6 @@ from datetime import datetime
from sh_edraft.configuration.configuration import Configuration
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
from sh_edraft.hosting.base.environment_base import EnvironmentBase
from sh_edraft.hosting.hosting_environment import HostingEnvironment
from sh_edraft.hosting.application_runtime import ApplicationRuntime
from sh_edraft.hosting.base.application_host_base import ApplicationHostBase
from sh_edraft.service.service_provider import ServiceProvider
@@ -14,31 +12,19 @@ from sh_edraft.service.base.service_provider_base import ServiceProviderBase
class ApplicationHost(ApplicationHostBase):
def __init__(self, name: str):
def __init__(self):
ApplicationHostBase.__init__(self)
self._name: str = name
self._args: list[str] = sys.argv
self._config = Configuration()
self._environment = HostingEnvironment()
self._app_runtime = ApplicationRuntime(self._config, self._environment)
self._app_runtime = ApplicationRuntime(self._config)
self._services = ServiceProvider(self._app_runtime)
self._start_time: datetime = datetime.now()
self._end_time: datetime = datetime.now()
@property
def name(self) -> str:
return self._name
@property
def configuration(self) -> ConfigurationBase:
return self._config
@property
def environment(self) -> EnvironmentBase:
return self._environment
@property
def application_runtime(self) -> ApplicationRuntimeBase:
return self._app_runtime