from pip_services4_components.refer import IReferenceable, IReferences, IUnreferenceable
from pip_services4_components.run import IOpenable
from pip_services4_components.exec import IExecutable
from pip_services4_components.config import IConfigurable
class MyComponentA(IReferenceable, IUnreferenceable, IConfigurable, IOpenable, IExecutable):
def __init__(self):
print("MyComponentA has been created.")
def configure(self, config):
print("MyComponentA has been configured.")
def is_open(self):
return self._open
def open(self, context):
print("MyComponentA has been opened.")
def close(self, context):
print("MyComponentA has been closed.")
def my_task(self, context):
print("Doing my business task")
dummy_variable = "dummy value"
def set_references(self, references):
print("MyComponentA's references have been defined.")
def unset_references(self):
print("References cleared")
def execute(self, context: str, args: str):
print('Executing')
result = args
return result