Improved service providing and app hosting

This commit is contained in:
2020-11-26 18:58:08 +01:00
parent cd7c12bba4
commit c6d1dce577
11 changed files with 118 additions and 79 deletions

View File

@@ -1,3 +1,4 @@
# imports:
from .application_host_base import ApplicationHostBase
from .environment_base import EnvironmentBase
from .application_base import ApplicationBase

View File

@@ -6,6 +6,9 @@ class ApplicationBase(ABC):
@abstractmethod
def __init__(self): pass
@abstractmethod
def create_application_host(self): pass
@abstractmethod
def create_configuration(self): pass

View File

@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod
from datetime import datetime
from sh_edraft.hosting.base.environment_base import EnvironmentBase
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
from sh_edraft.service.base.service_provider_base import ServiceProviderBase
class ApplicationHostBase(ABC):
@@ -12,27 +12,14 @@ class ApplicationHostBase(ABC):
@property
@abstractmethod
def name(self) -> str: pass
@property
@abstractmethod
def environment(self) -> EnvironmentBase: pass
@property
@abstractmethod
def start_time(self) -> datetime: pass
@start_time.setter
@abstractmethod
def start_time(self, start_time: datetime): pass
def configuration(self) -> ConfigurationBase: pass
@property
@abstractmethod
def end_time(self): pass
def services(self) -> ServiceProviderBase: pass
@end_time.setter
@abstractmethod
def end_time(self, end_time: datetime): pass
@property
@abstractmethod
def date_time_now(self) -> datetime: pass
def create(self): pass

View File

@@ -0,0 +1,34 @@
from abc import ABC, abstractmethod
from datetime import datetime
from sh_edraft.configuration.base import ConfigurationBase
class ApplicationRuntimeBase(ABC):
@abstractmethod
def __init__(self): pass
@property
@abstractmethod
def configuration(self) -> ConfigurationBase: pass
@property
@abstractmethod
def start_time(self) -> datetime: pass
@start_time.setter
@abstractmethod
def start_time(self, start_time: datetime): pass
@property
@abstractmethod
def end_time(self): pass
@end_time.setter
@abstractmethod
def end_time(self, end_time: datetime): pass
@property
@abstractmethod
def date_time_now(self) -> datetime: pass