sh_cpl/src/sh_edraft/hosting/application_host.py

51 lines
1.7 KiB
Python
Raw Normal View History

2020-11-26 17:14:18 +01:00
import sys
from datetime import datetime
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
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
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
from sh_edraft.service.base.service_provider_base import ServiceProviderBase
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
self._config = Configuration()
self._environment = HostingEnvironment()
self._app_runtime = ApplicationRuntime(self._config, self._environment)
self._services = ServiceProvider(self._app_runtime)
self._start_time: datetime = datetime.now()
2020-11-26 10:45:02 +01:00
self._end_time: datetime = datetime.now()
2020-11-26 11:20:21 +01:00
@property
def name(self) -> str:
return self._name
2020-11-27 11:24:47 +01:00
@property
def configuration(self) -> ConfigurationBase:
return self._config
@property
def environment(self) -> EnvironmentBase:
return self._environment
@property
2020-11-27 11:24:47 +01:00
def application_runtime(self) -> ApplicationRuntimeBase:
return self._app_runtime
2020-11-26 11:55:55 +01:00
@property
def services(self) -> ServiceProviderBase:
return self._services
def create(self): pass