2020-11-26 17:14:18 +01:00
|
|
|
import sys
|
2020-11-22 20:17:57 +01:00
|
|
|
from datetime import datetime
|
|
|
|
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.configuration.configuration import Configuration
|
|
|
|
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
|
2020-11-27 11:24:47 +01:00
|
|
|
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
|
2020-11-26 19:17:05 +01:00
|
|
|
from sh_edraft.hosting.base.environment_base import EnvironmentBase
|
|
|
|
from sh_edraft.hosting.hosting_environment import HostingEnvironment
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.hosting.application_runtime import ApplicationRuntime
|
2020-11-26 10:45:02 +01:00
|
|
|
from sh_edraft.hosting.base.application_host_base import ApplicationHostBase
|
2020-11-25 21:41:45 +01:00
|
|
|
from sh_edraft.service.service_provider import ServiceProvider
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.service.base.service_provider_base import ServiceProviderBase
|
2020-11-22 20:17:57 +01:00
|
|
|
|
|
|
|
|
2020-11-25 21:41:45 +01:00
|
|
|
class ApplicationHost(ApplicationHostBase):
|
2020-11-26 11:20:21 +01:00
|
|
|
|
2020-11-26 17:14:18 +01:00
|
|
|
def __init__(self, name: str):
|
2020-11-25 21:41:45 +01:00
|
|
|
ApplicationHostBase.__init__(self)
|
2020-11-26 11:20:21 +01:00
|
|
|
self._name: str = name
|
2020-11-26 17:14:18 +01:00
|
|
|
self._args: list[str] = sys.argv
|
2020-11-26 18:58:08 +01:00
|
|
|
|
|
|
|
self._config = Configuration()
|
2020-11-26 19:17:05 +01:00
|
|
|
self._environment = HostingEnvironment()
|
|
|
|
self._app_runtime = ApplicationRuntime(self._config, self._environment)
|
2020-11-26 18:58:08 +01:00
|
|
|
self._services = ServiceProvider(self._app_runtime)
|
|
|
|
|
2020-11-22 20:17:57 +01:00
|
|
|
self._start_time: datetime = datetime.now()
|
2020-11-26 10:45:02 +01:00
|
|
|
self._end_time: datetime = datetime.now()
|
2020-11-22 20:17:57 +01:00
|
|
|
|
2020-11-26 11:20:21 +01:00
|
|
|
@property
|
|
|
|
def name(self) -> str:
|
|
|
|
return self._name
|
2020-11-22 20:17:57 +01:00
|
|
|
|
2020-11-27 11:24:47 +01:00
|
|
|
@property
|
|
|
|
def configuration(self) -> ConfigurationBase:
|
|
|
|
return self._config
|
|
|
|
|
2020-11-26 19:17:05 +01:00
|
|
|
@property
|
|
|
|
def environment(self) -> EnvironmentBase:
|
|
|
|
return self._environment
|
|
|
|
|
2020-11-22 20:17:57 +01:00
|
|
|
@property
|
2020-11-27 11:24:47 +01:00
|
|
|
def application_runtime(self) -> ApplicationRuntimeBase:
|
|
|
|
return self._app_runtime
|
2020-11-22 20:17:57 +01:00
|
|
|
|
2020-11-26 11:55:55 +01:00
|
|
|
@property
|
|
|
|
def services(self) -> ServiceProviderBase:
|
|
|
|
return self._services
|
2020-11-26 18:58:08 +01:00
|
|
|
|
|
|
|
def create(self): pass
|